Web Inspector: add frame ids to TimeStamp, Time and TimeEnd records in Timeline
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 13:42:47 +0000 (13:42 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 13:42:47 +0000 (13:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93699

Reviewed by Pavel Feldman.

Source/WebCore:

- plumb Frame from Console to TimelineAgent and use it to add frameId to 3 timeline records;

* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::startConsoleTiming):
(WebCore::InspectorInstrumentation::stopConsoleTiming):
(WebCore::InspectorInstrumentation::consoleTimeStamp):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::startConsoleTimingImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
(WebCore::InspectorInstrumentation::consoleTimeStampImpl):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didTimeStamp):
(WebCore::InspectorTimelineAgent::time):
(WebCore::InspectorTimelineAgent::timeEnd):
* inspector/InspectorTimelineAgent.h:
(InspectorTimelineAgent):
* page/Console.cpp:
(WebCore::Console::markTimeline):
(WebCore::Console::time):
(WebCore::Console::timeEnd):
(WebCore::Console::timeStamp):

LayoutTests:

- rebased expectations to include frameId field;
- removed platform overrides for chromium as these are identical to the default ones;

* inspector/timeline/timeline-mark-timeline-expected.txt:
* inspector/timeline/timeline-time-stamp-expected.txt:
* platform/chromium/inspector/timeline/timeline-mark-timeline-expected.txt: Removed.
* platform/chromium/inspector/timeline/timeline-time-stamp-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/timeline/timeline-mark-timeline-expected.txt
LayoutTests/inspector/timeline/timeline-time-stamp-expected.txt
LayoutTests/platform/chromium/inspector/timeline/timeline-mark-timeline-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorConsoleInstrumentation.h
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/page/Console.cpp

index d8d643b..5242892 100644 (file)
@@ -1,3 +1,18 @@
+2012-08-10  Andrey Kosyakov  <caseq@chromium.org>
+
+        Web Inspector: add frame ids to TimeStamp, Time and TimeEnd records in Timeline
+        https://bugs.webkit.org/show_bug.cgi?id=93699
+
+        Reviewed by Pavel Feldman.
+
+        - rebased expectations to include frameId field;
+        - removed platform overrides for chromium as these are identical to the default ones;
+
+        * inspector/timeline/timeline-mark-timeline-expected.txt:
+        * inspector/timeline/timeline-time-stamp-expected.txt:
+        * platform/chromium/inspector/timeline/timeline-mark-timeline-expected.txt: Removed.
+        * platform/chromium/inspector/timeline/timeline-time-stamp-expected.txt: Removed.
+
 2012-08-10  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
 
         [Qt] Unreviwed gardening.
index 2f1cc10..baeb8e3 100644 (file)
@@ -8,6 +8,7 @@ TimeStamp Properties:
         message : "MARK TIMELINE"
     }
     type : "TimeStamp"
+    frameId : <string>
     usedHeapSize : <number>
     totalHeapSize : <number>
     counters : <object>
index b52de53..2f79354 100644 (file)
@@ -8,6 +8,7 @@ TimeStamp Properties:
         message : "TIME STAMP"
     }
     type : "TimeStamp"
+    frameId : <string>
     usedHeapSize : <number>
     totalHeapSize : <number>
     counters : <object>
@@ -21,6 +22,7 @@ TimeStamp Properties:
         message : "TIME STAMP"
     }
     type : "TimeStamp"
+    frameId : <string>
     usedHeapSize : <number>
     totalHeapSize : <number>
     counters : <object>
diff --git a/LayoutTests/platform/chromium/inspector/timeline/timeline-mark-timeline-expected.txt b/LayoutTests/platform/chromium/inspector/timeline/timeline-mark-timeline-expected.txt
deleted file mode 100644 (file)
index 2f1cc10..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-Tests the Timeline API mark feature
-
-TimeStamp Properties:
-{
-    startTime : <number>
-    stackTrace : <object>
-    data : {
-        message : "MARK TIMELINE"
-    }
-    type : "TimeStamp"
-    usedHeapSize : <number>
-    totalHeapSize : <number>
-    counters : <object>
-}
-
index 5adc2b9..43f62ae 100644 (file)
@@ -1,3 +1,35 @@
+2012-08-10  Andrey Kosyakov  <caseq@chromium.org>
+
+        Web Inspector: add frame ids to TimeStamp, Time and TimeEnd records in Timeline
+        https://bugs.webkit.org/show_bug.cgi?id=93699
+
+        Reviewed by Pavel Feldman.
+
+        - plumb Frame from Console to TimelineAgent and use it to add frameId to 3 timeline records;
+
+        * inspector/InspectorConsoleInstrumentation.h:
+        (WebCore::InspectorInstrumentation::startConsoleTiming):
+        (WebCore::InspectorInstrumentation::stopConsoleTiming):
+        (WebCore::InspectorInstrumentation::consoleTimeStamp):
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore):
+        (WebCore::InspectorInstrumentation::startConsoleTimingImpl):
+        (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
+        (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
+        * inspector/InspectorInstrumentation.h:
+        (InspectorInstrumentation):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didTimeStamp):
+        (WebCore::InspectorTimelineAgent::time):
+        (WebCore::InspectorTimelineAgent::timeEnd):
+        * inspector/InspectorTimelineAgent.h:
+        (InspectorTimelineAgent):
+        * page/Console.cpp:
+        (WebCore::Console::markTimeline):
+        (WebCore::Console::time):
+        (WebCore::Console::timeEnd):
+        (WebCore::Console::timeStamp):
+
 2012-08-10  Simon Hausmann  <simon.hausmann@nokia.com>
 
         [Qt] Fix failing assertions when using JSC C API in QObject bridge
index 9f92315..f04326b 100644 (file)
@@ -81,28 +81,28 @@ inline void InspectorInstrumentation::consoleCount(Page* page, PassRefPtr<Script
 #endif
 }
 
-inline void InspectorInstrumentation::startConsoleTiming(Page* page, const String& title)
+inline void InspectorInstrumentation::startConsoleTiming(Frame* frame, const String& title)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        startConsoleTimingImpl(instrumentingAgents, title);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        startConsoleTimingImpl(instrumentingAgents, frame, title);
 #endif
 }
 
-inline void InspectorInstrumentation::stopConsoleTiming(Page* page, const String& title, PassRefPtr<ScriptCallStack> stack)
+inline void InspectorInstrumentation::stopConsoleTiming(Frame* frame, const String& title, PassRefPtr<ScriptCallStack> stack)
 {
 #if ENABLE(INSPECTOR)
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        stopConsoleTimingImpl(instrumentingAgents, title, stack);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        stopConsoleTimingImpl(instrumentingAgents, frame, title, stack);
 #endif
 }
 
-inline void InspectorInstrumentation::consoleTimeStamp(Page* page, PassRefPtr<ScriptArguments> arguments)
+inline void InspectorInstrumentation::consoleTimeStamp(Frame* frame, PassRefPtr<ScriptArguments> arguments)
 {
 #if ENABLE(INSPECTOR)
     FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
-        consoleTimeStampImpl(instrumentingAgents, arguments);
+    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
+        consoleTimeStampImpl(instrumentingAgents, frame, arguments);
 #endif
 }
 
index e703de3..faea068 100644 (file)
@@ -907,28 +907,28 @@ void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents* instrumenti
         consoleAgent->count(arguments, stack);
 }
 
-void InspectorInstrumentation::startConsoleTimingImpl(InstrumentingAgents* instrumentingAgents, const String& title)
+void InspectorInstrumentation::startConsoleTimingImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, const String& title)
 {
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
-        timelineAgent->time(title);
+        timelineAgent->time(frame, title);
     if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
         consoleAgent->startTiming(title);
 }
 
-void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents* instrumentingAgents, const String& title, PassRefPtr<ScriptCallStack> stack)
+void InspectorInstrumentation::stopConsoleTimingImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, const String& title, PassRefPtr<ScriptCallStack> stack)
 {
     if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorConsoleAgent())
         consoleAgent->stopTiming(title, stack);
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent())
-        timelineAgent->timeEnd(title);
+        timelineAgent->timeEnd(frame, title);
 }
 
-void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents* instrumentingAgents, PassRefPtr<ScriptArguments> arguments)
+void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, PassRefPtr<ScriptArguments> arguments)
 {
     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTimelineAgent()) {
         String message;
         arguments->getFirstArgumentAsString(message);
-        timelineAgent->didTimeStamp(message);
+        timelineAgent->didTimeStamp(frame, message);
      }
 }
 
index 1c1d468..116d76c 100644 (file)
@@ -202,9 +202,9 @@ public:
     static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber);
 #endif
     static void consoleCount(Page*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void startConsoleTiming(Page*, const String& title);
-    static void stopConsoleTiming(Page*, const String& title, PassRefPtr<ScriptCallStack>);
-    static void consoleTimeStamp(Page*, PassRefPtr<ScriptArguments>);
+    static void startConsoleTiming(Frame*, const String& title);
+    static void stopConsoleTiming(Frame*, const String& title, PassRefPtr<ScriptCallStack>);
+    static void consoleTimeStamp(Frame*, PassRefPtr<ScriptArguments>);
 
     static void didRequestAnimationFrame(Document*, int callbackId);
     static void didCancelAnimationFrame(Document*, int callbackId);
@@ -378,9 +378,9 @@ private:
     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptId, unsigned lineNumber);
     static void consoleCountImpl(InstrumentingAgents*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
-    static void startConsoleTimingImpl(InstrumentingAgents*, const String& title);
-    static void stopConsoleTimingImpl(InstrumentingAgents*, const String& title, PassRefPtr<ScriptCallStack>);
-    static void consoleTimeStampImpl(InstrumentingAgents*, PassRefPtr<ScriptArguments>);
+    static void startConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title);
+    static void stopConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title, PassRefPtr<ScriptCallStack>);
+    static void consoleTimeStampImpl(InstrumentingAgents*, Frame*, PassRefPtr<ScriptArguments>);
 
     static void didRequestAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
     static void didCancelAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
index 5c6bece..8cc3439 100644 (file)
@@ -378,19 +378,19 @@ void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier,
     appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime * 1000), TimelineRecordType::ResourceFinish, false, frame);
 }
 
-void InspectorTimelineAgent::didTimeStamp(const String& message)
+void InspectorTimelineAgent::didTimeStamp(Frame* frame, const String& message)
 {
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true, 0);
+    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true, frame);
 }
 
-void InspectorTimelineAgent::time(const String& message)
+void InspectorTimelineAgent::time(Frame* frame, const String& message)
 {
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::Time, true, 0);
+    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::Time, true, frame);
 }
 
-void InspectorTimelineAgent::timeEnd(const String& message)
+void InspectorTimelineAgent::timeEnd(Frame* frame, const String& message)
 {
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeEnd, true, 0);
+    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeEnd, true, frame);
 }
 
 void InspectorTimelineAgent::didMarkDOMContentEvent(Frame* frame)
index 2961b77..0b4b90e 100644 (file)
@@ -121,12 +121,12 @@ public:
     void willEvaluateScript(const String&, int, Frame*);
     void didEvaluateScript();
 
-    void didTimeStamp(const String&);
+    void didTimeStamp(Frame*, const String&);
     void didMarkDOMContentEvent(Frame*);
     void didMarkLoadEvent(Frame*);
 
-    void time(const String&);
-    void timeEnd(const String&);
+    void time(Frame*, const String&);
+    void timeEnd(Frame*, const String&);
 
     void didScheduleResourceRequest(const String& url, Frame*);
     void willSendResourceRequest(unsigned long, const ResourceRequest&, Frame*);
index 1e67f30..d0e5e4f 100644 (file)
@@ -262,7 +262,7 @@ void Console::count(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCall
 
 void Console::markTimeline(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack>)
 {
-    InspectorInstrumentation::consoleTimeStamp(page(), arguments);
+    InspectorInstrumentation::consoleTimeStamp(m_frame, arguments);
 }
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -308,7 +308,7 @@ void Console::profileEnd(const String& title, ScriptState* state, PassRefPtr<Scr
 
 void Console::time(const String& title)
 {
-    InspectorInstrumentation::startConsoleTiming(page(), title);
+    InspectorInstrumentation::startConsoleTiming(m_frame, title);
 #if PLATFORM(CHROMIUM)
     TRACE_EVENT_COPY_ASYNC_BEGIN0("webkit", title.utf8().data(), this);
 #endif
@@ -319,12 +319,12 @@ void Console::timeEnd(PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack> c
 #if PLATFORM(CHROMIUM)
     TRACE_EVENT_COPY_ASYNC_END0("webkit", title.utf8().data(), this);
 #endif
-    InspectorInstrumentation::stopConsoleTiming(page(), title, callStack);
+    InspectorInstrumentation::stopConsoleTiming(m_frame, title, callStack);
 }
 
 void Console::timeStamp(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack>)
 {
-    InspectorInstrumentation::consoleTimeStamp(page(), arguments);
+    InspectorInstrumentation::consoleTimeStamp(m_frame, arguments);
 }
 
 void Console::group(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallStack> callStack)