Web Inspector: Remove or use TimelineAgent Resource related event types
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 22:26:25 +0000 (22:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jan 2015 22:26:25 +0000 (22:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140155

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-09
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Remove unused / stale Timeline event types.

* inspector/protocol/Timeline.json:

Source/WebCore:

Remove unused timeline events. The frontend was ignoring these events
and was often already getting nearly identical data from the Network domain.

* WebCore.exp.in:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willSendRequestImpl):
(WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
(WebCore::InspectorInstrumentation::didFinishLoadingImpl):
(WebCore::InspectorInstrumentation::didFailLoadingImpl):
(WebCore::InspectorInstrumentation::didScheduleResourceRequestImpl): Deleted.
(WebCore::InspectorInstrumentation::willReceiveResourceDataImpl): Deleted.
(WebCore::InspectorInstrumentation::didReceiveResourceDataImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willReceiveResourceResponse):
(WebCore::InspectorInstrumentation::didScheduleResourceRequest): Deleted.
(WebCore::InspectorInstrumentation::willReceiveResourceData): Deleted.
(WebCore::InspectorInstrumentation::didReceiveResourceData): Deleted.
* inspector/InspectorTimelineAgent.cpp:
(WebCore::toProtocol):
(WebCore::InspectorTimelineAgent::didScheduleResourceRequest): Deleted.
(WebCore::InspectorTimelineAgent::willSendResourceRequest): Deleted.
(WebCore::InspectorTimelineAgent::willReceiveResourceData): Deleted.
(WebCore::InspectorTimelineAgent::didReceiveResourceData): Deleted.
(WebCore::InspectorTimelineAgent::willReceiveResourceResponse): Deleted.
(WebCore::InspectorTimelineAgent::didReceiveResourceResponse): Deleted.
(WebCore::InspectorTimelineAgent::didFinishLoadingResource): Deleted.
* inspector/InspectorTimelineAgent.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createScheduleResourceRequestData): Deleted.
(WebCore::TimelineRecordFactory::createResourceSendRequestData): Deleted.
(WebCore::TimelineRecordFactory::createResourceReceiveResponseData): Deleted.
(WebCore::TimelineRecordFactory::createResourceFinishData): Deleted.
(WebCore::TimelineRecordFactory::createReceiveResourceData): Deleted.
* inspector/TimelineRecordFactory.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::scheduleLoad):
(WebCore::ResourceLoadScheduler::notifyDidScheduleResourceRequest): Deleted.
* loader/ResourceLoadScheduler.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveData):
(WebCore::ResourceLoader::didReceiveBuffer):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponse):
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::didReceiveDataArray):

Source/WebKit2:

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):

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

19 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/protocol/Timeline.json
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/inspector/InspectorInstrumentation.cpp
Source/WebCore/inspector/InspectorInstrumentation.h
Source/WebCore/inspector/InspectorTimelineAgent.cpp
Source/WebCore/inspector/InspectorTimelineAgent.h
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/TimelineRecordFactory.h
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/ResourceLoadNotifier.cpp
Source/WebCore/loader/ResourceLoadScheduler.cpp
Source/WebCore/loader/ResourceLoadScheduler.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
Source/WebCore/loader/mac/ResourceLoaderMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Network/WebResourceLoadScheduler.cpp

index 695b61d..e10d43d 100644 (file)
@@ -1,3 +1,14 @@
+2015-01-09  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove or use TimelineAgent Resource related event types
+        https://bugs.webkit.org/show_bug.cgi?id=140155
+
+        Reviewed by Timothy Hatcher.
+
+        Remove unused / stale Timeline event types.
+
+        * inspector/protocol/Timeline.json:
+
 2015-01-09  Csaba Osztrogon√°c  <ossy@webkit.org>
 
         REGRESSION(r177925): It broke the !ENABLE(INSPECTOR) build
index 95ab207..d92886d 100644 (file)
@@ -6,7 +6,7 @@
         {
             "id": "EventType",
             "type": "string",
-            "enum": ["EventDispatch", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "ScheduleResourceRequest", "ResourceSendRequest", "ResourceReceiveResponse", "ResourceReceivedData", "ResourceFinish", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "ProbeSample", "ConsoleProfile", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
+            "enum": ["EventDispatch", "ScheduleStyleRecalculation", "RecalculateStyles", "InvalidateLayout", "Layout", "Paint", "ScrollLayer", "ResizeImage", "ParseHTML", "TimerInstall", "TimerRemove", "TimerFire", "EvaluateScript", "MarkLoad", "MarkDOMContent", "TimeStamp", "Time", "TimeEnd", "XHRReadyStateChange", "XHRLoad", "FunctionCall", "ProbeSample", "ConsoleProfile", "GCEvent", "RequestAnimationFrame", "CancelAnimationFrame", "FireAnimationFrame", "WebSocketCreate", "WebSocketSendHandshakeRequest", "WebSocketReceiveHandshakeResponse", "WebSocketDestroy"],
             "description": "Timeline record type."
         },
         {
index 5607cab..dae97e4 100644 (file)
@@ -1,3 +1,62 @@
+2015-01-09  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove or use TimelineAgent Resource related event types
+        https://bugs.webkit.org/show_bug.cgi?id=140155
+
+        Reviewed by Timothy Hatcher.
+
+        Remove unused timeline events. The frontend was ignoring these events
+        and was often already getting nearly identical data from the Network domain.
+
+        * WebCore.exp.in:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::willSendRequestImpl):
+        (WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl):
+        (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
+        (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl):
+        (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
+        (WebCore::InspectorInstrumentation::didFailLoadingImpl):
+        (WebCore::InspectorInstrumentation::didScheduleResourceRequestImpl): Deleted.
+        (WebCore::InspectorInstrumentation::willReceiveResourceDataImpl): Deleted.
+        (WebCore::InspectorInstrumentation::didReceiveResourceDataImpl): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
+        (WebCore::InspectorInstrumentation::didScheduleResourceRequest): Deleted.
+        (WebCore::InspectorInstrumentation::willReceiveResourceData): Deleted.
+        (WebCore::InspectorInstrumentation::didReceiveResourceData): Deleted.
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::toProtocol):
+        (WebCore::InspectorTimelineAgent::didScheduleResourceRequest): Deleted.
+        (WebCore::InspectorTimelineAgent::willSendResourceRequest): Deleted.
+        (WebCore::InspectorTimelineAgent::willReceiveResourceData): Deleted.
+        (WebCore::InspectorTimelineAgent::didReceiveResourceData): Deleted.
+        (WebCore::InspectorTimelineAgent::willReceiveResourceResponse): Deleted.
+        (WebCore::InspectorTimelineAgent::didReceiveResourceResponse): Deleted.
+        (WebCore::InspectorTimelineAgent::didFinishLoadingResource): Deleted.
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::TimelineRecordFactory::createScheduleResourceRequestData): Deleted.
+        (WebCore::TimelineRecordFactory::createResourceSendRequestData): Deleted.
+        (WebCore::TimelineRecordFactory::createResourceReceiveResponseData): Deleted.
+        (WebCore::TimelineRecordFactory::createResourceFinishData): Deleted.
+        (WebCore::TimelineRecordFactory::createReceiveResourceData): Deleted.
+        * inspector/TimelineRecordFactory.h:
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::didReceiveResponse):
+        * loader/ResourceLoadNotifier.cpp:
+        (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
+        * loader/ResourceLoadScheduler.cpp:
+        (WebCore::ResourceLoadScheduler::scheduleLoad):
+        (WebCore::ResourceLoadScheduler::notifyDidScheduleResourceRequest): Deleted.
+        * loader/ResourceLoadScheduler.h:
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didReceiveData):
+        (WebCore::ResourceLoader::didReceiveBuffer):
+        * loader/appcache/ApplicationCacheGroup.cpp:
+        (WebCore::ApplicationCacheGroup::didReceiveResponse):
+        * loader/mac/ResourceLoaderMac.mm:
+        (WebCore::ResourceLoader::didReceiveDataArray):
+
 2015-01-09  Benjamin Poulain  <bpoulain@apple.com>
 
         Update r177745, one of the review comments was not integrated
index 73e6602..3ec94c5 100644 (file)
@@ -945,7 +945,6 @@ __ZN7WebCore21ResourceLoadScheduler20servePendingRequestsEPNS0_15HostInformation
 __ZN7WebCore21ResourceLoadScheduler21resumePendingRequestsEv
 __ZN7WebCore21ResourceLoadScheduler22suspendPendingRequestsEv
 __ZN7WebCore21ResourceLoadScheduler24schedulePluginStreamLoadEPNS_5FrameEPNS_32NetscapePlugInStreamLoaderClientERKNS_15ResourceRequestE
-__ZN7WebCore21ResourceLoadScheduler32notifyDidScheduleResourceRequestEPNS_14ResourceLoaderE
 __ZN7WebCore21ResourceLoadScheduler6removeEPNS_14ResourceLoaderE
 __ZN7WebCore21ResourceLoadSchedulerC2Ev
 __ZN7WebCore21ResourceLoadSchedulerD2Ev
index 8399037..da5b591 100644 (file)
@@ -290,12 +290,6 @@ void InspectorInstrumentation::willSendXMLHttpRequestImpl(InstrumentingAgents& i
         domDebuggerAgent->willSendXMLHttpRequest(url);
 }
 
-void InspectorInstrumentation::didScheduleResourceRequestImpl(InstrumentingAgents& instrumentingAgents, const String& url, Frame* frame)
-{
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
-        timelineAgent->didScheduleResourceRequest(url, frame);
-}
-
 void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents& instrumentingAgents, int timerId, int timeout, bool singleShot, ScriptExecutionContext* context)
 {
     pauseOnNativeEventIfNeeded(instrumentingAgents, false, setTimerEventName, true);
@@ -555,8 +549,6 @@ void InspectorInstrumentation::willSendRequestImpl(InstrumentingAgents& instrume
     if (!loader)
         return;
 
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
-        timelineAgent->willSendResourceRequest(identifier, request, loader->frame());
     if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
         resourceAgent->willSendRequest(identifier, *loader, request, redirectResponse);
 }
@@ -584,31 +576,9 @@ void InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl(InstrumentingA
         resourceAgent->didLoadResourceFromMemoryCache(*loader, *cachedResource);
 }
 
-InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceDataImpl(InstrumentingAgents& instrumentingAgents, Frame* frame, unsigned long identifier, int length)
-{
-    int timelineAgentId = 0;
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent()) {
-        timelineAgent->willReceiveResourceData(identifier, frame, length);
-        timelineAgentId = timelineAgent->id();
-    }
-    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
-}
-
-void InspectorInstrumentation::didReceiveResourceDataImpl(const InspectorInstrumentationCookie& cookie)
+InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponseImpl(InstrumentingAgents& instrumentingAgents)
 {
-    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
-        timelineAgent->didReceiveResourceData();
-}
-
-InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponseImpl(InstrumentingAgents& instrumentingAgents, Frame* frame, unsigned long identifier, const ResourceResponse& response)
-{
-    int timelineAgentId = 0;
-    InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent();
-    if (timelineAgent && frame) {
-        timelineAgent->willReceiveResourceResponse(identifier, response, frame);
-        timelineAgentId = timelineAgent->id();
-    }
-    return InspectorInstrumentationCookie(instrumentingAgents, timelineAgentId);
+    return InspectorInstrumentationCookie(instrumentingAgents, 0);
 }
 
 void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
@@ -621,8 +591,6 @@ void InspectorInstrumentation::didReceiveResourceResponseImpl(const InspectorIns
 
     InstrumentingAgents& instrumentingAgents = *cookie.instrumentingAgents();
 
-    if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
-        timelineAgent->didReceiveResourceResponse();
     if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
         resourceAgent->didReceiveResponse(identifier, *loader, response, resourceLoader);
     if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
@@ -634,7 +602,7 @@ void InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl(Frame*
     if (!frame)
         return;
 
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(frame, identifier, r);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(frame);
     InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, &loader, r, nullptr);
 }
 
@@ -664,8 +632,6 @@ void InspectorInstrumentation::didFinishLoadingImpl(InstrumentingAgents& instrum
     if (!loader)
         return;
 
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
-        timelineAgent->didFinishLoadingResource(identifier, false, finishTime, loader->frame());
     if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
         resourceAgent->didFinishLoading(identifier, *loader, finishTime);
 }
@@ -675,8 +641,6 @@ void InspectorInstrumentation::didFailLoadingImpl(InstrumentingAgents& instrumen
     if (!loader)
         return;
 
-    if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.inspectorTimelineAgent())
-        timelineAgent->didFinishLoadingResource(identifier, true, 0, loader->frame());
     if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
         resourceAgent->didFailLoading(identifier, *loader, error);
     if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
index 3221828..2d9d61d 100644 (file)
@@ -137,7 +137,6 @@ public:
     static bool forcePseudoState(Element&, CSSSelector::PseudoClassType);
 
     static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
-    static void didScheduleResourceRequest(Document*, const String& url);
     static void didInstallTimer(ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
     static void didRemoveTimer(ScriptExecutionContext*, int timerId);
 
@@ -175,9 +174,7 @@ public:
     static void continueAfterPingLoader(Frame&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
     static void markResourceAsCached(Page&, unsigned long identifier);
     static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*);
-    static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier, int length);
-    static void didReceiveResourceData(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse&);
+    static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*);
     static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
     static void continueWithPolicyDownload(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
@@ -336,7 +333,6 @@ private:
     static bool forcePseudoStateImpl(InstrumentingAgents&, Element&, CSSSelector::PseudoClassType);
 
     static void willSendXMLHttpRequestImpl(InstrumentingAgents&, const String& url);
-    static void didScheduleResourceRequestImpl(InstrumentingAgents&, const String& url, Frame*);
     static void didInstallTimerImpl(InstrumentingAgents&, int timerId, int timeout, bool singleShot, ScriptExecutionContext*);
     static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext*);
 
@@ -374,9 +370,7 @@ private:
     static void continueAfterPingLoaderImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
     static void markResourceAsCachedImpl(InstrumentingAgents&, unsigned long identifier);
     static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents&, DocumentLoader*, CachedResource*);
-    static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents&, Frame*, unsigned long identifier, int length);
-    static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
-    static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents&, Frame*, unsigned long identifier, const ResourceResponse&);
+    static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents&);
     static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
     static void didReceiveResourceResponseButCanceledImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
     static void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
@@ -805,18 +799,6 @@ inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionCont
 #endif
 }
 
-inline void InspectorInstrumentation::didScheduleResourceRequest(Document* document, const String& url)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        didScheduleResourceRequestImpl(*instrumentingAgents, url, document->frame());
-#else
-    UNUSED_PARAM(document);
-    UNUSED_PARAM(url);
-#endif
-}
-
 inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
 {
 #if ENABLE(INSPECTOR)
@@ -1242,36 +1224,11 @@ inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page,
 #endif
 }
 
-inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceData(Frame* frame, unsigned long identifier, int length)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        return willReceiveResourceDataImpl(*instrumentingAgents, frame, identifier, length);
-#else
-    UNUSED_PARAM(frame);
-    UNUSED_PARAM(identifier);
-    UNUSED_PARAM(length);
-#endif
-    return InspectorInstrumentationCookie();
-}
-
-inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInstrumentationCookie& cookie)
-{
-#if ENABLE(INSPECTOR)
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (cookie.isValid())
-        didReceiveResourceDataImpl(cookie);
-#else
-    UNUSED_PARAM(cookie);
-#endif
-}
-
-inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
+inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame)
 {
 #if ENABLE(INSPECTOR)
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        return willReceiveResourceResponseImpl(*instrumentingAgents, frame, identifier, response);
+        return willReceiveResourceResponseImpl(*instrumentingAgents);
 #else
     UNUSED_PARAM(frame);
     UNUSED_PARAM(identifier);
index 88ccdb1..2a91030 100644 (file)
@@ -439,44 +439,6 @@ void InspectorTimelineAgent::didEvaluateScript(Frame& frame)
     didCompleteCurrentRecord(TimelineRecordType::EvaluateScript);
 }
 
-void InspectorTimelineAgent::didScheduleResourceRequest(const String& url, Frame* frame)
-{
-    appendRecord(TimelineRecordFactory::createScheduleResourceRequestData(url), TimelineRecordType::ScheduleResourceRequest, true, frame);
-}
-
-void InspectorTimelineAgent::willSendResourceRequest(unsigned long identifier, const ResourceRequest& request, Frame* frame)
-{
-    String requestId = IdentifiersFactory::requestId(identifier);
-    appendRecord(TimelineRecordFactory::createResourceSendRequestData(requestId, request), TimelineRecordType::ResourceSendRequest, true, frame);
-}
-
-void InspectorTimelineAgent::willReceiveResourceData(unsigned long identifier, Frame* frame, int length)
-{
-    String requestId = IdentifiersFactory::requestId(identifier);
-    pushCurrentRecord(TimelineRecordFactory::createReceiveResourceData(requestId, length), TimelineRecordType::ResourceReceivedData, false, frame);
-}
-
-void InspectorTimelineAgent::didReceiveResourceData()
-{
-    didCompleteCurrentRecord(TimelineRecordType::ResourceReceivedData);
-}
-
-void InspectorTimelineAgent::willReceiveResourceResponse(unsigned long identifier, const ResourceResponse& response, Frame* frame)
-{
-    String requestId = IdentifiersFactory::requestId(identifier);
-    pushCurrentRecord(TimelineRecordFactory::createResourceReceiveResponseData(requestId, response), TimelineRecordType::ResourceReceiveResponse, false, frame);
-}
-
-void InspectorTimelineAgent::didReceiveResourceResponse()
-{
-    didCompleteCurrentRecord(TimelineRecordType::ResourceReceiveResponse);
-}
-
-void InspectorTimelineAgent::didFinishLoadingResource(unsigned long identifier, bool didFail, double finishTime, Frame* frame)
-{
-    appendRecord(TimelineRecordFactory::createResourceFinishData(IdentifiersFactory::requestId(identifier), didFail, finishTime * 1000), TimelineRecordType::ResourceFinish, false, frame);
-}
-
 void InspectorTimelineAgent::didTimeStamp(Frame& frame, const String& message)
 {
     appendRecord(TimelineRecordFactory::createTimeStampData(message), TimelineRecordType::TimeStamp, true, &frame);
@@ -604,17 +566,6 @@ static Inspector::Protocol::Timeline::EventType toProtocol(TimelineRecordType ty
     case TimelineRecordType::TimeEnd:
         return Inspector::Protocol::Timeline::EventType::TimeEnd;
 
-    case TimelineRecordType::ScheduleResourceRequest:
-        return Inspector::Protocol::Timeline::EventType::ScheduleResourceRequest;
-    case TimelineRecordType::ResourceSendRequest:
-        return Inspector::Protocol::Timeline::EventType::ResourceSendRequest;
-    case TimelineRecordType::ResourceReceiveResponse:
-        return Inspector::Protocol::Timeline::EventType::ResourceReceiveResponse;
-    case TimelineRecordType::ResourceReceivedData:
-        return Inspector::Protocol::Timeline::EventType::ResourceReceivedData;
-    case TimelineRecordType::ResourceFinish:
-        return Inspector::Protocol::Timeline::EventType::ResourceFinish;
-
     case TimelineRecordType::XHRReadyStateChange:
         return Inspector::Protocol::Timeline::EventType::XHRReadyStateChange;
     case TimelineRecordType::XHRLoad:
index 3e8e114..0004f2e 100644 (file)
@@ -91,12 +91,6 @@ enum class TimelineRecordType {
     Time,
     TimeEnd,
 
-    ScheduleResourceRequest,
-    ResourceSendRequest,
-    ResourceReceiveResponse,
-    ResourceReceivedData,
-    ResourceFinish,
-
     XHRReadyStateChange,
     XHRLoad,
 
@@ -143,7 +137,6 @@ public:
     PassRefPtr<JSC::Profile> stopFromConsole(JSC::ExecState*, const String& title);
 
     // InspectorInstrumentation callbacks.
-    void didScheduleResourceRequest(const String& url, Frame*);
     void didInstallTimer(int timerId, int timeout, bool singleShot, Frame*);
     void didRemoveTimer(int timerId, Frame*);
     void willFireTimer(int timerId, Frame*);
@@ -173,12 +166,6 @@ public:
     void didTimeStamp(Frame&, const String&);
     void didMarkDOMContentEvent(Frame&);
     void didMarkLoadEvent(Frame&);
-    void willSendResourceRequest(unsigned long, const ResourceRequest&, Frame*);
-    void willReceiveResourceResponse(unsigned long, const ResourceResponse&, Frame*);
-    void didReceiveResourceResponse();
-    void didFinishLoadingResource(unsigned long, bool didFail, double finishTime, Frame*);
-    void willReceiveResourceData(unsigned long identifier, Frame*, int length);
-    void didReceiveResourceData();
     void didRequestAnimationFrame(int callbackId, Frame*);
     void didCancelAnimationFrame(int callbackId, Frame*);
     void willFireAnimationFrame(int callbackId, Frame*);
index 7e2404c..037e405 100644 (file)
@@ -156,49 +156,6 @@ Ref<InspectorObject> TimelineRecordFactory::createTimeStampData(const String& me
     return WTF::move(data);
 }
 
-Ref<InspectorObject> TimelineRecordFactory::createScheduleResourceRequestData(const String& url)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setString("url", url);
-    return WTF::move(data);
-}
-
-Ref<InspectorObject> TimelineRecordFactory::createResourceSendRequestData(const String& requestId, const ResourceRequest& request)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setString("requestId", requestId);
-    data->setString("url", request.url().string());
-    data->setString("requestMethod", request.httpMethod());
-    return WTF::move(data);
-}
-
-Ref<InspectorObject> TimelineRecordFactory::createResourceReceiveResponseData(const String& requestId, const ResourceResponse& response)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setString("requestId", requestId);
-    data->setInteger("statusCode", response.httpStatusCode());
-    data->setString("mimeType", response.mimeType());
-    return WTF::move(data);
-}
-
-Ref<InspectorObject> TimelineRecordFactory::createResourceFinishData(const String& requestId, bool didFail, double finishTime)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setString("requestId", requestId);
-    data->setBoolean("didFail", didFail);
-    if (finishTime)
-        data->setDouble("networkTime", finishTime);
-    return WTF::move(data);
-}
-
-Ref<InspectorObject> TimelineRecordFactory::createReceiveResourceData(const String& requestId, int length)
-{
-    Ref<InspectorObject> data = InspectorObject::create();
-    data->setString("requestId", requestId);
-    data->setInteger("encodedDataLength", length);
-    return WTF::move(data);
-}
-
 Ref<InspectorObject> TimelineRecordFactory::createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout)
 {
     Ref<InspectorObject> data = InspectorObject::create();
index 0ef5690..d0c4389 100644 (file)
@@ -79,16 +79,6 @@ namespace WebCore {
 
         static Ref<Inspector::InspectorObject> createTimeStampData(const String&);
 
-        static Ref<Inspector::InspectorObject> createResourceSendRequestData(const String& requestId, const ResourceRequest&);
-
-        static Ref<Inspector::InspectorObject> createScheduleResourceRequestData(const String&);
-
-        static Ref<Inspector::InspectorObject> createResourceReceiveResponseData(const String& requestId, const ResourceResponse&);
-
-        static Ref<Inspector::InspectorObject> createReceiveResourceData(const String& requestId, int length);
-
-        static Ref<Inspector::InspectorObject> createResourceFinishData(const String& requestId, bool didFail, double finishTime);
-
         static Ref<Inspector::InspectorObject> createLayoutData(unsigned dirtyObjects, unsigned totalObjects, bool partialLayout);
 
         static Ref<Inspector::InspectorObject> createDecodeImageData(const String& imageType);
index 668f010..3229778 100644 (file)
@@ -243,7 +243,7 @@ void DocumentThreadableLoader::didReceiveResponse(unsigned long identifier, cons
     if (m_actualRequest) {
 #if ENABLE(INSPECTOR)
         DocumentLoader* loader = m_document.frame()->loader().documentLoader();
-        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_document.frame(), identifier, response);
+        InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_document.frame());
         InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, response, 0);
 #endif
 
index 157bf43..72bdbf0 100644 (file)
@@ -149,7 +149,7 @@ void ResourceLoadNotifier::dispatchWillSendRequest(DocumentLoader* loader, unsig
 
 void ResourceLoadNotifier::dispatchDidReceiveResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r, ResourceLoader* resourceLoader)
 {
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(&m_frame, identifier, r);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(&m_frame);
     m_frame.loader().client().dispatchDidReceiveResponse(loader, identifier, r);
     InspectorInstrumentation::didReceiveResourceResponse(cookie, identifier, loader, r, resourceLoader);
 }
index c4dd620..51aeb84 100644 (file)
@@ -191,18 +191,11 @@ void ResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader)
     }
 #endif
 
-    notifyDidScheduleResourceRequest(resourceLoader);
-
     // Handle asynchronously so early low priority requests don't
     // get scheduled before later high priority ones.
     scheduleServePendingRequests();
 }
 
-void ResourceLoadScheduler::notifyDidScheduleResourceRequest(ResourceLoader* loader)
-{
-    InspectorInstrumentation::didScheduleResourceRequest(loader->frameLoader() ? loader->frameLoader()->frame().document() : nullptr, loader->url());
-}
-
 #if USE(QUICK_LOOK)
 bool ResourceLoadScheduler::maybeLoadQuickLookResource(ResourceLoader& loader)
 {
index 3703438..d095b62 100644 (file)
@@ -75,8 +75,6 @@ protected:
     WEBCORE_EXPORT ResourceLoadScheduler();
     WEBCORE_EXPORT virtual ~ResourceLoadScheduler();
 
-    WEBCORE_EXPORT void notifyDidScheduleResourceRequest(ResourceLoader*);
-
 #if USE(QUICK_LOOK)
     WEBCORE_EXPORT bool maybeLoadQuickLookResource(ResourceLoader&);
 #endif
index 61ffb65..8db4774 100644 (file)
@@ -489,16 +489,12 @@ void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse&
 
 void ResourceLoader::didReceiveData(ResourceHandle*, const char* data, unsigned length, int encodedDataLength)
 {
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier(), encodedDataLength);
     didReceiveData(data, length, encodedDataLength, DataPayloadBytes);
-    InspectorInstrumentation::didReceiveResourceData(cookie);
 }
 
 void ResourceLoader::didReceiveBuffer(ResourceHandle*, PassRefPtr<SharedBuffer> buffer, int encodedDataLength)
 {
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier(), encodedDataLength);
     didReceiveBuffer(buffer, encodedDataLength, DataPayloadBytes);
-    InspectorInstrumentation::didReceiveResourceData(cookie);
 }
 
 void ResourceLoader::didFinishLoading(ResourceHandle*, double finishTime)
index c797109..91b0d97 100644 (file)
@@ -503,7 +503,7 @@ void ApplicationCacheGroup::didReceiveResponse(ResourceHandle* handle, const Res
 {
 #if ENABLE(INSPECTOR)
     DocumentLoader* loader = (handle == m_manifestHandle) ? nullptr : m_frame->loader().documentLoader();
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame, m_currentResourceIdentifier, response);
+    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(m_frame);
     InspectorInstrumentation::didReceiveResourceResponse(cookie, m_currentResourceIdentifier, loader, response, 0);
 #endif
 
index 798f44b..26b4cbd 100644 (file)
@@ -98,11 +98,7 @@ void ResourceLoader::didReceiveDataArray(ResourceHandle*, CFArrayRef dataArray)
         dataLength += CFDataGetLength(data);
     }
 
-    // FIXME: didReceiveData() passes encoded data length to InspectorInstrumentation, but it is not available here.
-    // This probably results in incorrect size being displayed in Web Inspector.
-    InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceData(m_frame.get(), identifier(), dataLength);
     didReceiveDataArray(dataArray);
-    InspectorInstrumentation::didReceiveResourceData(cookie);
 }
 
 #endif
index 1b1f9cd..10081a5 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-09  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Remove or use TimelineAgent Resource related event types
+        https://bugs.webkit.org/show_bug.cgi?id=140155
+
+        Reviewed by Timothy Hatcher.
+
+        * WebProcess/Network/WebResourceLoadScheduler.cpp:
+        (WebKit::WebResourceLoadScheduler::scheduleLoad):
+
 2015-01-09  Daniel Bates  <dabates@apple.com>
 
         [iOS] Fix the WebKit2 build with the public SDK
index ec90fe9..434790a 100644 (file)
@@ -188,8 +188,6 @@ void WebResourceLoadScheduler::scheduleLoad(ResourceLoader* resourceLoader, Cach
     }
     
     m_webResourceLoaders.set(identifier, WebResourceLoader::create(resourceLoader));
-    
-    notifyDidScheduleResourceRequest(resourceLoader);
 }
 
 void WebResourceLoadScheduler::scheduleInternallyFailedLoad(WebCore::ResourceLoader* resourceLoader)