| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| 11 * copyright notice, this list of conditions and the following disclaimer | 11 * copyright notice, this list of conditions and the following disclaimer |
| 12 * in the documentation and/or other materials provided with the | 12 * in the documentation and/or other materials provided with the |
| 13 * distribution. | 13 * distribution. |
| 14 * * Neither the name of Google Inc. nor the names of its | 14 * * Neither the name of Google Inc. nor the names of its |
| 15 * contributors may be used to endorse or promote products derived from | 15 * contributors may be used to endorse or promote products derived from |
| 16 * this software without specific prior written permission. | 16 * this software without specific prior written permission. |
| 17 * | 17 * |
| 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "core/inspector/InspectorInstrumentation.h" | 31 #include "core/instrumentation/CoreProbes.h" |
| 32 | 32 |
| 33 #include "core/InspectorInstrumentationAgents.h" | 33 #include "core/CoreProbesSink.h" |
| 34 #include "core/events/Event.h" | 34 #include "core/events/Event.h" |
| 35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
| 36 #include "core/frame/FrameHost.h" | 36 #include "core/frame/FrameHost.h" |
| 37 #include "core/inspector/InspectorCSSAgent.h" | 37 #include "core/inspector/InspectorCSSAgent.h" |
| 38 #include "core/inspector/InspectorDOMDebuggerAgent.h" | 38 #include "core/inspector/InspectorDOMDebuggerAgent.h" |
| 39 #include "core/inspector/InspectorNetworkAgent.h" | 39 #include "core/inspector/InspectorNetworkAgent.h" |
| 40 #include "core/inspector/InspectorPageAgent.h" | 40 #include "core/inspector/InspectorPageAgent.h" |
| 41 #include "core/inspector/InspectorSession.h" | 41 #include "core/inspector/InspectorSession.h" |
| 42 #include "core/inspector/InspectorTraceEvents.h" | 42 #include "core/inspector/InspectorTraceEvents.h" |
| 43 #include "core/inspector/MainThreadDebugger.h" | 43 #include "core/inspector/MainThreadDebugger.h" |
| 44 #include "core/inspector/ThreadDebugger.h" | 44 #include "core/inspector/ThreadDebugger.h" |
| 45 #include "core/inspector/WorkerInspectorController.h" | 45 #include "core/inspector/WorkerInspectorController.h" |
| 46 #include "core/page/Page.h" | 46 #include "core/page/Page.h" |
| 47 #include "core/workers/MainThreadWorkletGlobalScope.h" | 47 #include "core/workers/MainThreadWorkletGlobalScope.h" |
| 48 #include "core/workers/WorkerGlobalScope.h" | 48 #include "core/workers/WorkerGlobalScope.h" |
| 49 #include "core/workers/WorkerThread.h" | 49 #include "core/workers/WorkerThread.h" |
| 50 #include "platform/instrumentation/tracing/TraceEvent.h" | 50 #include "platform/instrumentation/tracing/TraceEvent.h" |
| 51 #include "platform/loader/fetch/FetchInitiatorInfo.h" | 51 #include "platform/loader/fetch/FetchInitiatorInfo.h" |
| 52 | 52 |
| 53 namespace blink { | 53 namespace blink { |
| 54 | |
| 55 namespace probe { | 54 namespace probe { |
| 56 | 55 |
| 57 double ProbeBase::captureStartTime() const { | 56 double ProbeBase::captureStartTime() const { |
| 58 if (!m_startTime) | 57 if (!m_startTime) |
| 59 m_startTime = monotonicallyIncreasingTime(); | 58 m_startTime = monotonicallyIncreasingTime(); |
| 60 return m_startTime; | 59 return m_startTime; |
| 61 } | 60 } |
| 62 | 61 |
| 63 double ProbeBase::captureEndTime() const { | 62 double ProbeBase::captureEndTime() const { |
| 64 if (!m_endTime) | 63 if (!m_endTime) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 150 } |
| 152 | 151 |
| 153 void continueWithPolicyIgnore(LocalFrame* frame, | 152 void continueWithPolicyIgnore(LocalFrame* frame, |
| 154 DocumentLoader* loader, | 153 DocumentLoader* loader, |
| 155 unsigned long identifier, | 154 unsigned long identifier, |
| 156 const ResourceResponse& r, | 155 const ResourceResponse& r, |
| 157 Resource* resource) { | 156 Resource* resource) { |
| 158 didReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource); | 157 didReceiveResourceResponseButCanceled(frame, loader, identifier, r, resource); |
| 159 } | 158 } |
| 160 | 159 |
| 161 InspectorInstrumentationAgents* instrumentingAgentsFor( | 160 CoreProbesSink* toCoreProbesSink(WorkerGlobalScope* workerGlobalScope) { |
| 162 WorkerGlobalScope* workerGlobalScope) { | |
| 163 if (!workerGlobalScope) | 161 if (!workerGlobalScope) |
| 164 return nullptr; | 162 return nullptr; |
| 165 if (WorkerInspectorController* controller = | 163 if (WorkerInspectorController* controller = |
| 166 workerGlobalScope->thread()->workerInspectorController()) | 164 workerGlobalScope->thread()->workerInspectorController()) |
| 167 return controller->instrumentingAgents(); | 165 return controller->instrumentingAgents(); |
| 168 return nullptr; | 166 return nullptr; |
| 169 } | 167 } |
| 170 | 168 |
| 171 InspectorInstrumentationAgents* instrumentingAgentsForNonDocumentContext( | 169 CoreProbesSink* toCoreProbesSinkForNonDocumentContext(ExecutionContext* context)
{ |
| 172 ExecutionContext* context) { | |
| 173 if (context->isWorkerGlobalScope()) | 170 if (context->isWorkerGlobalScope()) |
| 174 return instrumentingAgentsFor(toWorkerGlobalScope(context)); | 171 return toCoreProbesSink(toWorkerGlobalScope(context)); |
| 175 if (context->isMainThreadWorkletGlobalScope()) | 172 if (context->isMainThreadWorkletGlobalScope()) |
| 176 return instrumentingAgentsFor( | 173 return toCoreProbesSink(toMainThreadWorkletGlobalScope(context)->frame()); |
| 177 toMainThreadWorkletGlobalScope(context)->frame()); | |
| 178 return nullptr; | 174 return nullptr; |
| 179 } | 175 } |
| 180 | 176 |
| 181 } // namespace InspectorInstrumentation | 177 } // namespace probe |
| 182 | |
| 183 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |