Bug 160364

Summary: [GTK][Unix] Implement missing WebKit::SharedMemory::create() function
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, beidson, bugs-noreply, cgarcia, commit-queue, koivisto, mcatanzaro
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 154553    
Attachments:
Description Flags
Patch
none
Patch none

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.