Title: [95941] trunk
Revision
95941
Author
loi...@chromium.org
Date
2011-09-26 05:12:34 -0700 (Mon, 26 Sep 2011)

Log 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:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95940 => 95941)


--- trunk/LayoutTests/ChangeLog	2011-09-26 12:06:02 UTC (rev 95940)
+++ trunk/LayoutTests/ChangeLog	2011-09-26 12:12:34 UTC (rev 95941)
@@ -1,3 +1,24 @@
+2011-09-23  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        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  <jam...@chromium.org>
 
         [mac] Timestamp parameter to requestAnimationFrame is busted in USE(REQUEST_ANIMATION_FRAME_TIMER) path

Added: trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt (0 => 95941)


--- trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt	2011-09-26 12:12:34 UTC (rev 95941)
@@ -0,0 +1 @@
+Tests the Timeline API function call record for InjectedScript.eval call feature.
Property changes on: trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval.html (0 => 95941)


--- trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval.html	2011-09-26 12:12:34 UTC (rev 95941)
@@ -0,0 +1,25 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function performActions()
+{
+}
+
+function test()
+{
+    InspectorTest.performActionsAndPrint("performActions()", "FunctionCall");
+}
+
+</script>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests the Timeline API function call record for InjectedScript.eval call feature.
+</p>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/inspector/timeline/timeline-injected-script-eval.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt (0 => 95941)


--- trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt	2011-09-26 12:12:34 UTC (rev 95941)
@@ -0,0 +1,29 @@
+Tests the Timeline API function call record for InjectedScript.eval call feature.
+
+FunctionCall Properties:
+{
+    startTime : <number>
+    data : {
+        scriptName : "InjectedScript"
+        scriptLine : 1
+    }
+    children : <object>
+    endTime : <number>
+    type : "FunctionCall"
+    usedHeapSize : <number>
+    totalHeapSize : <number>
+}
+FunctionCall Properties:
+{
+    startTime : <number>
+    data : {
+        scriptName : "InjectedScript"
+        scriptLine : 1
+    }
+    children : <object>
+    endTime : <number>
+    type : "FunctionCall"
+    usedHeapSize : <number>
+    totalHeapSize : <number>
+}
+
Property changes on: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-injected-script-eval-expected.txt
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt (95940 => 95941)


--- trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt	2011-09-26 12:06:02 UTC (rev 95940)
+++ trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-receive-response-event-expected.txt	2011-09-26 12:12:34 UTC (rev 95941)
@@ -1,9 +1,11 @@
 Tests the Timeline API instrumentation of a SendRequest, ReceiveResponse etc.
 
+FunctionCall
 ResourceSendRequest
     ResourceReceiveResponse
     ResourceReceivedData
     ResourceFinish
+FunctionCall
 ResourceSendRequest
     ResourceReceiveResponse
     ResourceReceivedData

Modified: trunk/Source/WebCore/ChangeLog (95940 => 95941)


--- trunk/Source/WebCore/ChangeLog	2011-09-26 12:06:02 UTC (rev 95940)
+++ trunk/Source/WebCore/ChangeLog	2011-09-26 12:12:34 UTC (rev 95941)
@@ -1,3 +1,27 @@
+2011-09-23  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        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  <noam.rosent...@nokia.com>
 
         [Texmap][Qt] Enable TextureMapperGL in platforms where BGRA is not present

Modified: trunk/Source/WebCore/inspector/InjectedScript.cpp (95940 => 95941)


--- trunk/Source/WebCore/inspector/InjectedScript.cpp	2011-09-26 12:06:02 UTC (rev 95940)
+++ trunk/Source/WebCore/inspector/InjectedScript.cpp	2011-09-26 12:12:34 UTC (rev 95941)
@@ -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 @@
         return;
     }
 
+    DOMWindow* domWindow = domWindowFromScriptState(m_injectedScriptObject.scriptState());
+    InspectorInstrumentationCookie cookie = domWindow && domWindow->frame() ? InspectorInstrumentation::willCallFunction(domWindow->frame()->page(), "InjectedScript", 1) : InspectorInstrumentationCookie();
     bool hadException = false;
     ScriptValue resultValue = function.call(hadException);
+    InspectorInstrumentation::didCallFunction(cookie);
 
     ASSERT(!hadException);
     if (!hadException) {

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (95940 => 95941)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2011-09-26 12:06:02 UTC (rev 95940)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2011-09-26 12:12:34 UTC (rev 95941)
@@ -224,12 +224,16 @@
 
 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)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to