Bug 160364 - [GTK][Unix] Implement missing WebKit::SharedMemory::create() function
Summary: [GTK][Unix] Implement missing WebKit::SharedMemory::create() function
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords:
Depends on:
Blocks: 154553
  Show dependency treegraph
 
Reported: 2016-07-29 16:30 PDT by Adrian Perez
Modified: 2016-07-31 01:32 PDT (History)
7 users (show)

See Also:


Attachments
Patch (3.28 KB, patch)
2016-07-29 16:38 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch (3.30 KB, patch)
2016-07-30 03:46 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2016-07-29 16:30:11 PDT
The WebKit::SharedMemory::create() function is missing for the Unix platform,
which is also used by the GTK port.
Comment 1 Adrian Perez 2016-07-29 16:38:15 PDT
Created attachment 284916 [details]
Patch
Comment 2 Carlos Garcia Campos 2016-07-29 23:58:16 PDT
Comment on attachment 284916 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=284916&action=review

> Source/WebKit2/ChangeLog:3
> +        Implement WebKit::SharedMemory::create() for the Unix platform.

Please, use the actual bug title here.

> Source/WebKit2/ChangeLog:14
> +        (WebKit::accessModeMMap): Added helper function to convert a
> +        SharedMemory::Protection value into flags useable with mmap().

You are not adding it, but moving it, no?

> Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp:109
> +RefPtr<SharedMemory> SharedMemory::create(void* addr, size_t size, Protection protection)

Do not use abbreviations, use either just data or address, but not addr

> Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp:153
> +    return SharedMemory::create(0, size, SharedMemory::Protection::ReadWrite);

Use nullptr instead of 0.
Comment 3 Adrian Perez 2016-07-30 03:46:13 PDT
Created attachment 284939 [details]
Patch
Comment 4 Adrian Perez 2016-07-30 03:49:43 PDT
(In reply to comment #2)
> Comment on attachment 284916 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=284916&action=review
> 
> > Source/WebKit2/ChangeLog:3
> > +        Implement WebKit::SharedMemory::create() for the Unix platform.
> 
> Please, use the actual bug title here.

Done.

> > Source/WebKit2/ChangeLog:14
> > +        (WebKit::accessModeMMap): Added helper function to convert a
> > +        SharedMemory::Protection value into flags useable with mmap().
> 
> You are not adding it, but moving it, no?

The function did not exist before (It has a couple of lines picked from
the old implementation of SharedMemory::allocate(), though).

> > Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp:109
> > +RefPtr<SharedMemory> SharedMemory::create(void* addr, size_t size, Protection protection)
> 
> Do not use abbreviations, use either just data or address, but not addr
> 
> > Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp:153
> > +    return SharedMemory::create(0, size, SharedMemory::Protection::ReadWrite);
> 
> Use nullptr instead of 0.

Fixed.
Comment 5 WebKit Commit Bot 2016-07-31 01:32:31 PDT
Comment on attachment 284939 [details]
Patch

Clearing flags on attachment: 284939

Committed r203954: <http://trac.webkit.org/changeset/203954>
Comment 6 WebKit Commit Bot 2016-07-31 01:32:36 PDT
All reviewed patches have been landed.  Closing bug.