Title: [201142] branches/safari-602.1.32-branch/Source/WebKit2

Diff

Modified: branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/ChangeLog	2016-05-19 08:40:29 UTC (rev 201142)
@@ -1,5 +1,36 @@
 2016-05-19  Babak Shafiei  <[email protected]>
 
+        Merge r200959. rdar://problem/26298247
+
+    2016-05-16  Brian Burg  <[email protected]>
+
+            Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
+            https://bugs.webkit.org/show_bug.cgi?id=157739
+
+            Reviewed by Timothy Hatcher.
+
+            * UIProcess/API/C/WKInspector.cpp:
+            (WKInspectorTogglePageProfiling):
+            Implicitly show the Web Inspector in the C API command to preserve existing behavior.
+
+            * UIProcess/Automation/WebAutomationSession.cpp:
+            (WebKit::WebAutomationSession::inspectorFrontendLoaded):
+            If the frontend loaded, it was either because the user opened Web Inspector (and
+            turning on page profiling is harmless), or it was loaded but not shown by the
+            inspectBrowsingContext command. For the latter, we want to start page profiling
+            before processing any additional commands so subsequent execution is captured.
+
+            * UIProcess/WebInspectorProxy.cpp:
+            (WebKit::WebInspectorProxy::togglePageProfiling):
+            Send the start/stop profiling messages directly to the WebInspectorUI process instead of
+            bouncing through the inspected page's process, which does an implicit show() we don't want.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::inspector): Make it const.
+            * UIProcess/WebPageProxy.h:
+
+2016-05-19  Babak Shafiei  <[email protected]>
+
         Merge r200950. rdar://problem/26287306
 
     2016-05-16  Brian Burg  <[email protected]>

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/API/C/WKInspector.cpp (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/API/C/WKInspector.cpp	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/API/C/WKInspector.cpp	2016-05-19 08:40:29 UTC (rev 201142)
@@ -117,6 +117,7 @@
 
 void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
 {
+    toImpl(inspectorRef)->show();
     toImpl(inspectorRef)->togglePageProfiling();
 }
 

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp	2016-05-19 08:40:29 UTC (rev 201142)
@@ -459,6 +459,9 @@
 {
     if (auto callback = m_pendingInspectorCallbacksPerPage.take(page.pageID()))
         callback->sendSuccess(InspectorObject::create());
+
+    // Start collecting profile information immediately so the entire session is captured.
+    page.inspector()->togglePageProfiling();
 }
 
 void WebAutomationSession::evaluateJavaScriptFunction(Inspector::ErrorString& errorString, const String& browsingContextHandle, const String* optionalFrameHandle, const String& function, const Inspector::InspectorArray& arguments, const bool* optionalExpectsImplicitCallbackArgument, const int* optionalCallbackTimeout, Ref<EvaluateJavaScriptFunctionCallback>&& callback)

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebInspectorProxy.cpp	2016-05-19 08:40:29 UTC (rev 201142)
@@ -296,9 +296,9 @@
         return;
 
     if (m_isProfilingPage)
-        m_inspectedPage->process().send(Messages::WebInspector::StopPageProfiling(), m_inspectedPage->pageID());
+        m_inspectorPage->process().send(Messages::WebInspectorUI::StopPageProfiling(), m_inspectorPage->pageID());
     else
-        m_inspectedPage->process().send(Messages::WebInspector::StartPageProfiling(), m_inspectedPage->pageID());
+        m_inspectorPage->process().send(Messages::WebInspectorUI::StartPageProfiling(), m_inspectorPage->pageID());
 
     // FIXME: have the WebProcess notify us on state changes.
     m_isProfilingPage = !m_isProfilingPage;

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-05-19 08:40:29 UTC (rev 201142)
@@ -4030,7 +4030,7 @@
 #endif
 
 // Inspector
-WebInspectorProxy* WebPageProxy::inspector()
+WebInspectorProxy* WebPageProxy::inspector() const
 {
     if (isClosed() || !isValid())
         return 0;

Modified: branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.h (201141 => 201142)


--- branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2016-05-19 08:40:25 UTC (rev 201141)
+++ branches/safari-602.1.32-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2016-05-19 08:40:29 UTC (rev 201142)
@@ -310,7 +310,7 @@
     void didEnterFullscreen();
     void didExitFullscreen();
 
-    WebInspectorProxy* inspector();
+    WebInspectorProxy* inspector() const;
 
     bool isControlledByAutomation() const { return m_controlledByAutomation; }
     void setControlledByAutomation(bool);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to