RESOLVED FIXED 196750
Add runJavaScriptInFrame for WebPageProxy/WebPage
https://bugs.webkit.org/show_bug.cgi?id=196750
Summary Add runJavaScriptInFrame for WebPageProxy/WebPage
Jiewen Tan
Reported 2019-04-09 16:33:58 PDT
Add runJavaScriptInFrame for WebPageProxy/WebPage.
Attachments
Patch (13.11 KB, patch)
2019-04-09 16:52 PDT, Jiewen Tan
no flags
Radar WebKit Bug Importer
Comment 1 2019-04-09 16:34:23 PDT
Jiewen Tan
Comment 2 2019-04-09 16:52:29 PDT
youenn fablet
Comment 3 2019-04-10 09:48:57 PDT
Comment on attachment 367082 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367082&action=review > Source/WebKit/UIProcess/WebPageProxy.cpp:3570 > m_process->send(Messages::WebPage::RunJavaScriptInMainFrameScriptWorld(script, forceUserGesture, worldName, callbackID), m_pageID); It seems there is not much difference of processing in WebProcess between the different runJavaScript messages. We could call runJavaScriptInFrame here and have just one IPC message for all cases.
Jiewen Tan
Comment 4 2019-04-10 12:37:54 PDT
Comment on attachment 367082 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367082&action=review >> Source/WebKit/UIProcess/WebPageProxy.cpp:3570 >> m_process->send(Messages::WebPage::RunJavaScriptInMainFrameScriptWorld(script, forceUserGesture, worldName, callbackID), m_pageID); > > It seems there is not much difference of processing in WebProcess between the different runJavaScript messages. > We could call runJavaScriptInFrame here and have just one IPC message for all cases. Sounds like a good idea. In fact, I hesitated a bit on that approach in development. The reason for that is whether or not to give main frames a more streamline implementation than subframes. For main frames, we don't need to ask the hash table to get back a WebFrame/WebFrameProxy. WebPage/WebPageProxy stores them directly.
Jiewen Tan
Comment 5 2019-04-10 12:38:09 PDT
Thanks Youenn for r+ the patch.
Jiewen Tan
Comment 6 2019-04-10 13:42:55 PDT
Comment on attachment 367082 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367082&action=review >>> Source/WebKit/UIProcess/WebPageProxy.cpp:3570 >>> m_process->send(Messages::WebPage::RunJavaScriptInMainFrameScriptWorld(script, forceUserGesture, worldName, callbackID), m_pageID); >> >> It seems there is not much difference of processing in WebProcess between the different runJavaScript messages. >> We could call runJavaScriptInFrame here and have just one IPC message for all cases. > > Sounds like a good idea. In fact, I hesitated a bit on that approach in development. The reason for that is whether or not to give main frames a more streamline implementation than subframes. For main frames, we don't need to ask the hash table to get back a WebFrame/WebFrameProxy. WebPage/WebPageProxy stores them directly. It turns out that m_mainFrame could be null in the WebPageProxy when runJavaScriptInMainFrame get called, and therefore there is no way to get the frameID in WebPageProxy and pass it to WebPage. I will land the patch as it is then.
WebKit Commit Bot
Comment 7 2019-04-10 13:49:29 PDT
Comment on attachment 367082 [details] Patch Clearing flags on attachment: 367082 Committed r244148: <https://trac.webkit.org/changeset/244148>
WebKit Commit Bot
Comment 8 2019-04-10 13:49:31 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.