| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/inspector/InspectorTraceEvents.h" | 5 #include "core/inspector/InspectorTraceEvents.h" |
| 6 | 6 |
| 7 #include <inttypes.h> | 7 #include <inttypes.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "bindings/core/v8/ScriptSourceCode.h" | 11 #include "bindings/core/v8/ScriptSourceCode.h" |
| 12 #include "bindings/core/v8/SourceLocation.h" | 12 #include "bindings/core/v8/SourceLocation.h" |
| 13 #include "core/animation/Animation.h" | 13 #include "core/animation/Animation.h" |
| 14 #include "core/animation/KeyframeEffectReadOnly.h" | 14 #include "core/animation/KeyframeEffectReadOnly.h" |
| 15 #include "core/css/invalidation/InvalidationSet.h" | 15 #include "core/css/invalidation/InvalidationSet.h" |
| 16 #include "core/dom/DOMNodeIds.h" | 16 #include "core/dom/DOMNodeIds.h" |
| 17 #include "core/dom/StyleChangeReason.h" | 17 #include "core/dom/StyleChangeReason.h" |
| 18 #include "core/events/Event.h" | 18 #include "core/events/Event.h" |
| 19 #include "core/frame/FrameView.h" | 19 #include "core/frame/FrameView.h" |
| 20 #include "core/frame/LocalFrame.h" | 20 #include "core/frame/LocalFrame.h" |
| 21 #include "core/html/HTMLFrameOwnerElement.h" | 21 #include "core/html/HTMLFrameOwnerElement.h" |
| 22 #include "core/html/parser/HTMLDocumentParser.h" | 22 #include "core/html/parser/HTMLDocumentParser.h" |
| 23 #include "core/inspector/IdentifiersFactory.h" | 23 #include "core/inspector/IdentifiersFactory.h" |
| 24 #include "core/layout/HitTestResult.h" | 24 #include "core/layout/HitTestResult.h" |
| 25 #include "core/layout/LayoutImage.h" | 25 #include "core/layout/LayoutImage.h" |
| 26 #include "core/layout/LayoutObject.h" | 26 #include "core/layout/LayoutObject.h" |
| 27 #include "core/loader/DocumentLoader.h" |
| 27 #include "core/loader/resource/CSSStyleSheetResource.h" | 28 #include "core/loader/resource/CSSStyleSheetResource.h" |
| 28 #include "core/page/Page.h" | 29 #include "core/page/Page.h" |
| 29 #include "core/paint/PaintLayer.h" | 30 #include "core/paint/PaintLayer.h" |
| 30 #include "core/probe/CoreProbes.h" | 31 #include "core/probe/CoreProbes.h" |
| 31 #include "core/workers/WorkerGlobalScope.h" | 32 #include "core/workers/WorkerGlobalScope.h" |
| 32 #include "core/workers/WorkerThread.h" | 33 #include "core/workers/WorkerThread.h" |
| 33 #include "core/xmlhttprequest/XMLHttpRequest.h" | 34 #include "core/xmlhttprequest/XMLHttpRequest.h" |
| 34 #include "platform/InstanceCounters.h" | 35 #include "platform/InstanceCounters.h" |
| 35 #include "platform/graphics/GraphicsLayer.h" | 36 #include "platform/graphics/GraphicsLayer.h" |
| 36 #include "platform/instrumentation/tracing/TracedValue.h" | 37 #include "platform/instrumentation/tracing/TracedValue.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 m_instrumentingAgents->removeInspectorTraceEvents(this); | 101 m_instrumentingAgents->removeInspectorTraceEvents(this); |
| 101 m_instrumentingAgents = nullptr; | 102 m_instrumentingAgents = nullptr; |
| 102 } | 103 } |
| 103 | 104 |
| 104 DEFINE_TRACE(InspectorTraceEvents) { | 105 DEFINE_TRACE(InspectorTraceEvents) { |
| 105 visitor->trace(m_instrumentingAgents); | 106 visitor->trace(m_instrumentingAgents); |
| 106 InspectorAgent::trace(visitor); | 107 InspectorAgent::trace(visitor); |
| 107 } | 108 } |
| 108 | 109 |
| 109 void InspectorTraceEvents::willSendRequest( | 110 void InspectorTraceEvents::willSendRequest( |
| 110 LocalFrame* frame, | |
| 111 unsigned long identifier, | 111 unsigned long identifier, |
| 112 DocumentLoader*, | 112 DocumentLoader* loader, |
| 113 ResourceRequest& request, | 113 ResourceRequest& request, |
| 114 const ResourceResponse& redirectResponse, | 114 const ResourceResponse& redirectResponse, |
| 115 const FetchInitiatorInfo&) { | 115 const FetchInitiatorInfo&) { |
| 116 LocalFrame* frame = loader ? loader->frame() : nullptr; |
| 116 TRACE_EVENT_INSTANT1( | 117 TRACE_EVENT_INSTANT1( |
| 117 "devtools.timeline", "ResourceSendRequest", TRACE_EVENT_SCOPE_THREAD, | 118 "devtools.timeline", "ResourceSendRequest", TRACE_EVENT_SCOPE_THREAD, |
| 118 "data", InspectorSendRequestEvent::data(identifier, frame, request)); | 119 "data", InspectorSendRequestEvent::data(identifier, frame, request)); |
| 119 probe::asyncTaskScheduled(frame->document(), "SendRequest", | 120 probe::asyncTaskScheduled(frame ? frame->document() : nullptr, "SendRequest", |
| 120 asyncId(identifier)); | 121 asyncId(identifier)); |
| 121 } | 122 } |
| 122 | 123 |
| 123 void InspectorTraceEvents::didReceiveResourceResponse( | 124 void InspectorTraceEvents::didReceiveResourceResponse( |
| 124 LocalFrame* frame, | |
| 125 unsigned long identifier, | 125 unsigned long identifier, |
| 126 DocumentLoader*, | 126 DocumentLoader* loader, |
| 127 const ResourceResponse& response, | 127 const ResourceResponse& response, |
| 128 Resource*) { | 128 Resource*) { |
| 129 LocalFrame* frame = loader ? loader->frame() : nullptr; |
| 129 TRACE_EVENT_INSTANT1( | 130 TRACE_EVENT_INSTANT1( |
| 130 "devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD, | 131 "devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD, |
| 131 "data", InspectorReceiveResponseEvent::data(identifier, frame, response)); | 132 "data", InspectorReceiveResponseEvent::data(identifier, frame, response)); |
| 132 probe::AsyncTask asyncTask(frame->document(), asyncId(identifier), | 133 probe::AsyncTask asyncTask(frame ? frame->document() : nullptr, |
| 133 "response"); | 134 asyncId(identifier), "response"); |
| 134 } | 135 } |
| 135 | 136 |
| 136 void InspectorTraceEvents::didReceiveData(LocalFrame* frame, | 137 void InspectorTraceEvents::didReceiveData(unsigned long identifier, |
| 137 unsigned long identifier, | 138 DocumentLoader* loader, |
| 138 const char* data, | 139 const char* data, |
| 139 int encodedDataLength) { | 140 int encodedDataLength) { |
| 141 LocalFrame* frame = loader ? loader->frame() : nullptr; |
| 140 TRACE_EVENT_INSTANT1( | 142 TRACE_EVENT_INSTANT1( |
| 141 "devtools.timeline", "ResourceReceivedData", TRACE_EVENT_SCOPE_THREAD, | 143 "devtools.timeline", "ResourceReceivedData", TRACE_EVENT_SCOPE_THREAD, |
| 142 "data", | 144 "data", |
| 143 InspectorReceiveDataEvent::data(identifier, frame, encodedDataLength)); | 145 InspectorReceiveDataEvent::data(identifier, frame, encodedDataLength)); |
| 144 probe::AsyncTask asyncTask(frame->document(), asyncId(identifier), "data"); | 146 probe::AsyncTask asyncTask(frame ? frame->document() : nullptr, |
| 147 asyncId(identifier), "data"); |
| 145 } | 148 } |
| 146 | 149 |
| 147 void InspectorTraceEvents::didFinishLoading(LocalFrame* frame, | 150 void InspectorTraceEvents::didFinishLoading(unsigned long identifier, |
| 148 unsigned long identifier, | 151 DocumentLoader* loader, |
| 149 double finishTime, | 152 double finishTime, |
| 150 int64_t encodedDataLength, | 153 int64_t encodedDataLength, |
| 151 int64_t decodedBodyLength) { | 154 int64_t decodedBodyLength) { |
| 155 LocalFrame* frame = loader ? loader->frame() : nullptr; |
| 152 TRACE_EVENT_INSTANT1( | 156 TRACE_EVENT_INSTANT1( |
| 153 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", | 157 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", |
| 154 InspectorResourceFinishEvent::data(identifier, finishTime, false, | 158 InspectorResourceFinishEvent::data(identifier, finishTime, false, |
| 155 encodedDataLength, decodedBodyLength)); | 159 encodedDataLength, decodedBodyLength)); |
| 156 probe::AsyncTask asyncTask(frame->document(), asyncId(identifier)); | 160 probe::AsyncTask asyncTask(frame ? frame->document() : nullptr, |
| 161 asyncId(identifier)); |
| 157 } | 162 } |
| 158 | 163 |
| 159 void InspectorTraceEvents::didFailLoading(unsigned long identifier, | 164 void InspectorTraceEvents::didFailLoading(unsigned long identifier, |
| 160 const ResourceError&) { | 165 const ResourceError&) { |
| 161 TRACE_EVENT_INSTANT1( | 166 TRACE_EVENT_INSTANT1( |
| 162 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", | 167 "devtools.timeline", "ResourceFinish", TRACE_EVENT_SCOPE_THREAD, "data", |
| 163 InspectorResourceFinishEvent::data(identifier, 0, true, 0, 0)); | 168 InspectorResourceFinishEvent::data(identifier, 0, true, 0, 0)); |
| 164 } | 169 } |
| 165 | 170 |
| 166 void InspectorTraceEvents::will(const probe::ExecuteScript&) {} | 171 void InspectorTraceEvents::will(const probe::ExecuteScript&) {} |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 return value; | 1212 return value; |
| 1208 } | 1213 } |
| 1209 | 1214 |
| 1210 std::unique_ptr<TracedValue> InspectorAsyncTask::data(const String& name) { | 1215 std::unique_ptr<TracedValue> InspectorAsyncTask::data(const String& name) { |
| 1211 std::unique_ptr<TracedValue> value = TracedValue::create(); | 1216 std::unique_ptr<TracedValue> value = TracedValue::create(); |
| 1212 value->setString("name", name); | 1217 value->setString("name", name); |
| 1213 return value; | 1218 return value; |
| 1214 } | 1219 } |
| 1215 | 1220 |
| 1216 } // namespace blink | 1221 } // namespace blink |
| OLD | NEW |