Bug 225576 - IPC testing API should have the ability to send and receive shared memory
Summary: IPC testing API should have the ability to send and receive shared memory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-08 23:38 PDT by Ryosuke Niwa
Modified: 2021-05-09 13:42 PDT (History)
5 users (show)

See Also:


Attachments
Patch (40.39 KB, patch)
2021-05-09 00:05 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff
Patch for landing (40.75 KB, patch)
2021-05-09 11:21 PDT, Ryosuke Niwa
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2021-05-08 23:38:45 PDT
In order to support DisplayList fuzzing, we need the ability to create & receive shared memory.
Comment 1 Ryosuke Niwa 2021-05-09 00:05:05 PDT
Created attachment 428113 [details]
Patch
Comment 2 Wenson Hsieh 2021-05-09 10:55:55 PDT
Comment on attachment 428113 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:108
> +    size_t size() { return m_sharedMemory->size(); }

Nit - we can make this method const

> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:136
> +    RefPtr<SharedMemory> m_sharedMemory;

Nit - I think this can be a `Ref<SharedMemory> m_sharedMemory;`?

> Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:376
> +    return unwrap(JSValueToObject(context, value, 0));

Nit - use nullptr instead of 0?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:294
> +TEST(IPCTestingAPI, CanSendSemaphpre)

Nit - CanSendSemaphore
Comment 3 Ryosuke Niwa 2021-05-09 11:08:53 PDT
Thank you for the review!

(In reply to Wenson Hsieh from comment #2)
> Comment on attachment 428113 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=428113&action=review
> 
> > Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:108
> > +    size_t size() { return m_sharedMemory->size(); }
> 
> Nit - we can make this method const

Done.
 
> > Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:136
> > +    RefPtr<SharedMemory> m_sharedMemory;
> 
> Nit - I think this can be a `Ref<SharedMemory> m_sharedMemory;`?

Yeah, it really should be but SharedMemory::allocate returns RefPtr :( I guess I'm gonna just dereference RefPtr there.

> > Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp:376
> > +    return unwrap(JSValueToObject(context, value, 0));
> 
> Nit - use nullptr instead of 0?

Fixed.

> > Tools/TestWebKitAPI/Tests/WebKitCocoa/IPCTestingAPI.mm:294
> > +TEST(IPCTestingAPI, CanSendSemaphpre)
> 
> Nit - CanSendSemaphore

Oh oops, fixed.
Comment 4 Ryosuke Niwa 2021-05-09 11:21:26 PDT
Created attachment 428130 [details]
Patch for landing
Comment 5 EWS 2021-05-09 11:57:29 PDT
Committed r277250 (237519@main): <https://commits.webkit.org/237519@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428130 [details].
Comment 6 Radar WebKit Bug Importer 2021-05-09 11:58:14 PDT
<rdar://problem/77717870>