Title: [201079] trunk/Source/WebKit2
Revision
201079
Author
bb...@apple.com
Date
2016-05-18 07:52:20 -0700 (Wed, 18 May 2016)

Log Message

REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
https://bugs.webkit.org/show_bug.cgi?id=157821
<rdar://problem/26335429>

Reviewed by Timothy Hatcher.

In r200959, WebInspectorProxy started sending start/stop profiling
messages directly to the frontend process to avoid the inspected page
process from implicitly showing the frontend. To compensate, the WebKit
API layer was changed to call show() in togglePageProfiling().

Unfortunately, this fix was not quite right, because the ordering of
the Show and StartPageProfiling messages is undefined. The latter has to bounce
from UI to inspected to inspector processes, so the frontend may try
to start profiling before the frontend is shown, causing it to be ignored.

This patch takes a different approach: just remove all implicit show()
calls in the inspected page processes, and bounce both the Show and
StartPageProfiling messages through the inspected page process to ensure
they are handled in order by the frontend process.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::togglePageProfiling):
Revert to sending to the inspected page process.

* WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
(WKBundleInspectorSetPageProfilingEnabled):
Add a call to show() now that the implementation doesn't do it implicitly.

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::startPageProfiling):
(WebKit::WebInspector::stopPageProfiling):
Don't implicitly show the inspector. These methods are only called
through the WKBundleInspector API and via IPC from WebInspectorProxy.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (201078 => 201079)


--- trunk/Source/WebKit2/ChangeLog	2016-05-18 14:48:28 UTC (rev 201078)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-18 14:52:20 UTC (rev 201079)
@@ -1,3 +1,40 @@
+2016-05-18  Brian Burg  <bb...@apple.com>
+
+        REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
+        https://bugs.webkit.org/show_bug.cgi?id=157821
+        <rdar://problem/26335429>
+
+        Reviewed by Timothy Hatcher.
+
+        In r200959, WebInspectorProxy started sending start/stop profiling
+        messages directly to the frontend process to avoid the inspected page
+        process from implicitly showing the frontend. To compensate, the WebKit
+        API layer was changed to call show() in togglePageProfiling().
+
+        Unfortunately, this fix was not quite right, because the ordering of
+        the Show and StartPageProfiling messages is undefined. The latter has to bounce
+        from UI to inspected to inspector processes, so the frontend may try
+        to start profiling before the frontend is shown, causing it to be ignored.
+
+        This patch takes a different approach: just remove all implicit show()
+        calls in the inspected page processes, and bounce both the Show and
+        StartPageProfiling messages through the inspected page process to ensure
+        they are handled in order by the frontend process.
+
+        * UIProcess/WebInspectorProxy.cpp:
+        (WebKit::WebInspectorProxy::togglePageProfiling):
+        Revert to sending to the inspected page process.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
+        (WKBundleInspectorSetPageProfilingEnabled):
+        Add a call to show() now that the implementation doesn't do it implicitly.
+
+        * WebProcess/WebPage/WebInspector.cpp:
+        (WebKit::WebInspector::startPageProfiling):
+        (WebKit::WebInspector::stopPageProfiling):
+        Don't implicitly show the inspector. These methods are only called
+        through the WKBundleInspector API and via IPC from WebInspectorProxy.
+
 2016-05-17  Beth Dakin  <bda...@apple.com>
 
         Make handleAcceptedCandidate a public function

Modified: trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (201078 => 201079)


--- trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-05-18 14:48:28 UTC (rev 201078)
+++ trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-05-18 14:52:20 UTC (rev 201079)
@@ -296,9 +296,9 @@
         return;
 
     if (m_isProfilingPage)
-        m_inspectorPage->process().send(Messages::WebInspectorUI::StopPageProfiling(), m_inspectorPage->pageID());
+        m_inspectedPage->process().send(Messages::WebInspector::StopPageProfiling(), m_inspectedPage->pageID());
     else
-        m_inspectorPage->process().send(Messages::WebInspectorUI::StartPageProfiling(), m_inspectorPage->pageID());
+        m_inspectedPage->process().send(Messages::WebInspector::StartPageProfiling(), m_inspectedPage->pageID());
 
     // FIXME: have the WebProcess notify us on state changes.
     m_isProfilingPage = !m_isProfilingPage;

Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp (201078 => 201079)


--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp	2016-05-18 14:48:28 UTC (rev 201078)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp	2016-05-18 14:52:20 UTC (rev 201079)
@@ -55,6 +55,8 @@
 
 void WKBundleInspectorSetPageProfilingEnabled(WKBundleInspectorRef inspectorRef, bool enabled)
 {
+    toImpl(inspectorRef)->show();
+
     if (enabled)
         toImpl(inspectorRef)->startPageProfiling();
     else

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp (201078 => 201079)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2016-05-18 14:48:28 UTC (rev 201078)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebInspector.cpp	2016-05-18 14:52:20 UTC (rev 201079)
@@ -196,7 +196,6 @@
     if (!m_page->corePage())
         return;
 
-    m_page->corePage()->inspectorController().show();
     m_frontendConnection->send(Messages::WebInspectorUI::StartPageProfiling(), 0);
 }
 
@@ -205,7 +204,6 @@
     if (!m_page->corePage())
         return;
 
-    m_page->corePage()->inspectorController().show();
     m_frontendConnection->send(Messages::WebInspectorUI::StopPageProfiling(), 0);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to