Changeset 200959 in webkit


Ignore:
Timestamp:
May 16, 2016 12:53:00 PM (8 years ago)
Author:
BJ Burg
Message:

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:
Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r200957 r200959  
     12016-05-16  Brian Burg  <bburg@apple.com>
     2
     3        Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
     4        https://bugs.webkit.org/show_bug.cgi?id=157739
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UIProcess/API/C/WKInspector.cpp:
     9        (WKInspectorTogglePageProfiling):
     10        Implicitly show the Web Inspector in the C API command to preserve existing behavior.
     11
     12        * UIProcess/Automation/WebAutomationSession.cpp:
     13        (WebKit::WebAutomationSession::inspectorFrontendLoaded):
     14        If the frontend loaded, it was either because the user opened Web Inspector (and
     15        turning on page profiling is harmless), or it was loaded but not shown by the
     16        inspectBrowsingContext command. For the latter, we want to start page profiling
     17        before processing any additional commands so subsequent execution is captured.
     18
     19        * UIProcess/WebInspectorProxy.cpp:
     20        (WebKit::WebInspectorProxy::togglePageProfiling):
     21        Send the start/stop profiling messages directly to the WebInspectorUI process instead of
     22        bouncing through the inspected page's process, which does an implicit show() we don't want.
     23
     24        * UIProcess/WebPageProxy.cpp:
     25        (WebKit::WebPageProxy::inspector): Make it const.
     26        * UIProcess/WebPageProxy.h:
     27
    1282016-05-16  Conrad Shultz  <conrad_shultz@apple.com>
    229
  • trunk/Source/WebKit2/UIProcess/API/C/WKInspector.cpp

    r199380 r200959  
    118118void WKInspectorTogglePageProfiling(WKInspectorRef inspectorRef)
    119119{
     120    toImpl(inspectorRef)->show();
    120121    toImpl(inspectorRef)->togglePageProfiling();
    121122}
  • trunk/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp

    r200702 r200959  
    460460    if (auto callback = m_pendingInspectorCallbacksPerPage.take(page.pageID()))
    461461        callback->sendSuccess(InspectorObject::create());
     462
     463    // Start collecting profile information immediately so the entire session is captured.
     464    page.inspector()->togglePageProfiling();
    462465}
    463466
  • trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp

    r200702 r200959  
    297297
    298298    if (m_isProfilingPage)
    299         m_inspectedPage->process().send(Messages::WebInspector::StopPageProfiling(), m_inspectedPage->pageID());
     299        m_inspectorPage->process().send(Messages::WebInspectorUI::StopPageProfiling(), m_inspectorPage->pageID());
    300300    else
    301         m_inspectedPage->process().send(Messages::WebInspector::StartPageProfiling(), m_inspectedPage->pageID());
     301        m_inspectorPage->process().send(Messages::WebInspectorUI::StartPageProfiling(), m_inspectorPage->pageID());
    302302
    303303    // FIXME: have the WebProcess notify us on state changes.
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r200611 r200959  
    40354035
    40364036// Inspector
    4037 WebInspectorProxy* WebPageProxy::inspector()
     4037WebInspectorProxy* WebPageProxy::inspector() const
    40384038{
    40394039    if (isClosed() || !isValid())
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r200660 r200959  
    311311    void didExitFullscreen();
    312312
    313     WebInspectorProxy* inspector();
     313    WebInspectorProxy* inspector() const;
    314314
    315315    bool isControlledByAutomation() const { return m_controlledByAutomation; }
Note: See TracChangeset for help on using the changeset viewer.