Changeset 95941 in webkit


Ignore:
Timestamp:
Sep 26, 2011 5:12:34 AM (13 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: Timeline: record root event for the function calls enforced by console eval.
https://bugs.webkit.org/show_bug.cgi?id=68695

In a complex web application developer might want to timeline a specific piece of code.

In this case he can do the next steps:
1) start timeline;
2) eval a command in console;
3) stop timeline.

I think it'd be nice to have a root event for the all the events that happened as the result of such eval.

Reviewed by Yury Semikhatsky.

Source/WebCore:

Test: inspector/timeline/timeline-injected-script-eval.html

  • bindings/v8/ScriptFunctionCall.cpp:
  • inspector/InjectedScript.cpp:

(WebCore::InjectedScript::makeCall):

  • inspector/InspectorInstrumentation.cpp:

(WebCore::InspectorInstrumentation::willCallFunctionImpl):

LayoutTests:

  • inspector/timeline/timeline-injected-script-eval-expected.txt: Added.
  • inspector/timeline/timeline-injected-script-eval.html: Added.
  • platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt: Added.
  • platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt:
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95937 r95941  
     12011-09-23  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: Timeline: record root event for the function calls enforced by console eval.
     4        https://bugs.webkit.org/show_bug.cgi?id=68695
     5
     6        In a complex web application developer might want to timeline a specific piece of code.
     7
     8        In this case he can do the next steps:
     9        1) start timeline;
     10        2) eval a command in console;
     11        3) stop timeline.
     12
     13        I think it'd be nice to have a root event for the all the events that happened as the result of such eval.
     14
     15        Reviewed by Yury Semikhatsky.
     16
     17        * inspector/timeline/timeline-injected-script-eval-expected.txt: Added.
     18        * inspector/timeline/timeline-injected-script-eval.html: Added.
     19        * platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt: Added.
     20        * platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt:
     21
    1222011-09-26  James Robinson  <jamesr@chromium.org>
    223
  • trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt

    r91567 r95941  
    11Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc.
    22
     3FunctionCall
    34ResourceSendRequest
    45    ResourceReceiveResponse
    56    ResourceReceivedData
    67    ResourceFinish
     8FunctionCall
    79ResourceSendRequest
    810    ResourceReceiveResponse
  • trunk/Source/WebCore/ChangeLog

    r95939 r95941  
     12011-09-23  Ilya Tikhonovsky  <loislo@chromium.org>
     2
     3        Web Inspector: Timeline: record root event for the function calls enforced by console eval.
     4        https://bugs.webkit.org/show_bug.cgi?id=68695
     5
     6        In a complex web application developer might want to timeline a specific piece of code.
     7
     8        In this case he can do the next steps:
     9        1) start timeline;
     10        2) eval a command in console;
     11        3) stop timeline.
     12
     13        I think it'd be nice to have a root event for the all the events that happened as the result of such eval.
     14
     15        Reviewed by Yury Semikhatsky.
     16
     17        Test: inspector/timeline/timeline-injected-script-eval.html
     18
     19        * bindings/v8/ScriptFunctionCall.cpp:
     20        * inspector/InjectedScript.cpp:
     21        (WebCore::InjectedScript::makeCall):
     22        * inspector/InspectorInstrumentation.cpp:
     23        (WebCore::InspectorInstrumentation::willCallFunctionImpl):
     24
    1252011-09-26  No'am Rosenthal  <noam.rosenthal@nokia.com>
    226
  • trunk/Source/WebCore/inspector/InjectedScript.cpp

    r95901 r95941  
    3434#if ENABLE(INSPECTOR)
    3535
     36#include "DOMWindow.h"
    3637#include "Frame.h"
    3738#include "InjectedScriptHost.h"
    3839#include "InjectedScriptManager.h"
     40#include "InspectorInstrumentation.h"
    3941#include "InspectorValues.h"
    4042#include "Node.h"
     
    190192    }
    191193
     194    DOMWindow* domWindow = domWindowFromScriptState(m_injectedScriptObject.scriptState());
     195    InspectorInstrumentationCookie cookie = domWindow && domWindow->frame() ? InspectorInstrumentation::willCallFunction(domWindow->frame()->page(), "InjectedScript", 1) : InspectorInstrumentationCookie();
    192196    bool hadException = false;
    193197    ScriptValue resultValue = function.call(hadException);
     198    InspectorInstrumentation::didCallFunction(cookie);
    194199
    195200    ASSERT(!hadException);
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r95919 r95941  
    225225InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents* instrumentingAgents, const String& scriptName, int scriptLine)
    226226{
     227#if USE(JSC) // It is disabled for JSC see WK-BUG 40119
     228    return InspectorInstrumentationCookie();
     229#else
    227230    int timelineAgentId = 0;
    228231    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) {
     
    231234    }
    232235    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
     236#endif
    233237}
    234238
Note: See TracChangeset for help on using the changeset viewer.