RESOLVED FIXED 176562
Clean up Geolocation request handling
https://bugs.webkit.org/show_bug.cgi?id=176562
Summary Clean up Geolocation request handling
Alex Christensen
Reported 2017-09-07 13:42:54 PDT
Clean up Geolocation request handling
Attachments
Patch (21.86 KB, patch)
2017-09-07 13:44 PDT, Alex Christensen
no flags
Patch (23.30 KB, patch)
2017-09-07 14:14 PDT, Alex Christensen
no flags
Patch (23.30 KB, patch)
2017-09-07 14:19 PDT, Alex Christensen
no flags
Patch (25.18 KB, patch)
2017-09-07 14:25 PDT, Alex Christensen
no flags
Patch (26.22 KB, patch)
2017-09-07 14:50 PDT, Alex Christensen
no flags
Alex Christensen
Comment 1 2017-09-07 13:44:52 PDT
Alex Christensen
Comment 2 2017-09-07 14:14:34 PDT
Build Bot
Comment 3 2017-09-07 14:15:49 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Alex Christensen
Comment 4 2017-09-07 14:19:19 PDT
Alex Christensen
Comment 5 2017-09-07 14:25:55 PDT
Tim Horton
Comment 6 2017-09-07 14:39:38 PDT
Comment on attachment 320181 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320181&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:5827 > + completionHandler = m_uiClient->decidePolicyForGeolocationPermissionRequest(*this, *frame, origin.get(), WTFMove(completionHandler)); > +#if PLATFORM(IOS) > + if (completionHandler) > + completionHandler = m_pageClient.decidePolicyForGeolocationPermissionRequest(*frame, origin.get(), WTFMove(completionHandler)); > +#endif > + if (completionHandler) > + completionHandler(false); This looks SO weird, but you explained it. Maybe a comment?
Alex Christensen
Comment 7 2017-09-07 14:50:15 PDT
Alex Christensen
Comment 8 2017-09-07 15:20:54 PDT
Darin Adler
Comment 9 2017-09-10 14:35:20 PDT
Comment on attachment 320186 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320186&action=review > Source/WebKit/ChangeLog:10 > + Instead of passing a GeolocationPermissionRequestProxy& to each client and returning a bool if the request will be handled, > + pass a Function<void(bool)>&& completionHandler and return the function if it won't be handled. > + This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design. Why "return the function if it won’t be handled”? Seems like we could just have it "not null out the function if it won’t be handled" or "not move the function if it won’t be handled", which is the same thing. The return value seems unneeded.
Darin Adler
Comment 10 2017-09-10 14:36:58 PDT
Comment on attachment 320186 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=320186&action=review >> Source/WebKit/ChangeLog:10 >> + This allows to temporarily support our UIClient/PageClient hybrid design while moving towards a sane design. > > Why "return the function if it won’t be handled”? > > Seems like we could just have it "not null out the function if it won’t be handled" or "not move the function if it won’t be handled", which is the same thing. The return value seems unneeded. Then I think the argument turns into a: Function<void(bool)>& Because it’s not safe to pass in a new object and then not look at it afterward. Anyway, that’s better than both taking and returning a Function I think.
Radar WebKit Bug Importer
Comment 11 2017-09-27 12:43:14 PDT
Note You need to log in before you can comment on or make changes to this bug.