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 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "core/fetch/FetchInitiatorInfo.h" | 35 #include "core/fetch/FetchInitiatorInfo.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/InspectorConsoleAgent.h" | 38 #include "core/inspector/InspectorConsoleAgent.h" |
39 #include "core/inspector/InspectorDebuggerAgent.h" | 39 #include "core/inspector/InspectorDebuggerAgent.h" |
40 #include "core/inspector/InspectorProfilerAgent.h" | 40 #include "core/inspector/InspectorProfilerAgent.h" |
41 #include "core/inspector/InspectorResourceAgent.h" | 41 #include "core/inspector/InspectorResourceAgent.h" |
42 #include "core/inspector/InstrumentingAgents.h" | 42 #include "core/inspector/InstrumentingAgents.h" |
43 #include "core/inspector/WorkerInspectorController.h" | 43 #include "core/inspector/WorkerInspectorController.h" |
44 #include "core/page/Page.h" | 44 #include "core/page/Page.h" |
| 45 #include "core/workers/MainThreadWorkletGlobalScope.h" |
45 #include "core/workers/WorkerGlobalScope.h" | 46 #include "core/workers/WorkerGlobalScope.h" |
46 | 47 |
47 namespace blink { | 48 namespace blink { |
48 | 49 |
49 namespace { | 50 namespace { |
50 | 51 |
51 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<InstrumentingAgents>>& instru
mentingAgentsSet() | 52 WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<InstrumentingAgents>>& instru
mentingAgentsSet() |
52 { | 53 { |
53 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Instr
umentingAgents>>, instrumentingAgentsSet, ()); | 54 DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Instr
umentingAgents>>, instrumentingAgentsSet, ()); |
54 return instrumentingAgentsSet; | 55 return instrumentingAgentsSet; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 { | 167 { |
167 if (!workerGlobalScope) | 168 if (!workerGlobalScope) |
168 return 0; | 169 return 0; |
169 return instrumentationForWorkerGlobalScope(workerGlobalScope); | 170 return instrumentationForWorkerGlobalScope(workerGlobalScope); |
170 } | 171 } |
171 | 172 |
172 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*
context) | 173 InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ExecutionContext*
context) |
173 { | 174 { |
174 if (context->isWorkerGlobalScope()) | 175 if (context->isWorkerGlobalScope()) |
175 return instrumentationForWorkerGlobalScope(toWorkerGlobalScope(context))
; | 176 return instrumentationForWorkerGlobalScope(toWorkerGlobalScope(context))
; |
| 177 |
| 178 if (context->isWorkletGlobalScope()) { |
| 179 LocalFrame* frame = toMainThreadWorkletGlobalScope(context)->frame(); |
| 180 if (frame) |
| 181 return instrumentingAgentsFor(frame); |
| 182 } |
| 183 |
176 return 0; | 184 return 0; |
177 } | 185 } |
178 | 186 |
179 } // namespace InspectorInstrumentation | 187 } // namespace InspectorInstrumentation |
180 | 188 |
181 namespace InstrumentationEvents { | 189 namespace InstrumentationEvents { |
182 const char PaintSetup[] = "PaintSetup"; | 190 const char PaintSetup[] = "PaintSetup"; |
183 const char Paint[] = "Paint"; | 191 const char Paint[] = "Paint"; |
184 const char Layer[] = "Layer"; | 192 const char Layer[] = "Layer"; |
185 const char RequestMainThreadFrame[] = "RequestMainThreadFrame"; | 193 const char RequestMainThreadFrame[] = "RequestMainThreadFrame"; |
(...skipping 12 matching lines...) Expand all Loading... |
198 }; | 206 }; |
199 | 207 |
200 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope* work
erGlobalScope) | 208 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope* work
erGlobalScope) |
201 { | 209 { |
202 if (WorkerInspectorController* controller = workerGlobalScope->workerInspect
orController()) | 210 if (WorkerInspectorController* controller = workerGlobalScope->workerInspect
orController()) |
203 return controller->m_instrumentingAgents.get(); | 211 return controller->m_instrumentingAgents.get(); |
204 return 0; | 212 return 0; |
205 } | 213 } |
206 | 214 |
207 } // namespace blink | 215 } // namespace blink |
OLD | NEW |