[Webkit-unassigned] [Bug 49791] [GTK] Implement SharedMemory for WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 11 09:45:25 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=49791


Martin Robinson <mrobinson at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #78527|review?                     |review-
               Flag|                            |




--- Comment #6 from Martin Robinson <mrobinson at webkit.org>  2011-01-11 09:45:23 PST ---
(From update of attachment 78527)
View in context: https://bugs.webkit.org/attachment.cgi?id=78527&action=review

Looks good, but consider using GLib functions. If it's not possible, I'll re-review.

> WebKit2/Platform/gtk/SharedMemoryGtk.cpp:55
> +    if ((lseek(fd, size - 1, SEEK_SET) == -1) || (write(fd, "", 1) != 1)) {
> +        close(fd);
> +        return 0;
> +    }

Is this just verifying that the file is writable?

> WebKit2/Platform/gtk/SharedMemoryGtk.cpp:61
> +    void* mappedMemory = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
> +    if (mappedMemory == MAP_FAILED) {
> +        close(fd);
> +        return 0;
> +    }

Is it possible to use GMappedFile here? I think it makes sense to use GLib function wherever possible. This will make this function platform independent and also prevent the need for the above code.

> WebKit2/Platform/gtk/SharedMemoryGtk.cpp:77
> +    void* mappedMemory = mmap(0, size, mode, MAP_SHARED, fd, 0);
> +    if (mappedMemory == MAP_FAILED) {
> +        close(fd);
> +        return 0;
> +    }

Ditto.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list