Title: [101170] trunk
Revision
101170
Author
[email protected]
Date
2011-11-25 06:32:21 -0800 (Fri, 25 Nov 2011)

Log Message

Web Inspector: unflake timeline-network tests
https://bugs.webkit.org/show_bug.cgi?id=73123

Source/WebCore:

We should capture stack only when it makes sense. Otherwise loading from cache
results in different data sets (stacks) than regular load.

Reviewed by Yury Semikhatsky.

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::willDispatchEvent):
(WebCore::InspectorTimelineAgent::willLayout):
(WebCore::InspectorTimelineAgent::willRecalculateStyle):
(WebCore::InspectorTimelineAgent::willPaint):
(WebCore::InspectorTimelineAgent::willWriteHTML):
(WebCore::InspectorTimelineAgent::didInstallTimer):
(WebCore::InspectorTimelineAgent::didRemoveTimer):
(WebCore::InspectorTimelineAgent::willFireTimer):
(WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
(WebCore::InspectorTimelineAgent::willLoadXHR):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
(WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
(WebCore::InspectorTimelineAgent::willReceiveResourceData):
(WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
(WebCore::InspectorTimelineAgent::didFinishLoadingResource):
(WebCore::InspectorTimelineAgent::didTimeStamp):
(WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
(WebCore::InspectorTimelineAgent::didMarkLoadEvent):
(WebCore::InspectorTimelineAgent::didRegisterAnimationFrameCallback):
(WebCore::InspectorTimelineAgent::didCancelAnimationFrameCallback):
(WebCore::InspectorTimelineAgent::willFireAnimationFrameEvent):
(WebCore::InspectorTimelineAgent::appendRecord):
(WebCore::InspectorTimelineAgent::pushCurrentRecord):
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createGenericRecord):

LayoutTests:

Reviewed by Yury Semikhatsky.

* platform/chromium/inspector/timeline/timeline-animation-frame-expected.txt:
* platform/chromium/inspector/timeline/timeline-event-dispatch-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101169 => 101170)


--- trunk/LayoutTests/ChangeLog	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/LayoutTests/ChangeLog	2011-11-25 14:32:21 UTC (rev 101170)
@@ -1,5 +1,15 @@
 2011-11-25  Pavel Feldman  <[email protected]>
 
+        Web Inspector: unflake timeline-network tests
+        https://bugs.webkit.org/show_bug.cgi?id=73123
+
+        Reviewed by Yury Semikhatsky.
+
+        * platform/chromium/inspector/timeline/timeline-animation-frame-expected.txt:
+        * platform/chromium/inspector/timeline/timeline-event-dispatch-expected.txt:
+
+2011-11-25  Pavel Feldman  <[email protected]>
+
         Web Inspector: resource-tree-errors-reload.html is flaky.
         https://bugs.webkit.org/show_bug.cgi?id=66217
 

Modified: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-animation-frame-expected.txt (101169 => 101170)


--- trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-animation-frame-expected.txt	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-animation-frame-expected.txt	2011-11-25 14:32:21 UTC (rev 101170)
@@ -14,7 +14,6 @@
 FireAnimationFrameEvent Properties:
 {
     startTime : <number>
-    stackTrace : <object>
     data : {
         id : <number>
     }

Modified: trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-event-dispatch-expected.txt (101169 => 101170)


--- trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-event-dispatch-expected.txt	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/LayoutTests/platform/chromium/inspector/timeline/timeline-event-dispatch-expected.txt	2011-11-25 14:32:21 UTC (rev 101170)
@@ -4,7 +4,6 @@
 EventDispatch Properties:
 {
     startTime : <number>
-    stackTrace : <object>
     data : {
         type : "mousedown"
     }

Modified: trunk/Source/WebCore/ChangeLog (101169 => 101170)


--- trunk/Source/WebCore/ChangeLog	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/Source/WebCore/ChangeLog	2011-11-25 14:32:21 UTC (rev 101170)
@@ -1,3 +1,42 @@
+2011-11-25  Pavel Feldman  <[email protected]>
+
+        Web Inspector: unflake timeline-network tests
+        https://bugs.webkit.org/show_bug.cgi?id=73123
+
+        We should capture stack only when it makes sense. Otherwise loading from cache
+        results in different data sets (stacks) than regular load.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::willCallFunction):
+        (WebCore::InspectorTimelineAgent::willDispatchEvent):
+        (WebCore::InspectorTimelineAgent::willLayout):
+        (WebCore::InspectorTimelineAgent::willRecalculateStyle):
+        (WebCore::InspectorTimelineAgent::willPaint):
+        (WebCore::InspectorTimelineAgent::willWriteHTML):
+        (WebCore::InspectorTimelineAgent::didInstallTimer):
+        (WebCore::InspectorTimelineAgent::didRemoveTimer):
+        (WebCore::InspectorTimelineAgent::willFireTimer):
+        (WebCore::InspectorTimelineAgent::willChangeXHRReadyState):
+        (WebCore::InspectorTimelineAgent::willLoadXHR):
+        (WebCore::InspectorTimelineAgent::willEvaluateScript):
+        (WebCore::InspectorTimelineAgent::didScheduleResourceRequest):
+        (WebCore::InspectorTimelineAgent::willReceiveResourceData):
+        (WebCore::InspectorTimelineAgent::willReceiveResourceResponse):
+        (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+        (WebCore::InspectorTimelineAgent::didTimeStamp):
+        (WebCore::InspectorTimelineAgent::didMarkDOMContentEvent):
+        (WebCore::InspectorTimelineAgent::didMarkLoadEvent):
+        (WebCore::InspectorTimelineAgent::didRegisterAnimationFrameCallback):
+        (WebCore::InspectorTimelineAgent::didCancelAnimationFrameCallback):
+        (WebCore::InspectorTimelineAgent::willFireAnimationFrameEvent):
+        (WebCore::InspectorTimelineAgent::appendRecord):
+        (WebCore::InspectorTimelineAgent::pushCurrentRecord):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createGenericRecord):
+
 2011-11-25  Yury Semikhatsky  <[email protected]>
 
         [Chromium] Web Inspector: get rid of WebDevToolsFrontendClient::sendFrontendLoaded method

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (101169 => 101170)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2011-11-25 14:32:21 UTC (rev 101170)
@@ -165,7 +165,7 @@
 
 void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine)
 {
-    pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall);
+    pushCurrentRecord(TimelineRecordFactory::createFunctionCallData(scriptName, scriptLine), TimelineRecordType::FunctionCall, true);
 }
 
 void InspectorTimelineAgent::didCallFunction()
@@ -175,8 +175,7 @@
 
 void InspectorTimelineAgent::willDispatchEvent(const Event& event)
 {
-    pushCurrentRecord(TimelineRecordFactory::createEventDispatchData(event),
-        TimelineRecordType::EventDispatch);
+    pushCurrentRecord(TimelineRecordFactory::createEventDispatchData(event), TimelineRecordType::EventDispatch, false);
 }
 
 void InspectorTimelineAgent::didDispatchEvent()
@@ -186,7 +185,7 @@
 
 void InspectorTimelineAgent::willLayout()
 {
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout);
+    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Layout, true);
 }
 
 void InspectorTimelineAgent::didLayout()
@@ -196,7 +195,7 @@
 
 void InspectorTimelineAgent::willRecalculateStyle()
 {
-    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RecalculateStyles);
+    pushCurrentRecord(InspectorObject::create(), TimelineRecordType::RecalculateStyles, true);
 }
 
 void InspectorTimelineAgent::didRecalculateStyle()
@@ -206,7 +205,7 @@
 
 void InspectorTimelineAgent::willPaint(const LayoutRect& rect)
 {
-    pushCurrentRecord(TimelineRecordFactory::createPaintData(rect), TimelineRecordType::Paint);
+    pushCurrentRecord(TimelineRecordFactory::createPaintData(rect), TimelineRecordType::Paint, true);
 }
 
 void InspectorTimelineAgent::didPaint()
@@ -216,7 +215,7 @@
 
 void InspectorTimelineAgent::willWriteHTML(unsigned int length, unsigned int startLine)
 {
-    pushCurrentRecord(TimelineRecordFactory::createParseHTMLData(length, startLine), TimelineRecordType::ParseHTML);
+    pushCurrentRecord(TimelineRecordFactory::createParseHTMLData(length, startLine), TimelineRecordType::ParseHTML, true);
 }
 
 void InspectorTimelineAgent::didWriteHTML(unsigned int endLine)
@@ -230,17 +229,17 @@
 
 void InspectorTimelineAgent::didInstallTimer(int timerId, int timeout, bool singleShot)
 {
-    appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall);
+    appendRecord(TimelineRecordFactory::createTimerInstallData(timerId, timeout, singleShot), TimelineRecordType::TimerInstall, true);
 }
 
 void InspectorTimelineAgent::didRemoveTimer(int timerId)
 {
-    appendRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerRemove);
+    appendRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerRemove, true);
 }
 
 void InspectorTimelineAgent::willFireTimer(int timerId)
 {
-    pushCurrentRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerFire);
+    pushCurrentRecord(TimelineRecordFactory::createGenericTimerData(timerId), TimelineRecordType::TimerFire, false);
 }
 
 void InspectorTimelineAgent::didFireTimer()
@@ -250,7 +249,7 @@
 
 void InspectorTimelineAgent::willChangeXHRReadyState(const String& url, int readyState)
 {
-    pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange);
+    pushCurrentRecord(TimelineRecordFactory::createXHRReadyStateChangeData(url, readyState), TimelineRecordType::XHRReadyStateChange, false);
 }
 
 void InspectorTimelineAgent::didChangeXHRReadyState()
@@ -260,7 +259,7 @@
 
 void InspectorTimelineAgent::willLoadXHR(const String& url) 
 {
-    pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad);
+    pushCurrentRecord(TimelineRecordFactory::createXHRLoadData(url), TimelineRecordType::XHRLoad, true);
 }
 
 void InspectorTimelineAgent::didLoadXHR()
@@ -270,7 +269,7 @@
 
 void InspectorTimelineAgent::willEvaluateScript(const String& url, int lineNumber)
 {
-    pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript);
+    pushCurrentRecord(TimelineRecordFactory::createEvaluateScriptData(url, lineNumber), TimelineRecordType::EvaluateScript, true);
 }
     
 void InspectorTimelineAgent::didEvaluateScript()
@@ -280,7 +279,7 @@
 
 void InspectorTimelineAgent::didScheduleResourceRequest(const String& url)
 {
-    appendRecord(TimelineRecordFactory::createScheduleResourceRequestData(url), TimelineRecordType::ScheduleResourceRequest);
+    appendRecord(TimelineRecordFactory::createScheduleResourceRequestData(url), TimelineRecordType::ScheduleResourceRequest, true);
 }
 
 void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, const ResourceRequest& request)
@@ -297,7 +296,7 @@
 void InspectorTimelineAgent::willReceiveResourceData(unsigned long identifier)
 {
     String requestId = IdentifiersFactory::requestId(identifier);
-    pushCurrentRecord(TimelineRecordFactory::createReceiveResourceData(requestId), TimelineRecordType::ResourceReceivedData);
+    pushCurrentRecord(TimelineRecordFactory::createReceiveResourceData(requestId), TimelineRecordType::ResourceReceivedData, false);
 }
 
 void InspectorTimelineAgent::didReceiveResourceData()
@@ -308,7 +307,7 @@
 void InspectorTimelineAgent::willReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response)
 {
     String requestId = IdentifiersFactory::requestId(identifier);
-    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(requestId, response), TimelineRecordType::ResourceReceiveResponse);
+    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(requestId, response), TimelineRecordType::ResourceReceiveResponse, false);
 }
 
 void InspectorTimelineAgent::didReceiveResourceResponse()
@@ -318,22 +317,22 @@
 
 void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime)
 {
-    appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime * 1000), TimelineRecordType::ResourceFinish);
+    appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime * 1000), TimelineRecordType::ResourceFinish, false);
 }
 
 void InspectorTimelineAgent::didTimeStamp(const String& message)
 {
-    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp);
+    appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true);
 }
 
 void InspectorTimelineAgent::didMarkDOMContentEvent()
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::MarkDOMContent);
+    appendRecord(InspectorObject::create(), TimelineRecordType::MarkDOMContent, false);
 }
 
 void InspectorTimelineAgent::didMarkLoadEvent()
 {
-    appendRecord(InspectorObject::create(), TimelineRecordType::MarkLoad);
+    appendRecord(InspectorObject::create(), TimelineRecordType::MarkLoad, false);
 }
 
 void InspectorTimelineAgent::didCommitLoad()
@@ -343,17 +342,17 @@
 
 void InspectorTimelineAgent::didRegisterAnimationFrameCallback(int callbackId)
 {
-    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::RegisterAnimationFrameCallback);
+    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::RegisterAnimationFrameCallback, true);
 }
 
 void InspectorTimelineAgent::didCancelAnimationFrameCallback(int callbackId)
 {
-    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::CancelAnimationFrameCallback);
+    appendRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::CancelAnimationFrameCallback, true);
 }
 
 void InspectorTimelineAgent::willFireAnimationFrameEvent(int callbackId)
 {
-    pushCurrentRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::FireAnimationFrameEvent);
+    pushCurrentRecord(TimelineRecordFactory::createAnimationFrameCallbackData(callbackId), TimelineRecordType::FireAnimationFrameEvent, false);
 }
 
 void InspectorTimelineAgent::didFireAnimationFrameEvent()
@@ -409,19 +408,19 @@
 {
 }
 
-void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, const String& type)
+void InspectorTimelineAgent::appendRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack)
 {
     pushGCEventRecords();
-    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth);
+    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), captureCallStack ? m_maxCallStackDepth : 0);
     record->setObject("data", data);
     record->setString("type", type);
     addRecordToTimeline(record.release(), type);
 }
 
-void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type)
+void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack)
 {
     pushGCEventRecords();
-    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), m_maxCallStackDepth);
+    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS(), captureCallStack ? m_maxCallStackDepth : 0);
     m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type));
 }
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (101169 => 101170)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2011-11-25 14:32:21 UTC (rev 101170)
@@ -140,11 +140,11 @@
         
     InspectorTimelineAgent(InstrumentingAgents*, InspectorState*);
 
-    void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type);
+    void pushCurrentRecord(PassRefPtr<InspectorObject>, const String& type, bool captureCallStack);
     void setHeapSizeStatistic(InspectorObject* record);
         
     void didCompleteCurrentRecord(const String& type);
-    void appendRecord(PassRefPtr<InspectorObject> data, const String& type);
+    void appendRecord(PassRefPtr<InspectorObject> data, const String& type, bool captureCallStack);
 
     void addRecordToTimeline(PassRefPtr<InspectorObject>, const String& type);
 

Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (101169 => 101170)


--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp	2011-11-25 14:19:03 UTC (rev 101169)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp	2011-11-25 14:32:21 UTC (rev 101170)
@@ -48,9 +48,11 @@
     RefPtr<InspectorObject> record = InspectorObject::create();
     record->setNumber("startTime", startTime);
 
-    RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(maxCallStackDepth, true);
-    if (stackTrace && stackTrace->size())
-        record->setArray("stackTrace", stackTrace->buildInspectorArray());
+    if (maxCallStackDepth) {
+        RefPtr<ScriptCallStack> stackTrace = createScriptCallStack(maxCallStackDepth, true);
+        if (stackTrace && stackTrace->size())
+            record->setArray("stackTrace", stackTrace->buildInspectorArray());
+    }
     return record.release();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to