Title: [144439] trunk
Revision
144439
Author
[email protected]
Date
2013-03-01 04:04:24 -0800 (Fri, 01 Mar 2013)

Log Message

Web Inspector: Save/load timeline should preserve DOMContentLoaded and Load event markers
https://bugs.webkit.org/show_bug.cgi?id=110819

Reviewed by Pavel Feldman.

To create event divider TimelinePresentation model checks if record
frame is main frame. With this patch check is moved to backend and
result is saved in record to avoid incoherence.

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
Record "isMainFrame" flag.
(WebCore::InspectorTimelineAgent::didMarkLoadEvent): Ditto.
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createMarkData):
Added data object constructor.
* inspector/TimelineRecordFactory.h: Ditto.
* inspector/front-end/TimelinePresentationModel.js:
(WebInspector.TimelinePresentationModel.isEventDivider):
Use saved flag value instead of comparing with "current" main frame.

Modified Paths

Diff

Modified: trunk/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt (144438 => 144439)


--- trunk/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/LayoutTests/inspector/timeline/timeline-dom-content-loaded-event-expected.txt	2013-03-01 12:04:24 UTC (rev 144439)
@@ -5,6 +5,7 @@
 {
     counters : <object>
     data : {
+        isMainFrame : true
     }
     frameId : <string>
     startTime : <number>

Modified: trunk/LayoutTests/inspector/timeline/timeline-load-event-expected.txt (144438 => 144439)


--- trunk/LayoutTests/inspector/timeline/timeline-load-event-expected.txt	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/LayoutTests/inspector/timeline/timeline-load-event-expected.txt	2013-03-01 12:04:24 UTC (rev 144439)
@@ -5,6 +5,7 @@
 {
     counters : <object>
     data : {
+        isMainFrame : true
     }
     frameId : <string>
     startTime : <number>

Modified: trunk/Source/WebCore/ChangeLog (144438 => 144439)


--- trunk/Source/WebCore/ChangeLog	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/Source/WebCore/ChangeLog	2013-03-01 12:04:24 UTC (rev 144439)
@@ -1,3 +1,26 @@
+2013-02-26  Eugene Klyuchnikov  <[email protected]>
+
+        Web Inspector: Save/load timeline should preserve DOMContentLoaded and Load event markers
+        https://bugs.webkit.org/show_bug.cgi?id=110819
+
+        Reviewed by Pavel Feldman.
+
+        To create event divider TimelinePresentation model checks if record
+        frame is main frame. With this patch check is moved to backend and
+        result is saved in record to avoid incoherence.
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+        Record "isMainFrame" flag.
+        (WebCore::InspectorTimelineAgent::didMarkLoadEvent): Ditto.
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createMarkData):
+        Added data object constructor.
+        * inspector/TimelineRecordFactory.h: Ditto.
+        * inspector/front-end/TimelinePresentationModel.js:
+        (WebInspector.TimelinePresentationModel.isEventDivider):
+        Use saved flag value instead of comparing with "current" main frame.
+
 2013-03-01  Eugene Klyuchnikov  <[email protected]>
 
         Web Inspector: [DataGrid] Columns are misaligned after rows being refreshed.

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (144438 => 144439)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2013-03-01 12:04:24 UTC (rev 144439)
@@ -465,12 +465,14 @@
 
 void InspectorTimelineAgent::didMarkDOMContentEvent(Frame* frame)
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::MarkDOMContent, false, frame);
+    bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame());
+    appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRecordType::MarkDOMContent, false, frame);
 }
 
 void InspectorTimelineAgent::didMarkLoadEvent(Frame* frame)
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::MarkLoad, false, frame);
+    bool isMainFrame = frame && m_pageAgent && (frame == m_pageAgent->mainFrame());
+    appendRecord(TimelineRecordFactory::createMarkData(isMainFrame), TimelineRecordType::MarkLoad, false, frame);
 }
 
 void InspectorTimelineAgent::didCommitLoad()

Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (144438 => 144439)


--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp	2013-03-01 12:04:24 UTC (rev 144439)
@@ -184,6 +184,13 @@
     return data.release();
 }
 
+PassRefPtr<InspectorObject> TimelineRecordFactory::createMarkData(bool isMainFrame)
+{
+    RefPtr<InspectorObject> data = ""
+    data->setBoolean("isMainFrame", isMainFrame);
+    return data.release();
+}
+
 PassRefPtr<InspectorObject> TimelineRecordFactory::createParseHTMLData(unsigned int length, unsigned int startLine)
 {
     RefPtr<InspectorObject> data = ""

Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.h (144438 => 144439)


--- trunk/Source/WebCore/inspector/TimelineRecordFactory.h	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.h	2013-03-01 12:04:24 UTC (rev 144439)
@@ -84,6 +84,8 @@
 
         static PassRefPtr<InspectorObject> createResizeImageData(bool shouldCache);
 
+        static PassRefPtr<InspectorObject> createMarkData(bool isMainFrame);
+
         static PassRefPtr<InspectorObject> createParseHTMLData(unsigned int length, unsigned int startLine);
 
         static PassRefPtr<InspectorObject> createAnimationFrameData(int callbackId);

Modified: trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js (144438 => 144439)


--- trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js	2013-03-01 12:01:57 UTC (rev 144438)
+++ trunk/Source/WebCore/inspector/front-end/TimelinePresentationModel.js	2013-03-01 12:04:24 UTC (rev 144439)
@@ -140,9 +140,8 @@
     if (record.type === recordTypes.TimeStamp)
         return true;
     if (record.type === recordTypes.MarkDOMContent || record.type === recordTypes.MarkLoad) {
-        var mainFrame = WebInspector.resourceTreeModel.mainFrame;
-        if (mainFrame && mainFrame.id === record.frameId)
-            return true;
+        if (record.data && ((typeof record.data.isMainFrame) === "boolean"))
+            return record.data.isMainFrame;
     }
     return false;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to