From da0e7e223f2e81fda84b8614241468bf6bcc7698 Mon Sep 17 00:00:00 2001 From: "loislo@chromium.org" Date: Mon, 26 Sep 2011 12:12:34 +0000 Subject: [PATCH] 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: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95941 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 21 ++++++++++++++++ .../timeline-injected-script-eval-expected.txt | 1 + .../timeline/timeline-injected-script-eval.html | 25 +++++++++++++++++++ .../timeline-injected-script-eval-expected.txt | 29 ++++++++++++++++++++++ .../timeline-receive-response-event-expected.txt | 2 ++ Source/WebCore/ChangeLog | 24 ++++++++++++++++++ Source/WebCore/inspector/InjectedScript.cpp | 5 ++++ .../WebCore/inspector/InspectorInstrumentation.cpp | 4 +++ 8 files changed, 111 insertions(+) create mode 100644 LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt create mode 100644 LayoutTests/inspector/timeline/timeline-injected-script-eval.html create mode 100644 LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index c28e723..532c201 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,24 @@ +2011-09-23 Ilya Tikhonovsky + + 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. + + * 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: + 2011-09-26 James Robinson [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path diff --git a/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt b/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt new file mode 100644 index 0000000..88159fa --- /dev/null +++ b/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt @@ -0,0 +1 @@ +Tests the Timeline API function call record for InjectedScript.eval call feature. diff --git a/LayoutTests/inspector/timeline/timeline-injected-script-eval.html b/LayoutTests/inspector/timeline/timeline-injected-script-eval.html new file mode 100644 index 0000000..2d984bd --- /dev/null +++ b/LayoutTests/inspector/timeline/timeline-injected-script-eval.html @@ -0,0 +1,25 @@ + + + + + + + + +

+Tests the Timeline API function call record for InjectedScript.eval call feature. +

+ + + diff --git a/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt b/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt new file mode 100644 index 0000000..402e40b --- /dev/null +++ b/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt @@ -0,0 +1,29 @@ +Tests the Timeline API function call record for InjectedScript.eval call feature. + +FunctionCall Properties: +{ + startTime : + data : { + scriptName : "InjectedScript" + scriptLine : 1 + } + children : + endTime : + type : "FunctionCall" + usedHeapSize : + totalHeapSize : +} +FunctionCall Properties: +{ + startTime : + data : { + scriptName : "InjectedScript" + scriptLine : 1 + } + children : + endTime : + type : "FunctionCall" + usedHeapSize : + totalHeapSize : +} + diff --git a/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt b/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt index 969b493..75fb043 100644 --- a/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt +++ b/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt @@ -1,9 +1,11 @@ Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc. +FunctionCall ResourceSendRequest ResourceReceiveResponse ResourceReceivedData ResourceFinish +FunctionCall ResourceSendRequest ResourceReceiveResponse ResourceReceivedData diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 259ba33..647428d 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,27 @@ +2011-09-23 Ilya Tikhonovsky + + 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. + + Test: inspector/timeline/timeline-injected-script-eval.html + + * bindings/v8/ScriptFunctionCall.cpp: + * inspector/InjectedScript.cpp: + (WebCore::InjectedScript::makeCall): + * inspector/InspectorInstrumentation.cpp: + (WebCore::InspectorInstrumentation::willCallFunctionImpl): + 2011-09-26 No'am Rosenthal [Texmap][Qt] Enable TextureMapperGL in platforms where BGRA is not present diff --git a/Source/WebCore/inspector/InjectedScript.cpp b/Source/WebCore/inspector/InjectedScript.cpp index 0f87c4e..95b12bb 100644 --- a/Source/WebCore/inspector/InjectedScript.cpp +++ b/Source/WebCore/inspector/InjectedScript.cpp @@ -33,9 +33,11 @@ #if ENABLE(INSPECTOR) +#include "DOMWindow.h" #include "Frame.h" #include "InjectedScriptHost.h" #include "InjectedScriptManager.h" +#include "InspectorInstrumentation.h" #include "InspectorValues.h" #include "Node.h" #include "PlatformString.h" @@ -189,8 +191,11 @@ void InjectedScript::makeCall(ScriptFunctionCall& function, RefPtrframe() ? InspectorInstrumentation::willCallFunction(domWindow->frame()->page(), "InjectedScript", 1) : InspectorInstrumentationCookie(); bool hadException = false; ScriptValue resultValue = function.call(hadException); + InspectorInstrumentation::didCallFunction(cookie); ASSERT(!hadException); if (!hadException) { diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp index 7b97f6c..ecc57a2 100644 --- a/Source/WebCore/inspector/InspectorInstrumentation.cpp +++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp @@ -224,12 +224,16 @@ void InspectorInstrumentation::didRemoveTimerImpl(InstrumentingAgents* instrumen InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents* instrumentingAgents, const String& scriptName, int scriptLine) { +#if USE(JSC) // It is disabled for JSC see WK-BUG 40119 + return InspectorInstrumentationCookie(); +#else int timelineAgentId = 0; if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) { timelineAgent->willCallFunction(scriptName, scriptLine); timelineAgentId = timelineAgent->id(); } return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId); +#endif } void InspectorInstrumentation::didCallFunctionImpl(const InspectorInstrumentationCookie& cookie) -- 2.7.4