2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2014 Apple Inc. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 #ifndef InspectorInstrumentation_h
33 #define InspectorInstrumentation_h
35 #include "CSSSelector.h"
39 #include "HitTestResult.h"
40 #include "InspectorInstrumentationCookie.h"
42 #include "ScriptExecutionContext.h"
43 #include "ScriptState.h"
44 #include "StorageArea.h"
45 #include "WebSocketFrame.h"
46 #include <runtime/ConsoleTypes.h>
47 #include <wtf/RefPtr.h>
49 #if ENABLE(WEB_REPLAY)
50 #include "ReplaySession.h"
51 #include "ReplaySessionSegment.h"
55 namespace Deprecated {
61 class ScriptArguments;
62 class ScriptCallStack;
75 class DOMWrapperWorld;
80 class DocumentStyleSheetCollection;
81 class GraphicsContext;
83 class InspectorCSSAgent;
84 class InspectorCSSOMWrappers;
85 class InspectorInstrumentation;
86 class InspectorTimelineAgent;
87 class InstrumentingAgents;
92 class RenderLayerBacking;
94 class ResourceRequest;
95 class ResourceResponse;
96 class ScriptExecutionContext;
102 class ThreadableLoaderClient;
103 class WorkerGlobalScope;
104 class WorkerGlobalScopeProxy;
105 class XMLHttpRequest;
107 struct ReplayPosition;
109 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!hasFrontends())) return value;
111 class InspectorInstrumentation {
113 static void didClearWindowObjectInWorld(Frame&, DOMWrapperWorld&);
114 static bool isDebuggerPaused(Frame*);
116 static void willInsertDOMNode(Document&, Node& parent);
117 static void didInsertDOMNode(Document&, Node&);
118 static void willRemoveDOMNode(Document&, Node&);
119 static void didRemoveDOMNode(Document&, Node&);
120 static void willModifyDOMAttr(Document&, Element&, const AtomicString& oldValue, const AtomicString& newValue);
121 static void didModifyDOMAttr(Document&, Element&, const AtomicString& name, const AtomicString& value);
122 static void didRemoveDOMAttr(Document&, Element&, const AtomicString& name);
123 static void characterDataModified(Document&, CharacterData&);
124 static void didInvalidateStyleAttr(Document&, Node&);
125 static void frameWindowDiscarded(Frame*, DOMWindow*);
126 static void mediaQueryResultChanged(Document&);
127 static void didPushShadowRoot(Element& host, ShadowRoot&);
128 static void willPopShadowRoot(Element& host, ShadowRoot&);
129 static void didCreateNamedFlow(Document*, WebKitNamedFlow&);
130 static void willRemoveNamedFlow(Document*, WebKitNamedFlow&);
131 static void didChangeRegionOverset(Document&, WebKitNamedFlow&);
132 static void didRegisterNamedFlowContentElement(Document&, WebKitNamedFlow&, Node& contentElement, Node* nextContentElement = nullptr);
133 static void didUnregisterNamedFlowContentElement(Document&, WebKitNamedFlow&, Node& contentElement);
135 static void mouseDidMoveOverElement(Page&, const HitTestResult&, unsigned modifierFlags);
136 static bool handleMousePress(Frame&);
137 static bool handleTouchEvent(Frame&, Node&);
138 static bool forcePseudoState(Element&, CSSSelector::PseudoClassType);
140 static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
141 static void didInstallTimer(ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
142 static void didRemoveTimer(ScriptExecutionContext*, int timerId);
144 static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
145 static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
146 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest&);
147 static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
148 static InspectorInstrumentationCookie willDispatchEvent(Document&, const Event&, bool hasEventListeners);
149 static void didDispatchEvent(const InspectorInstrumentationCookie&);
150 static InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext*, const Event&);
151 static void didHandleEvent(const InspectorInstrumentationCookie&);
152 static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event&, DOMWindow&);
153 static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
154 static InspectorInstrumentationCookie willEvaluateScript(Frame&, const String& url, int lineNumber);
155 static void didEvaluateScript(const InspectorInstrumentationCookie&, Frame&);
156 static void scriptsEnabled(Page&, bool isEnabled);
157 static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
158 static void didFireTimer(const InspectorInstrumentationCookie&);
159 static void didInvalidateLayout(Frame&);
160 static InspectorInstrumentationCookie willLayout(Frame&);
161 static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
162 static void didScroll(Page&);
163 static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest&);
164 static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
165 static void willScrollLayer(Frame&);
166 static void didScrollLayer(Frame&);
167 static void willPaint(RenderObject*);
168 static void didPaint(RenderObject*, const LayoutRect&);
169 static InspectorInstrumentationCookie willRecalculateStyle(Document&);
170 static void didRecalculateStyle(const InspectorInstrumentationCookie&);
171 static void didScheduleStyleRecalculation(Document&);
173 static void applyEmulatedMedia(Frame&, String&);
174 static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
175 static void continueAfterPingLoader(Frame&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
176 static void markResourceAsCached(Page&, unsigned long identifier);
177 static void didLoadResourceFromMemoryCache(Page&, DocumentLoader*, CachedResource*);
178 static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*);
179 static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
180 static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
181 static void continueWithPolicyDownload(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
182 static void continueWithPolicyIgnore(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
183 static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
184 static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
185 static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
186 static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
187 static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
188 static void willLoadXHRSynchronously(ScriptExecutionContext*);
189 static void didLoadXHRSynchronously(ScriptExecutionContext*);
190 static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
191 static void scriptExecutionBlockedByCSP(ScriptExecutionContext*, const String& directiveText);
192 static void didReceiveScriptResponse(ScriptExecutionContext*, unsigned long identifier);
193 static void domContentLoadedEventFired(Frame&);
194 static void loadEventFired(Frame*);
195 static void frameDetachedFromParent(Frame&);
196 static void didCommitLoad(Frame&, DocumentLoader*);
197 static void frameDocumentUpdated(Frame*);
198 static void loaderDetachedFromFrame(Frame&, DocumentLoader&);
199 static void frameStartedLoading(Frame&);
200 static void frameStoppedLoading(Frame&);
201 static void frameScheduledNavigation(Frame&, double delay);
202 static void frameClearedScheduledNavigation(Frame&);
203 static InspectorInstrumentationCookie willRunJavaScriptDialog(Page&, const String& message);
204 static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
205 static void willDestroyCachedResource(CachedResource&);
207 static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned startLine);
208 static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
210 static void addMessageToConsole(Page&, std::unique_ptr<Inspector::ConsoleMessage>);
212 // FIXME: Convert to ScriptArguments to match non-worker context.
213 static void addMessageToConsole(WorkerGlobalScope*, std::unique_ptr<Inspector::ConsoleMessage>);
215 static void consoleCount(Page&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
216 static void startConsoleTiming(Frame&, const String& title);
217 static void stopConsoleTiming(Frame&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
218 static void consoleTimeStamp(Frame&, RefPtr<Inspector::ScriptArguments>&&);
220 static void didRequestAnimationFrame(Document*, int callbackId);
221 static void didCancelAnimationFrame(Document*, int callbackId);
222 static InspectorInstrumentationCookie willFireAnimationFrame(Document*, int callbackId);
223 static void didFireAnimationFrame(const InspectorInstrumentationCookie&);
225 static void startProfiling(Page&, JSC::ExecState*, const String& title);
226 static RefPtr<JSC::Profile> stopProfiling(Page&, JSC::ExecState*, const String& title);
228 static void didOpenDatabase(ScriptExecutionContext*, RefPtr<Database>&&, const String& domain, const String& name, const String& version);
230 static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
232 static bool shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext*);
233 static void didStartWorkerGlobalScope(ScriptExecutionContext*, WorkerGlobalScopeProxy*, const URL&);
234 static void workerGlobalScopeTerminated(ScriptExecutionContext*, WorkerGlobalScopeProxy*);
235 static void willEvaluateWorkerScript(WorkerGlobalScope*, int workerThreadStartMode);
237 #if ENABLE(WEB_REPLAY)
238 static void sessionCreated(Page&, RefPtr<ReplaySession>&&);
239 static void sessionLoaded(Page&, RefPtr<ReplaySession>&&);
240 static void sessionModified(Page&, RefPtr<ReplaySession>&&);
242 static void segmentCreated(Page&, RefPtr<ReplaySessionSegment>&&);
243 static void segmentCompleted(Page&, RefPtr<ReplaySessionSegment>&&);
244 static void segmentLoaded(Page&, RefPtr<ReplaySessionSegment>&&);
245 static void segmentUnloaded(Page&);
247 static void captureStarted(Page&);
248 static void captureStopped(Page&);
250 static void playbackStarted(Page&);
251 static void playbackPaused(Page&, const ReplayPosition&);
252 static void playbackHitPosition(Page&, const ReplayPosition&);
253 static void playbackFinished(Page&);
256 #if ENABLE(WEB_SOCKETS)
257 static void didCreateWebSocket(Document*, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol);
258 static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const ResourceRequest&);
259 static void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const ResourceResponse&);
260 static void didCloseWebSocket(Document*, unsigned long identifier);
261 static void didReceiveWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
262 static void didSendWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
263 static void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
266 static Deprecated::ScriptObject wrapCanvas2DRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
268 static Deprecated::ScriptObject wrapWebGLRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
271 static void networkStateChanged(Page*);
272 static void updateApplicationCacheStatus(Frame*);
274 static void layerTreeDidChange(Page*);
275 static void renderLayerDestroyed(Page*, const RenderLayer&);
276 static void pseudoElementDestroyed(Page*, PseudoElement&);
278 static void frontendCreated() { s_frontendCounter += 1; }
279 static void frontendDeleted() { s_frontendCounter -= 1; }
280 static bool hasFrontends() { return s_frontendCounter; }
281 static bool consoleAgentEnabled(ScriptExecutionContext*);
282 static bool timelineAgentEnabled(ScriptExecutionContext*);
283 static bool replayAgentEnabled(ScriptExecutionContext*);
285 WEBCORE_EXPORT static InstrumentingAgents* instrumentingAgentsForPage(Page*);
287 static void registerInstrumentingAgents(InstrumentingAgents&);
288 static void unregisterInstrumentingAgents(InstrumentingAgents&);
291 static void didClearWindowObjectInWorldImpl(InstrumentingAgents&, Frame&, DOMWrapperWorld&);
292 static bool isDebuggerPausedImpl(InstrumentingAgents&);
294 static void willInsertDOMNodeImpl(InstrumentingAgents&, Node& parent);
295 static void didInsertDOMNodeImpl(InstrumentingAgents&, Node&);
296 static void willRemoveDOMNodeImpl(InstrumentingAgents&, Node&);
297 static void didRemoveDOMNodeImpl(InstrumentingAgents&, Node&);
298 static void willModifyDOMAttrImpl(InstrumentingAgents&, Element&, const AtomicString& oldValue, const AtomicString& newValue);
299 static void didModifyDOMAttrImpl(InstrumentingAgents&, Element&, const AtomicString& name, const AtomicString& value);
300 static void didRemoveDOMAttrImpl(InstrumentingAgents&, Element&, const AtomicString& name);
301 static void characterDataModifiedImpl(InstrumentingAgents&, CharacterData&);
302 static void didInvalidateStyleAttrImpl(InstrumentingAgents&, Node&);
303 static void frameWindowDiscardedImpl(InstrumentingAgents&, DOMWindow*);
304 static void mediaQueryResultChangedImpl(InstrumentingAgents&);
305 static void didPushShadowRootImpl(InstrumentingAgents&, Element& host, ShadowRoot&);
306 static void willPopShadowRootImpl(InstrumentingAgents&, Element& host, ShadowRoot&);
307 static void didCreateNamedFlowImpl(InstrumentingAgents&, Document*, WebKitNamedFlow&);
308 static void willRemoveNamedFlowImpl(InstrumentingAgents&, Document*, WebKitNamedFlow&);
309 static void didChangeRegionOversetImpl(InstrumentingAgents&, Document&, WebKitNamedFlow&);
310 static void didRegisterNamedFlowContentElementImpl(InstrumentingAgents&, Document&, WebKitNamedFlow&, Node& contentElement, Node* nextContentElement = nullptr);
311 static void didUnregisterNamedFlowContentElementImpl(InstrumentingAgents&, Document&, WebKitNamedFlow&, Node& contentElement);
313 static void mouseDidMoveOverElementImpl(InstrumentingAgents&, const HitTestResult&, unsigned modifierFlags);
314 static bool handleTouchEventImpl(InstrumentingAgents&, Node&);
315 static bool handleMousePressImpl(InstrumentingAgents&);
316 static bool forcePseudoStateImpl(InstrumentingAgents&, Element&, CSSSelector::PseudoClassType);
318 static void willSendXMLHttpRequestImpl(InstrumentingAgents&, const String& url);
319 static void didInstallTimerImpl(InstrumentingAgents&, int timerId, int timeout, bool singleShot, ScriptExecutionContext*);
320 static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext*);
322 static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
323 static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
324 static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);
325 static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
326 static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents&, Document&, const Event&, bool hasEventListeners);
327 static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents&, const Event&);
328 static void didHandleEventImpl(const InspectorInstrumentationCookie&);
329 static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
330 static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents&, const Event&, DOMWindow&);
331 static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
332 static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents&, Frame&, const String& url, int lineNumber);
333 static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&, Frame&);
334 static void scriptsEnabledImpl(InstrumentingAgents&, bool isEnabled);
335 static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext*);
336 static void didFireTimerImpl(const InspectorInstrumentationCookie&);
337 static void didInvalidateLayoutImpl(InstrumentingAgents&, Frame&);
338 static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents&, Frame&);
339 static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
340 static void didScrollImpl(InstrumentingAgents&);
341 static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents&, XMLHttpRequest&, ScriptExecutionContext*);
342 static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
343 static void willScrollLayerImpl(InstrumentingAgents&, Frame&);
344 static void didScrollLayerImpl(InstrumentingAgents&);
345 static void willPaintImpl(InstrumentingAgents&, RenderObject*);
346 static void didPaintImpl(InstrumentingAgents&, RenderObject*, const LayoutRect&);
347 static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents&, Document&);
348 static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
349 static void didScheduleStyleRecalculationImpl(InstrumentingAgents&, Document&);
351 static void applyEmulatedMediaImpl(InstrumentingAgents&, String&);
352 static void willSendRequestImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
353 static void continueAfterPingLoaderImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
354 static void markResourceAsCachedImpl(InstrumentingAgents&, unsigned long identifier);
355 static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents&, DocumentLoader*, CachedResource*);
356 static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents&);
357 static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
358 static void didReceiveResourceResponseButCanceledImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
359 static void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
360 static void continueWithPolicyDownloadImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
361 static void continueWithPolicyIgnoreImpl(Frame*, DocumentLoader&, unsigned long identifier, const ResourceResponse&);
362 static void didReceiveDataImpl(InstrumentingAgents&, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
363 static void didFinishLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, double finishTime);
364 static void didFailLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceError&);
365 static void willLoadXHRImpl(InstrumentingAgents&, ThreadableLoaderClient*, const String&, const URL&, bool, RefPtr<FormData>&&, const HTTPHeaderMap&, bool);
366 static void didFailXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*);
367 static void didFinishXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
368 static void didReceiveXHRResponseImpl(InstrumentingAgents&, unsigned long identifier);
369 static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&);
370 static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&);
371 static void scriptImportedImpl(InstrumentingAgents&, unsigned long identifier, const String& sourceString);
372 static void scriptExecutionBlockedByCSPImpl(InstrumentingAgents&, const String& directiveText);
373 static void didReceiveScriptResponseImpl(InstrumentingAgents&, unsigned long identifier);
374 static void domContentLoadedEventFiredImpl(InstrumentingAgents&, Frame&);
375 static void loadEventFiredImpl(InstrumentingAgents&, Frame*);
376 static void frameDetachedFromParentImpl(InstrumentingAgents&, Frame&);
377 static void didCommitLoadImpl(InstrumentingAgents&, Page*, DocumentLoader*);
378 static void frameDocumentUpdatedImpl(InstrumentingAgents&, Frame*);
379 static void loaderDetachedFromFrameImpl(InstrumentingAgents&, DocumentLoader&);
380 static void frameStartedLoadingImpl(InstrumentingAgents&, Frame&);
381 static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
382 static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, double delay);
383 static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&);
384 static InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents&, const String& message);
385 static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
386 static void willDestroyCachedResourceImpl(CachedResource&);
388 static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents&, unsigned startLine, Frame*);
389 static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned endLine);
391 static void addMessageToConsoleImpl(InstrumentingAgents&, std::unique_ptr<Inspector::ConsoleMessage>);
393 static void consoleCountImpl(InstrumentingAgents&, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
394 static void startConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title);
395 static void stopConsoleTimingImpl(InstrumentingAgents&, Frame&, const String& title, RefPtr<Inspector::ScriptCallStack>&&);
396 static void consoleTimeStampImpl(InstrumentingAgents&, Frame&, RefPtr<Inspector::ScriptArguments>&&);
398 static void didRequestAnimationFrameImpl(InstrumentingAgents&, int callbackId, Frame*);
399 static void didCancelAnimationFrameImpl(InstrumentingAgents&, int callbackId, Frame*);
400 static InspectorInstrumentationCookie willFireAnimationFrameImpl(InstrumentingAgents&, int callbackId, Frame*);
401 static void didFireAnimationFrameImpl(const InspectorInstrumentationCookie&);
403 static void startProfilingImpl(InstrumentingAgents&, JSC::ExecState*, const String& title);
404 static RefPtr<JSC::Profile> stopProfilingImpl(InstrumentingAgents&, JSC::ExecState*, const String& title);
406 static void didOpenDatabaseImpl(InstrumentingAgents&, RefPtr<Database>&&, const String& domain, const String& name, const String& version);
408 static void didDispatchDOMStorageEventImpl(InstrumentingAgents&, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
410 static bool shouldPauseDedicatedWorkerOnStartImpl(InstrumentingAgents&);
411 static void didStartWorkerGlobalScopeImpl(InstrumentingAgents&, WorkerGlobalScopeProxy*, const URL&);
412 static void workerGlobalScopeTerminatedImpl(InstrumentingAgents&, WorkerGlobalScopeProxy*);
414 #if ENABLE(WEB_REPLAY)
415 static void sessionCreatedImpl(InstrumentingAgents&, RefPtr<ReplaySession>&&);
416 static void sessionLoadedImpl(InstrumentingAgents&, RefPtr<ReplaySession>&&);
417 static void sessionModifiedImpl(InstrumentingAgents&, RefPtr<ReplaySession>&&);
419 static void segmentCreatedImpl(InstrumentingAgents&, RefPtr<ReplaySessionSegment>&&);
420 static void segmentCompletedImpl(InstrumentingAgents&, RefPtr<ReplaySessionSegment>&&);
421 static void segmentLoadedImpl(InstrumentingAgents&, RefPtr<ReplaySessionSegment>&&);
422 static void segmentUnloadedImpl(InstrumentingAgents&);
424 static void captureStartedImpl(InstrumentingAgents&);
425 static void captureStoppedImpl(InstrumentingAgents&);
427 static void playbackStartedImpl(InstrumentingAgents&);
428 static void playbackPausedImpl(InstrumentingAgents&, const ReplayPosition&);
429 static void playbackHitPositionImpl(InstrumentingAgents&, const ReplayPosition&);
430 static void playbackFinishedImpl(InstrumentingAgents&);
433 #if ENABLE(WEB_SOCKETS)
434 static void didCreateWebSocketImpl(InstrumentingAgents&, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol, Document*);
435 static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents&, unsigned long identifier, const ResourceRequest&, Document*);
436 static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents&, unsigned long identifier, const ResourceResponse&, Document*);
437 static void didCloseWebSocketImpl(InstrumentingAgents&, unsigned long identifier, Document*);
438 static void didReceiveWebSocketFrameImpl(InstrumentingAgents&, unsigned long identifier, const WebSocketFrame&);
439 static void didSendWebSocketFrameImpl(InstrumentingAgents&, unsigned long identifier, const WebSocketFrame&);
440 static void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents&, unsigned long identifier, const String&);
443 static void networkStateChangedImpl(InstrumentingAgents&);
444 static void updateApplicationCacheStatusImpl(InstrumentingAgents&, Frame*);
446 static void layerTreeDidChangeImpl(InstrumentingAgents&);
447 static void renderLayerDestroyedImpl(InstrumentingAgents&, const RenderLayer&);
448 static void pseudoElementDestroyedImpl(InstrumentingAgents&, PseudoElement&);
450 static InstrumentingAgents* instrumentingAgentsForPage(Page&);
451 static InstrumentingAgents* instrumentingAgentsForFrame(Frame&);
452 static InstrumentingAgents* instrumentingAgentsForFrame(Frame*);
453 static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext*);
454 static InstrumentingAgents* instrumentingAgentsForDocument(Document&);
455 static InstrumentingAgents* instrumentingAgentsForDocument(Document*);
456 static InstrumentingAgents* instrumentingAgentsForRenderer(RenderObject*);
458 static InstrumentingAgents* instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope*);
459 static InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ScriptExecutionContext*);
461 static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
463 static void pauseOnNativeEventIfNeeded(InstrumentingAgents&, bool isDOMEvent, const String& eventName, bool synchronous);
464 static void cancelPauseOnNativeEvent(InstrumentingAgents&);
466 WEBCORE_EXPORT static int s_frontendCounter;
469 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame& frame, DOMWrapperWorld& world)
471 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
472 didClearWindowObjectInWorldImpl(*instrumentingAgents, frame, world);
475 inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame)
477 FAST_RETURN_IF_NO_FRONTENDS(false);
478 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
479 return isDebuggerPausedImpl(*instrumentingAgents);
483 inline void InspectorInstrumentation::willInsertDOMNode(Document& document, Node& parent)
485 FAST_RETURN_IF_NO_FRONTENDS(void());
486 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
487 willInsertDOMNodeImpl(*instrumentingAgents, parent);
490 inline void InspectorInstrumentation::didInsertDOMNode(Document& document, Node& node)
492 FAST_RETURN_IF_NO_FRONTENDS(void());
493 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
494 didInsertDOMNodeImpl(*instrumentingAgents, node);
497 inline void InspectorInstrumentation::willRemoveDOMNode(Document& document, Node& node)
499 FAST_RETURN_IF_NO_FRONTENDS(void());
500 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
501 willRemoveDOMNodeImpl(*instrumentingAgents, node);
504 inline void InspectorInstrumentation::didRemoveDOMNode(Document& document, Node& node)
506 FAST_RETURN_IF_NO_FRONTENDS(void());
507 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
508 didRemoveDOMNodeImpl(*instrumentingAgents, node);
511 inline void InspectorInstrumentation::willModifyDOMAttr(Document& document, Element& element, const AtomicString& oldValue, const AtomicString& newValue)
513 FAST_RETURN_IF_NO_FRONTENDS(void());
514 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
515 willModifyDOMAttrImpl(*instrumentingAgents, element, oldValue, newValue);
518 inline void InspectorInstrumentation::didModifyDOMAttr(Document& document, Element& element, const AtomicString& name, const AtomicString& value)
520 FAST_RETURN_IF_NO_FRONTENDS(void());
521 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
522 didModifyDOMAttrImpl(*instrumentingAgents, element, name, value);
525 inline void InspectorInstrumentation::didRemoveDOMAttr(Document& document, Element& element, const AtomicString& name)
527 FAST_RETURN_IF_NO_FRONTENDS(void());
528 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
529 didRemoveDOMAttrImpl(*instrumentingAgents, element, name);
532 inline void InspectorInstrumentation::didInvalidateStyleAttr(Document& document, Node& node)
534 FAST_RETURN_IF_NO_FRONTENDS(void());
535 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
536 didInvalidateStyleAttrImpl(*instrumentingAgents, node);
539 inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
541 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
542 frameWindowDiscardedImpl(*instrumentingAgents, domWindow);
545 inline void InspectorInstrumentation::mediaQueryResultChanged(Document& document)
547 FAST_RETURN_IF_NO_FRONTENDS(void());
548 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
549 mediaQueryResultChangedImpl(*instrumentingAgents);
552 inline void InspectorInstrumentation::didPushShadowRoot(Element& host, ShadowRoot& root)
554 FAST_RETURN_IF_NO_FRONTENDS(void());
555 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host.document()))
556 didPushShadowRootImpl(*instrumentingAgents, host, root);
559 inline void InspectorInstrumentation::willPopShadowRoot(Element& host, ShadowRoot& root)
561 FAST_RETURN_IF_NO_FRONTENDS(void());
562 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host.document()))
563 willPopShadowRootImpl(*instrumentingAgents, host, root);
566 inline void InspectorInstrumentation::didCreateNamedFlow(Document* document, WebKitNamedFlow& namedFlow)
568 FAST_RETURN_IF_NO_FRONTENDS(void());
569 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
570 didCreateNamedFlowImpl(*instrumentingAgents, document, namedFlow);
573 inline void InspectorInstrumentation::willRemoveNamedFlow(Document* document, WebKitNamedFlow& namedFlow)
575 FAST_RETURN_IF_NO_FRONTENDS(void());
576 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
577 willRemoveNamedFlowImpl(*instrumentingAgents, document, namedFlow);
580 inline void InspectorInstrumentation::didChangeRegionOverset(Document& document, WebKitNamedFlow& namedFlow)
582 FAST_RETURN_IF_NO_FRONTENDS(void());
583 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
584 didChangeRegionOversetImpl(*instrumentingAgents, document, namedFlow);
587 inline void InspectorInstrumentation::didRegisterNamedFlowContentElement(Document& document, WebKitNamedFlow& namedFlow, Node& contentElement, Node* nextContentElement)
589 FAST_RETURN_IF_NO_FRONTENDS(void());
590 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
591 didRegisterNamedFlowContentElementImpl(*instrumentingAgents, document, namedFlow, contentElement, nextContentElement);
594 inline void InspectorInstrumentation::didUnregisterNamedFlowContentElement(Document& document, WebKitNamedFlow& namedFlow, Node& contentElement)
596 FAST_RETURN_IF_NO_FRONTENDS(void());
597 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
598 didUnregisterNamedFlowContentElementImpl(*instrumentingAgents, document, namedFlow, contentElement);
601 inline void InspectorInstrumentation::mouseDidMoveOverElement(Page& page, const HitTestResult& result, unsigned modifierFlags)
603 FAST_RETURN_IF_NO_FRONTENDS(void());
604 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
605 mouseDidMoveOverElementImpl(*instrumentingAgents, result, modifierFlags);
608 inline bool InspectorInstrumentation::handleTouchEvent(Frame& frame, Node& node)
610 FAST_RETURN_IF_NO_FRONTENDS(false);
611 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
612 return handleTouchEventImpl(*instrumentingAgents, node);
616 inline bool InspectorInstrumentation::handleMousePress(Frame& frame)
618 FAST_RETURN_IF_NO_FRONTENDS(false);
619 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
620 return handleMousePressImpl(*instrumentingAgents);
624 inline bool InspectorInstrumentation::forcePseudoState(Element& element, CSSSelector::PseudoClassType pseudoState)
626 FAST_RETURN_IF_NO_FRONTENDS(false);
627 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(element.document()))
628 return forcePseudoStateImpl(*instrumentingAgents, element, pseudoState);
632 inline void InspectorInstrumentation::characterDataModified(Document& document, CharacterData& characterData)
634 FAST_RETURN_IF_NO_FRONTENDS(void());
635 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
636 characterDataModifiedImpl(*instrumentingAgents, characterData);
639 inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
641 FAST_RETURN_IF_NO_FRONTENDS(void());
642 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
643 willSendXMLHttpRequestImpl(*instrumentingAgents, url);
646 inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
648 FAST_RETURN_IF_NO_FRONTENDS(void());
649 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
650 didInstallTimerImpl(*instrumentingAgents, timerId, timeout, singleShot, context);
653 inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* context, int timerId)
655 FAST_RETURN_IF_NO_FRONTENDS(void());
656 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
657 didRemoveTimerImpl(*instrumentingAgents, timerId, context);
660 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
662 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
663 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
664 return willCallFunctionImpl(*instrumentingAgents, scriptName, scriptLine, context);
665 return InspectorInstrumentationCookie();
669 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie, ScriptExecutionContext* context)
671 FAST_RETURN_IF_NO_FRONTENDS(void());
672 if (cookie.isValid())
673 didCallFunctionImpl(cookie, context);
676 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest& request)
678 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
679 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
680 return willDispatchXHRReadyStateChangeEventImpl(*instrumentingAgents, request, context);
681 return InspectorInstrumentationCookie();
684 inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
686 FAST_RETURN_IF_NO_FRONTENDS(void());
687 if (cookie.isValid())
688 didDispatchXHRReadyStateChangeEventImpl(cookie);
691 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document& document, const Event& event, bool hasEventListeners)
693 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
694 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
695 return willDispatchEventImpl(*instrumentingAgents, document, event, hasEventListeners);
696 return InspectorInstrumentationCookie();
699 inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie)
701 FAST_RETURN_IF_NO_FRONTENDS(void());
702 if (cookie.isValid())
703 didDispatchEventImpl(cookie);
706 inline InspectorInstrumentationCookie InspectorInstrumentation::willHandleEvent(ScriptExecutionContext* context, const Event& event)
708 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
709 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
710 return willHandleEventImpl(*instrumentingAgents, event);
711 return InspectorInstrumentationCookie();
714 inline void InspectorInstrumentation::didHandleEvent(const InspectorInstrumentationCookie& cookie)
716 FAST_RETURN_IF_NO_FRONTENDS(void());
717 if (cookie.isValid())
718 didHandleEventImpl(cookie);
721 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindow(Frame* frame, const Event& event, DOMWindow& window)
723 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
724 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
725 return willDispatchEventOnWindowImpl(*instrumentingAgents, event, window);
726 return InspectorInstrumentationCookie();
729 inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie)
731 FAST_RETURN_IF_NO_FRONTENDS(void());
732 if (cookie.isValid())
733 didDispatchEventOnWindowImpl(cookie);
736 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame& frame, const String& url, int lineNumber)
738 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
739 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
740 return willEvaluateScriptImpl(*instrumentingAgents, frame, url, lineNumber);
741 return InspectorInstrumentationCookie();
744 inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie, Frame& frame)
746 FAST_RETURN_IF_NO_FRONTENDS(void());
747 if (cookie.isValid())
748 didEvaluateScriptImpl(cookie, frame);
751 inline void InspectorInstrumentation::scriptsEnabled(Page& page, bool isEnabled)
753 FAST_RETURN_IF_NO_FRONTENDS(void());
754 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
755 return scriptsEnabledImpl(*instrumentingAgents, isEnabled);
758 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext* context, int timerId)
760 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
761 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
762 return willFireTimerImpl(*instrumentingAgents, timerId, context);
763 return InspectorInstrumentationCookie();
766 inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentationCookie& cookie)
768 FAST_RETURN_IF_NO_FRONTENDS(void());
769 if (cookie.isValid())
770 didFireTimerImpl(cookie);
773 inline void InspectorInstrumentation::didInvalidateLayout(Frame& frame)
775 FAST_RETURN_IF_NO_FRONTENDS(void());
776 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
777 didInvalidateLayoutImpl(*instrumentingAgents, frame);
780 inline InspectorInstrumentationCookie InspectorInstrumentation::willLayout(Frame& frame)
782 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
783 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
784 return willLayoutImpl(*instrumentingAgents, frame);
785 return InspectorInstrumentationCookie();
788 inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root)
790 FAST_RETURN_IF_NO_FRONTENDS(void());
791 if (cookie.isValid())
792 didLayoutImpl(cookie, root);
795 inline void InspectorInstrumentation::didScroll(Page& page)
797 FAST_RETURN_IF_NO_FRONTENDS(void());
798 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
799 didScrollImpl(*instrumentingAgents);
802 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest& request)
804 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
805 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
806 return willDispatchXHRLoadEventImpl(*instrumentingAgents, request, context);
807 return InspectorInstrumentationCookie();
810 inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
812 FAST_RETURN_IF_NO_FRONTENDS(void());
813 if (cookie.isValid())
814 didDispatchXHRLoadEventImpl(cookie);
817 inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
819 FAST_RETURN_IF_NO_FRONTENDS(void());
820 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
821 return willPaintImpl(*instrumentingAgents, renderer);
824 inline void InspectorInstrumentation::didPaint(RenderObject* renderer, const LayoutRect& rect)
826 FAST_RETURN_IF_NO_FRONTENDS(void());
827 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
828 didPaintImpl(*instrumentingAgents, renderer, rect);
831 inline void InspectorInstrumentation::willScrollLayer(Frame& frame)
833 FAST_RETURN_IF_NO_FRONTENDS(void());
834 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
835 willScrollLayerImpl(*instrumentingAgents, frame);
838 inline void InspectorInstrumentation::didScrollLayer(Frame& frame)
840 FAST_RETURN_IF_NO_FRONTENDS(void());
841 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
842 didScrollLayerImpl(*instrumentingAgents);
845 inline InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyle(Document& document)
847 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
848 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
849 return willRecalculateStyleImpl(*instrumentingAgents, document);
850 return InspectorInstrumentationCookie();
853 inline void InspectorInstrumentation::didRecalculateStyle(const InspectorInstrumentationCookie& cookie)
855 FAST_RETURN_IF_NO_FRONTENDS(void());
856 if (cookie.isValid())
857 didRecalculateStyleImpl(cookie);
860 inline void InspectorInstrumentation::didScheduleStyleRecalculation(Document& document)
862 FAST_RETURN_IF_NO_FRONTENDS(void());
863 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
864 didScheduleStyleRecalculationImpl(*instrumentingAgents, document);
867 inline void InspectorInstrumentation::applyEmulatedMedia(Frame& frame, String& media)
869 FAST_RETURN_IF_NO_FRONTENDS(void());
870 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
871 applyEmulatedMediaImpl(*instrumentingAgents, media);
874 inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
876 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
877 willSendRequestImpl(*instrumentingAgents, identifier, loader, request, redirectResponse);
880 inline void InspectorInstrumentation::continueAfterPingLoader(Frame& frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)
882 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
883 InspectorInstrumentation::continueAfterPingLoaderImpl(*instrumentingAgents, identifier, loader, request, response);
886 inline void InspectorInstrumentation::markResourceAsCached(Page& page, unsigned long identifier)
888 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
889 markResourceAsCachedImpl(*instrumentingAgents, identifier);
892 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page& page, DocumentLoader* loader, CachedResource* resource)
894 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
895 didLoadResourceFromMemoryCacheImpl(*instrumentingAgents, loader, resource);
898 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame)
900 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
901 return willReceiveResourceResponseImpl(*instrumentingAgents);
902 return InspectorInstrumentationCookie();
905 inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
907 // Call this unconditionally so that we're able to log to console with no front-end attached.
908 if (cookie.isValid())
909 didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
912 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
914 FAST_RETURN_IF_NO_FRONTENDS(void());
915 InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
918 inline void InspectorInstrumentation::continueWithPolicyDownload(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
920 FAST_RETURN_IF_NO_FRONTENDS(void());
921 InspectorInstrumentation::continueWithPolicyDownloadImpl(frame, loader, identifier, r);
924 inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame* frame, DocumentLoader& loader, unsigned long identifier, const ResourceResponse& r)
926 FAST_RETURN_IF_NO_FRONTENDS(void());
927 InspectorInstrumentation::continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
930 inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
932 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
933 didReceiveDataImpl(*instrumentingAgents, identifier, data, dataLength, encodedDataLength);
936 inline void InspectorInstrumentation::didFinishLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, double finishTime)
938 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
939 didFinishLoadingImpl(*instrumentingAgents, identifier, loader, finishTime);
942 inline void InspectorInstrumentation::didFailLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceError& error)
944 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
945 didFailLoadingImpl(*instrumentingAgents, identifier, loader, error);
948 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
950 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
951 didFinishXHRLoadingImpl(*instrumentingAgents, client, identifier, sourceString, url, sendURL, sendLineNumber, sendColumnNumber);
954 inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier)
956 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
957 didReceiveXHRResponseImpl(*instrumentingAgents, identifier);
960 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
962 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
963 willLoadXHRSynchronouslyImpl(*instrumentingAgents);
966 inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context)
968 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
969 didLoadXHRSynchronouslyImpl(*instrumentingAgents);
972 inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
974 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
975 scriptImportedImpl(*instrumentingAgents, identifier, sourceString);
978 inline void InspectorInstrumentation::scriptExecutionBlockedByCSP(ScriptExecutionContext* context, const String& directiveText)
980 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
981 scriptExecutionBlockedByCSPImpl(*instrumentingAgents, directiveText);
984 inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
986 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
987 didReceiveScriptResponseImpl(*instrumentingAgents, identifier);
990 inline void InspectorInstrumentation::domContentLoadedEventFired(Frame& frame)
992 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
993 domContentLoadedEventFiredImpl(*instrumentingAgents, frame);
996 inline void InspectorInstrumentation::loadEventFired(Frame* frame)
998 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
999 loadEventFiredImpl(*instrumentingAgents, frame);
1002 inline void InspectorInstrumentation::frameDetachedFromParent(Frame& frame)
1004 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1005 frameDetachedFromParentImpl(*instrumentingAgents, frame);
1008 inline void InspectorInstrumentation::didCommitLoad(Frame& frame, DocumentLoader* loader)
1010 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1011 didCommitLoadImpl(*instrumentingAgents, frame.page(), loader);
1014 inline void InspectorInstrumentation::frameDocumentUpdated(Frame* frame)
1016 FAST_RETURN_IF_NO_FRONTENDS(void());
1017 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1018 frameDocumentUpdatedImpl(*instrumentingAgents, frame);
1021 inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame& frame, DocumentLoader& loader)
1023 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1024 loaderDetachedFromFrameImpl(*instrumentingAgents, loader);
1027 inline void InspectorInstrumentation::frameStartedLoading(Frame& frame)
1029 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1030 frameStartedLoadingImpl(*instrumentingAgents, frame);
1033 inline void InspectorInstrumentation::frameStoppedLoading(Frame& frame)
1035 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1036 frameStoppedLoadingImpl(*instrumentingAgents, frame);
1039 inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, double delay)
1041 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1042 frameScheduledNavigationImpl(*instrumentingAgents, frame, delay);
1045 inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame)
1047 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1048 frameClearedScheduledNavigationImpl(*instrumentingAgents, frame);
1051 inline InspectorInstrumentationCookie InspectorInstrumentation::willRunJavaScriptDialog(Page& page, const String& message)
1053 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1054 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1055 return willRunJavaScriptDialogImpl(*instrumentingAgents, message);
1056 return InspectorInstrumentationCookie();
1059 inline void InspectorInstrumentation::didRunJavaScriptDialog(const InspectorInstrumentationCookie& cookie)
1061 FAST_RETURN_IF_NO_FRONTENDS(void());
1062 if (cookie.isValid())
1063 didRunJavaScriptDialogImpl(cookie);
1066 inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource& cachedResource)
1068 FAST_RETURN_IF_NO_FRONTENDS(void());
1069 willDestroyCachedResourceImpl(cachedResource);
1072 inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned startLine)
1074 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1075 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1076 return willWriteHTMLImpl(*instrumentingAgents, startLine, document->frame());
1077 return InspectorInstrumentationCookie();
1080 inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned endLine)
1082 FAST_RETURN_IF_NO_FRONTENDS(void());
1083 if (cookie.isValid())
1084 didWriteHTMLImpl(cookie, endLine);
1087 inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
1089 FAST_RETURN_IF_NO_FRONTENDS(void());
1090 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1091 didDispatchDOMStorageEventImpl(*instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
1094 inline bool InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext* context)
1096 FAST_RETURN_IF_NO_FRONTENDS(false);
1097 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1098 return shouldPauseDedicatedWorkerOnStartImpl(*instrumentingAgents);
1102 inline void InspectorInstrumentation::didStartWorkerGlobalScope(ScriptExecutionContext* context, WorkerGlobalScopeProxy* proxy, const URL& url)
1104 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1105 didStartWorkerGlobalScopeImpl(*instrumentingAgents, proxy, url);
1108 inline void InspectorInstrumentation::workerGlobalScopeTerminated(ScriptExecutionContext* context, WorkerGlobalScopeProxy* proxy)
1110 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1111 workerGlobalScopeTerminatedImpl(*instrumentingAgents, proxy);
1114 #if ENABLE(WEB_SOCKETS)
1115 inline void InspectorInstrumentation::didCreateWebSocket(Document* document, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol)
1117 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1118 didCreateWebSocketImpl(*instrumentingAgents, identifier, requestURL, documentURL, protocol, document);
1121 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const ResourceRequest& request)
1123 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1124 willSendWebSocketHandshakeRequestImpl(*instrumentingAgents, identifier, request, document);
1127 inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(Document* document, unsigned long identifier, const ResourceResponse& response)
1129 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1130 didReceiveWebSocketHandshakeResponseImpl(*instrumentingAgents, identifier, response, document);
1133 inline void InspectorInstrumentation::didCloseWebSocket(Document* document, unsigned long identifier)
1135 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1136 didCloseWebSocketImpl(*instrumentingAgents, identifier, document);
1139 inline void InspectorInstrumentation::didReceiveWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1141 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1142 didReceiveWebSocketFrameImpl(*instrumentingAgents, identifier, frame);
1145 inline void InspectorInstrumentation::didReceiveWebSocketFrameError(Document* document, unsigned long identifier, const String& errorMessage)
1147 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1148 didReceiveWebSocketFrameErrorImpl(*instrumentingAgents, identifier, errorMessage);
1151 inline void InspectorInstrumentation::didSendWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1153 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1154 didSendWebSocketFrameImpl(*instrumentingAgents, identifier, frame);
1156 #endif // ENABLE(WEB_SOCKETS)
1158 #if ENABLE(WEB_REPLAY)
1159 inline void InspectorInstrumentation::sessionCreated(Page& page, RefPtr<ReplaySession>&& session)
1161 FAST_RETURN_IF_NO_FRONTENDS(void());
1162 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1163 sessionCreatedImpl(*instrumentingAgents, WTF::move(session));
1166 inline void InspectorInstrumentation::sessionLoaded(Page& page, RefPtr<ReplaySession>&& session)
1168 FAST_RETURN_IF_NO_FRONTENDS(void());
1169 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1170 sessionLoadedImpl(*instrumentingAgents, WTF::move(session));
1173 inline void InspectorInstrumentation::sessionModified(Page& page, RefPtr<ReplaySession>&& session)
1175 FAST_RETURN_IF_NO_FRONTENDS(void());
1176 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1177 sessionModifiedImpl(*instrumentingAgents, WTF::move(session));
1180 inline void InspectorInstrumentation::segmentCreated(Page& page, RefPtr<ReplaySessionSegment>&& segment)
1182 FAST_RETURN_IF_NO_FRONTENDS(void());
1183 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1184 segmentCreatedImpl(*instrumentingAgents, WTF::move(segment));
1187 inline void InspectorInstrumentation::segmentCompleted(Page& page, RefPtr<ReplaySessionSegment>&& segment)
1189 FAST_RETURN_IF_NO_FRONTENDS(void());
1190 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1191 segmentCompletedImpl(*instrumentingAgents, WTF::move(segment));
1194 inline void InspectorInstrumentation::segmentLoaded(Page& page, RefPtr<ReplaySessionSegment>&& segment)
1196 FAST_RETURN_IF_NO_FRONTENDS(void());
1197 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1198 segmentLoadedImpl(*instrumentingAgents, WTF::move(segment));
1201 inline void InspectorInstrumentation::segmentUnloaded(Page& page)
1203 FAST_RETURN_IF_NO_FRONTENDS(void());
1204 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1205 segmentUnloadedImpl(*instrumentingAgents);
1208 inline void InspectorInstrumentation::captureStarted(Page& page)
1210 FAST_RETURN_IF_NO_FRONTENDS(void());
1211 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1212 captureStartedImpl(*instrumentingAgents);
1215 inline void InspectorInstrumentation::captureStopped(Page& page)
1217 FAST_RETURN_IF_NO_FRONTENDS(void());
1218 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1219 captureStoppedImpl(*instrumentingAgents);
1222 inline void InspectorInstrumentation::playbackStarted(Page& page)
1224 FAST_RETURN_IF_NO_FRONTENDS(void());
1225 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1226 playbackStartedImpl(*instrumentingAgents);
1229 inline void InspectorInstrumentation::playbackPaused(Page& page, const ReplayPosition& position)
1231 FAST_RETURN_IF_NO_FRONTENDS(void());
1232 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1233 playbackPausedImpl(*instrumentingAgents, position);
1236 inline void InspectorInstrumentation::playbackFinished(Page& page)
1238 FAST_RETURN_IF_NO_FRONTENDS(void());
1239 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1240 playbackFinishedImpl(*instrumentingAgents);
1243 inline void InspectorInstrumentation::playbackHitPosition(Page& page, const ReplayPosition& position)
1245 FAST_RETURN_IF_NO_FRONTENDS(void());
1246 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1247 playbackHitPositionImpl(*instrumentingAgents, position);
1249 #endif // ENABLE(WEB_REPLAY)
1251 inline void InspectorInstrumentation::networkStateChanged(Page* page)
1253 FAST_RETURN_IF_NO_FRONTENDS(void());
1254 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1255 networkStateChangedImpl(*instrumentingAgents);
1258 inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
1260 FAST_RETURN_IF_NO_FRONTENDS(void());
1261 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1262 updateApplicationCacheStatusImpl(*instrumentingAgents, frame);
1265 inline void InspectorInstrumentation::didRequestAnimationFrame(Document* document, int callbackId)
1267 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1268 didRequestAnimationFrameImpl(*instrumentingAgents, callbackId, document->frame());
1271 inline void InspectorInstrumentation::didCancelAnimationFrame(Document* document, int callbackId)
1273 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1274 didCancelAnimationFrameImpl(*instrumentingAgents, callbackId, document->frame());
1277 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimationFrame(Document* document, int callbackId)
1279 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1280 return willFireAnimationFrameImpl(*instrumentingAgents, callbackId, document->frame());
1281 return InspectorInstrumentationCookie();
1284 inline void InspectorInstrumentation::didFireAnimationFrame(const InspectorInstrumentationCookie& cookie)
1286 FAST_RETURN_IF_NO_FRONTENDS(void());
1287 if (cookie.isValid())
1288 didFireAnimationFrameImpl(cookie);
1291 inline void InspectorInstrumentation::layerTreeDidChange(Page* page)
1293 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1294 layerTreeDidChangeImpl(*instrumentingAgents);
1297 inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const RenderLayer& renderLayer)
1299 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1300 renderLayerDestroyedImpl(*instrumentingAgents, renderLayer);
1303 inline void InspectorInstrumentation::pseudoElementDestroyed(Page* page, PseudoElement& pseudoElement)
1305 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1306 pseudoElementDestroyedImpl(*instrumentingAgents, pseudoElement);
1309 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForContext(ScriptExecutionContext* context)
1313 if (is<Document>(*context))
1314 return instrumentingAgentsForPage(downcast<Document>(context)->page());
1315 return instrumentingAgentsForNonDocumentContext(context);
1318 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForFrame(Frame* frame)
1320 return frame ? instrumentingAgentsForFrame(*frame) : nullptr;
1323 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForFrame(Frame& frame)
1325 return instrumentingAgentsForPage(frame.page());
1328 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForDocument(Document* document)
1330 return document ? instrumentingAgentsForDocument(*document) : nullptr;
1333 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForDocument(Document& document)
1335 Page* page = document.page();
1336 #if ENABLE(TEMPLATE_ELEMENT)
1337 if (!page && document.templateDocumentHost())
1338 page = document.templateDocumentHost()->page();
1340 return instrumentingAgentsForPage(page);
1343 } // namespace WebCore
1345 #endif // !defined(InspectorInstrumentation_h)