2010-09-29 Ilya Tikhonovsky <loislo@chromium.org>
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Sep 2010 12:45:49 +0000 (12:45 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Sep 2010 12:45:49 +0000 (12:45 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: assign the resource loading finish time which was obtained from the network stack
        as the end time for the corresponding event in Timeline.
        See related change for Resources panel https://bugs.webkit.org/show_bug.cgi?id=45664

        https://bugs.webkit.org/show_bug.cgi?id=46789

        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::didFinishLoading):
        (WebCore::InspectorController::didFailLoading):
        * inspector/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
        * inspector/InspectorTimelineAgent.h:

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

WebCore/ChangeLog
WebCore/inspector/InspectorController.cpp
WebCore/inspector/InspectorTimelineAgent.cpp
WebCore/inspector/InspectorTimelineAgent.h

index 5072d34077b70992bdb77613fc0dc48c320d9323..0e585d4db341f223f105b222a15bc31352887456 100644 (file)
@@ -1,3 +1,20 @@
+2010-09-29  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: assign the resource loading finish time which was obtained from the network stack
+        as the end time for the corresponding event in Timeline.
+        See related change for Resources panel https://bugs.webkit.org/show_bug.cgi?id=45664
+
+        https://bugs.webkit.org/show_bug.cgi?id=46789
+
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didFinishLoading):
+        (WebCore::InspectorController::didFailLoading):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::didFinishLoadingResource):
+        * inspector/InspectorTimelineAgent.h:
+
 2010-09-29  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Timothy Hatcher.
index 5cc7744dda7c1a431fa8a1d3aac9b9b587e2b0cc..903cadedce333769da2274385ce0db0d9297e646 100644 (file)
@@ -1080,7 +1080,7 @@ void InspectorController::didFinishLoading(unsigned long identifier, double fini
         return;
 
     if (m_timelineAgent)
-        m_timelineAgent->didFinishLoadingResource(identifier, false);
+        m_timelineAgent->didFinishLoadingResource(identifier, false, finishTime);
 
     RefPtr<InspectorResource> resource = getTrackedResource(identifier);
     if (!resource)
@@ -1099,7 +1099,7 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
         return;
 
     if (m_timelineAgent)
-        m_timelineAgent->didFinishLoadingResource(identifier, true);
+        m_timelineAgent->didFinishLoadingResource(identifier, true, 0);
 
     String message = "Failed to load resource";
     if (!error.localizedDescription().isEmpty())
index fbb17c46fb7928e13105e435561cc7bfe5976286..656f2f3e6ffce8f12d5805b2f31aec9ad410bd00 100644 (file)
@@ -242,10 +242,11 @@ void InspectorTimelineAgent::didReceiveResourceResponse()
     didCompleteCurrentRecord(ResourceReceiveResponseTimelineRecordType);
 }
 
-void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail)
+void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime)
 {
     pushGCEventRecords();
-    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(WTF::currentTimeMS());
+    // Sometimes network stack can provide for us exact finish loading time. In the other case we will use currentTime.
+    RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(finishTime ? finishTime * 1000 : WTF::currentTimeMS());
     record->setObject("data", TimelineRecordFactory::createResourceFinishData(identifier, didFail));
     record->setNumber("type", ResourceFinishTimelineRecordType);
     setHeapSizeStatistic(record.get());
index 6b3324b9682cde0d923f3e56005e95f39e56d487..261ae3a39def63559dc9bd0544cde0674521db40 100644 (file)
@@ -122,7 +122,7 @@ public:
     void willSendResourceRequest(unsigned long, bool isMainResource, const ResourceRequest&);
     void willReceiveResourceResponse(unsigned long, const ResourceResponse&);
     void didReceiveResourceResponse();
-    void didFinishLoadingResource(unsigned long, bool didFail);
+    void didFinishLoadingResource(unsigned long, bool didFail, double finishTime);
     void willReceiveResourceData(unsigned long identifier);
     void didReceiveResourceData();