e24588d53a8985aed3d468104d26b5bbfd375cbf
[WebKit-https.git] / Source / WebCore / inspector / InspectorInstrumentation.h
1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 *     * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *     * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 *     * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29 */
30
31 #ifndef InspectorInstrumentation_h
32 #define InspectorInstrumentation_h
33
34 #include "CSSSelector.h"
35 #include "ConsoleAPITypes.h"
36 #include "ConsoleTypes.h"
37 #include "Element.h"
38 #include "FormData.h"
39 #include "Frame.h"
40 #include "HitTestResult.h"
41 #include "InspectorInstrumentationCookie.h"
42 #include "Page.h"
43 #include "ScriptExecutionContext.h"
44 #include "ScriptState.h"
45 #include "StorageArea.h"
46 #include "WebSocketFrame.h"
47 #include <wtf/RefPtr.h>
48
49 namespace Deprecated {
50 class ScriptObject;
51 }
52
53 namespace WebCore {
54
55 class CSSRule;
56 class CachedResource;
57 class CharacterData;
58 class DOMWindow;
59 class DOMWrapperWorld;
60 class Database;
61 class Document;
62 class Element;
63 class DocumentLoader;
64 class DocumentStyleSheetCollection;
65 class GraphicsContext;
66 class HTTPHeaderMap;
67 class InspectorCSSAgent;
68 class InspectorCSSOMWrappers;
69 class InspectorInstrumentation;
70 class InspectorTimelineAgent;
71 class InstrumentingAgents;
72 class URL;
73 class Node;
74 class PseudoElement;
75 class RenderLayer;
76 class RenderLayerBacking;
77 class RenderObject;
78 class ResourceRequest;
79 class ResourceResponse;
80 class ScriptArguments;
81 class ScriptCallStack;
82 class ScriptExecutionContext;
83 class ScriptProfile;
84 class SecurityOrigin;
85 class ShadowRoot;
86 class StorageArea;
87 class StyleResolver;
88 class StyleRule;
89 class ThreadableLoaderClient;
90 class WorkerGlobalScope;
91 class WorkerGlobalScopeProxy;
92 class XMLHttpRequest;
93
94 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (LIKELY(!hasFrontends())) return value;
95
96 class InspectorInstrumentation {
97 public:
98     static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld&);
99     static bool isDebuggerPaused(Frame*);
100
101     static void willInsertDOMNode(Document*, Node* parent);
102     static void didInsertDOMNode(Document*, Node*);
103     static void willRemoveDOMNode(Document*, Node*);
104     static void didRemoveDOMNode(Document*, Node*);
105     static void willModifyDOMAttr(Document*, Element*, const AtomicString& oldValue, const AtomicString& newValue);
106     static void didModifyDOMAttr(Document*, Element*, const AtomicString& name, const AtomicString& value);
107     static void didRemoveDOMAttr(Document*, Element*, const AtomicString& name);
108     static void characterDataModified(Document*, CharacterData*);
109     static void didInvalidateStyleAttr(Document*, Node*);
110     static void frameWindowDiscarded(Frame*, DOMWindow*);
111     static void mediaQueryResultChanged(Document*);
112     static void didPushShadowRoot(Element* host, ShadowRoot*);
113     static void willPopShadowRoot(Element* host, ShadowRoot*);
114     static void didCreateNamedFlow(Document*, WebKitNamedFlow*);
115     static void willRemoveNamedFlow(Document*, WebKitNamedFlow*);
116     static void didUpdateRegionLayout(Document*, WebKitNamedFlow*);
117     static void didChangeRegionOverset(Document*, WebKitNamedFlow*);
118     static void didRegisterNamedFlowContentElement(Document*, WebKitNamedFlow*, Node* contentElement, Node* nextContentElement = nullptr);
119     static void didUnregisterNamedFlowContentElement(Document*, WebKitNamedFlow*, Node* contentElement);
120
121     static void mouseDidMoveOverElement(Page*, const HitTestResult&, unsigned modifierFlags);
122     static bool handleMousePress(Page*);
123     static bool handleTouchEvent(Page*, Node*);
124     static bool forcePseudoState(Element*, CSSSelector::PseudoType);
125
126     static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
127     static void didScheduleResourceRequest(Document*, const String& url);
128     static void didInstallTimer(ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
129     static void didRemoveTimer(ScriptExecutionContext*, int timerId);
130
131     static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
132     static void didCallFunction(const InspectorInstrumentationCookie&);
133     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*);
134     static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
135     static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event&, bool hasEventListeners);
136     static void didDispatchEvent(const InspectorInstrumentationCookie&);
137     static InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext*, Event*);
138     static void didHandleEvent(const InspectorInstrumentationCookie&);
139     static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event& event, DOMWindow* window);
140     static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
141     static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber);
142     static void didEvaluateScript(const InspectorInstrumentationCookie&);
143     static void scriptsEnabled(Page*, bool isEnabled);
144     static void didCreateIsolatedContext(Frame*, JSC::ExecState*, SecurityOrigin*);
145     static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
146     static void didFireTimer(const InspectorInstrumentationCookie&);
147     static void didInvalidateLayout(Frame*);
148     static InspectorInstrumentationCookie willLayout(Frame*);
149     static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
150     static void didScroll(Page*);
151     static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*);
152     static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
153     static void willScrollLayer(Frame*);
154     static void didScrollLayer(Frame*);
155     static void willPaint(RenderObject*);
156     static void didPaint(RenderObject*, GraphicsContext*, const LayoutRect&);
157     static void willComposite(Page*);
158     static void didComposite(Page*);
159     static InspectorInstrumentationCookie willRecalculateStyle(Document*);
160     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
161     static void didScheduleStyleRecalculation(Document*);
162
163     static void applyEmulatedMedia(Frame*, String*);
164     static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
165     static void continueAfterPingLoader(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
166     static void markResourceAsCached(Page*, unsigned long identifier);
167     static void didLoadResourceFromMemoryCache(Page*, DocumentLoader*, CachedResource*);
168     static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier, int length);
169     static void didReceiveResourceData(const InspectorInstrumentationCookie&);
170     static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse&);
171     static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
172     static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
173     static void continueWithPolicyDownload(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
174     static void continueWithPolicyIgnore(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
175     static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
176     static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
177     static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
178     static void documentThreadableLoaderStartedLoadingForClient(ScriptExecutionContext*, unsigned long identifier, ThreadableLoaderClient*);
179     static void willLoadXHR(ScriptExecutionContext*, ThreadableLoaderClient*, const String&, const URL&, bool, PassRefPtr<FormData>, const HTTPHeaderMap&, bool);
180     static void didFailXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*);
181     static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
182     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
183     static void willLoadXHRSynchronously(ScriptExecutionContext*);
184     static void didLoadXHRSynchronously(ScriptExecutionContext*);
185     static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
186     static void scriptExecutionBlockedByCSP(ScriptExecutionContext*, const String& directiveText);
187     static void didReceiveScriptResponse(ScriptExecutionContext*, unsigned long identifier);
188     static void domContentLoadedEventFired(Frame*);
189     static void loadEventFired(Frame*);
190     static void frameDetachedFromParent(Frame*);
191     static void didCommitLoad(Frame*, DocumentLoader*);
192     static void frameDocumentUpdated(Frame*);
193     static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
194     static void frameStartedLoading(Frame&);
195     static void frameStoppedLoading(Frame&);
196     static void frameScheduledNavigation(Frame&, double delay);
197     static void frameClearedScheduledNavigation(Frame&);
198     static InspectorInstrumentationCookie willRunJavaScriptDialog(Page*, const String& message);
199     static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
200     static void willDestroyCachedResource(CachedResource*);
201
202     static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned startLine);
203     static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned endLine);
204
205     // FIXME: Remove once we no longer generate stacks outside of Inspector.
206     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
207     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, JSC::ExecState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier = 0);
208     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
209
210     // FIXME: Convert to ScriptArguments to match non-worker context.
211     static void addMessageToConsole(WorkerGlobalScope*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
212     static void addMessageToConsole(WorkerGlobalScope*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState* = nullptr, unsigned long requestIdentifier = 0);
213
214     static void consoleCount(Page*, JSC::ExecState*, PassRefPtr<ScriptArguments>);
215     static void startConsoleTiming(Frame*, const String& title);
216     static void stopConsoleTiming(Frame*, const String& title, PassRefPtr<ScriptCallStack>);
217     static void consoleTimeStamp(Frame*, PassRefPtr<ScriptArguments>);
218
219     static void didRequestAnimationFrame(Document*, int callbackId);
220     static void didCancelAnimationFrame(Document*, int callbackId);
221     static InspectorInstrumentationCookie willFireAnimationFrame(Document*, int callbackId);
222     static void didFireAnimationFrame(const InspectorInstrumentationCookie&);
223
224 #if ENABLE(JAVASCRIPT_DEBUGGER)
225     static void addStartProfilingMessageToConsole(Page*, const String& title, unsigned lineNumber, unsigned columnNumber, const String& sourceURL);
226     static void addProfile(Page*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
227     static String getCurrentUserInitiatedProfileName(Page*, bool incrementProfileNumber);
228     static bool profilerEnabled(Page*);
229 #endif
230
231 #if ENABLE(SQL_DATABASE)
232     static void didOpenDatabase(ScriptExecutionContext*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
233 #endif
234
235     static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
236
237     static bool shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext*);
238     static void didStartWorkerGlobalScope(ScriptExecutionContext*, WorkerGlobalScopeProxy*, const URL&);
239     static void workerGlobalScopeTerminated(ScriptExecutionContext*, WorkerGlobalScopeProxy*);
240     static void willEvaluateWorkerScript(WorkerGlobalScope*, int workerThreadStartMode);
241
242 #if ENABLE(WEB_SOCKETS)
243     static void didCreateWebSocket(Document*, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol);
244     static void willSendWebSocketHandshakeRequest(Document*, unsigned long identifier, const ResourceRequest&);
245     static void didReceiveWebSocketHandshakeResponse(Document*, unsigned long identifier, const ResourceResponse&);
246     static void didCloseWebSocket(Document*, unsigned long identifier);
247     static void didReceiveWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
248     static void didSendWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
249     static void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
250 #endif
251
252     static Deprecated::ScriptObject wrapCanvas2DRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
253 #if ENABLE(WEBGL)
254     static Deprecated::ScriptObject wrapWebGLRenderingContextForInstrumentation(Document*, const Deprecated::ScriptObject&);
255 #endif
256
257     static void networkStateChanged(Page*);
258     static void updateApplicationCacheStatus(Frame*);
259
260 #if ENABLE(INSPECTOR)
261     static void frontendCreated() { s_frontendCounter += 1; }
262     static void frontendDeleted() { s_frontendCounter -= 1; }
263     static bool hasFrontends() { return s_frontendCounter; }
264     static bool canvasAgentEnabled(ScriptExecutionContext*);
265     static bool consoleAgentEnabled(ScriptExecutionContext*);
266     static bool timelineAgentEnabled(ScriptExecutionContext*);
267 #else
268     static bool hasFrontends() { return false; }
269     static bool canvasAgentEnabled(ScriptExecutionContext*) { return false; }
270     static bool consoleAgentEnabled(ScriptExecutionContext*) { return false; }
271     static bool runtimeAgentEnabled(Frame*) { return false; }
272     static bool timelineAgentEnabled(ScriptExecutionContext*) { return false; }
273 #endif
274
275     static void registerInstrumentingAgents(InstrumentingAgents*);
276     static void unregisterInstrumentingAgents(InstrumentingAgents*);
277
278 #if USE(ACCELERATED_COMPOSITING)
279     static void layerTreeDidChange(Page*);
280     static void renderLayerDestroyed(Page*, const RenderLayer*);
281     static void pseudoElementDestroyed(Page*, PseudoElement*);
282 #endif
283
284 private:
285 #if ENABLE(INSPECTOR)
286     static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld&);
287     static bool isDebuggerPausedImpl(InstrumentingAgents*);
288
289     static void willInsertDOMNodeImpl(InstrumentingAgents*, Node* parent);
290     static void didInsertDOMNodeImpl(InstrumentingAgents*, Node*);
291     static void willRemoveDOMNodeImpl(InstrumentingAgents*, Node*);
292     static void didRemoveDOMNodeImpl(InstrumentingAgents*, Node*);
293     static void willModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& oldValue, const AtomicString& newValue);
294     static void didModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name, const AtomicString& value);
295     static void didRemoveDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name);
296     static void characterDataModifiedImpl(InstrumentingAgents*, CharacterData*);
297     static void didInvalidateStyleAttrImpl(InstrumentingAgents*, Node*);
298     static void frameWindowDiscardedImpl(InstrumentingAgents*, DOMWindow*);
299     static void mediaQueryResultChangedImpl(InstrumentingAgents*);
300     static void didPushShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
301     static void willPopShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
302     static void didCreateNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
303     static void willRemoveNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
304     static void didUpdateRegionLayoutImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
305     static void didChangeRegionOversetImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
306     static void didRegisterNamedFlowContentElementImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*, Node* contentElement, Node* nextContentElement = nullptr);
307     static void didUnregisterNamedFlowContentElementImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*, Node* contentElement);
308
309     static void mouseDidMoveOverElementImpl(InstrumentingAgents*, const HitTestResult&, unsigned modifierFlags);
310     static bool handleTouchEventImpl(InstrumentingAgents*, Node*);
311     static bool handleMousePressImpl(InstrumentingAgents*);
312     static bool forcePseudoStateImpl(InstrumentingAgents*, Element*, CSSSelector::PseudoType);
313
314     static void willSendXMLHttpRequestImpl(InstrumentingAgents*, const String& url);
315     static void didScheduleResourceRequestImpl(InstrumentingAgents*, const String& url, Frame*);
316     static void didInstallTimerImpl(InstrumentingAgents*, int timerId, int timeout, bool singleShot, ScriptExecutionContext*);
317     static void didRemoveTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*);
318
319     static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*);
320     static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
321     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
322     static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
323     static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, bool hasEventListeners, Document*);
324     static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
325     static void didHandleEventImpl(const InspectorInstrumentationCookie&);
326     static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
327     static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents*, const Event&, DOMWindow*);
328     static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
329     static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, const String& url, int lineNumber, Frame*);
330     static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&);
331     static void scriptsEnabledImpl(InstrumentingAgents*, bool isEnabled);
332     static void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, JSC::ExecState*, SecurityOrigin*);
333     static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*);
334     static void didFireTimerImpl(const InspectorInstrumentationCookie&);
335     static void didInvalidateLayoutImpl(InstrumentingAgents*, Frame*);
336     static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*);
337     static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
338     static void didScrollImpl(InstrumentingAgents*);
339     static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
340     static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
341     static void willScrollLayerImpl(InstrumentingAgents*, Frame*);
342     static void didScrollLayerImpl(InstrumentingAgents*);
343     static void willPaintImpl(InstrumentingAgents*, RenderObject*);
344     static void didPaintImpl(InstrumentingAgents*, RenderObject*, GraphicsContext*, const LayoutRect&);
345     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Frame*);
346     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
347     static void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
348
349     static void applyEmulatedMediaImpl(InstrumentingAgents*, String*);
350     static void willSendRequestImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
351     static void continueAfterPingLoaderImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
352     static void markResourceAsCachedImpl(InstrumentingAgents*, unsigned long identifier);
353     static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents*, DocumentLoader*, CachedResource*);
354     static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, unsigned long identifier, Frame*, int length);
355     static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
356     static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents*, unsigned long identifier, const ResourceResponse&, Frame*);
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 documentThreadableLoaderStartedLoadingForClientImpl(InstrumentingAgents*, unsigned long identifier, ThreadableLoaderClient*);
366     static void willLoadXHRImpl(InstrumentingAgents*, ThreadableLoaderClient*, const String&, const URL&, bool, PassRefPtr<FormData>, const HTTPHeaderMap&, bool);
367     static void didFailXHRLoadingImpl(InstrumentingAgents*, ThreadableLoaderClient*);
368     static void didFinishXHRLoadingImpl(InstrumentingAgents*, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
369     static void didReceiveXHRResponseImpl(InstrumentingAgents*, unsigned long identifier);
370     static void willLoadXHRSynchronouslyImpl(InstrumentingAgents*);
371     static void didLoadXHRSynchronouslyImpl(InstrumentingAgents*);
372     static void scriptImportedImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString);
373     static void scriptExecutionBlockedByCSPImpl(InstrumentingAgents*, const String& directiveText);
374     static void didReceiveScriptResponseImpl(InstrumentingAgents*, unsigned long identifier);
375     static void domContentLoadedEventFiredImpl(InstrumentingAgents*, Frame*);
376     static void loadEventFiredImpl(InstrumentingAgents*, Frame*);
377     static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
378     static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
379     static void frameDocumentUpdatedImpl(InstrumentingAgents*, Frame*);
380     static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
381     static void frameStartedLoadingImpl(InstrumentingAgents&, Frame&);
382     static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
383     static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, double delay);
384     static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&);
385     static InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents*, const String& message);
386     static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
387     static void willDestroyCachedResourceImpl(CachedResource*);
388
389     static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned startLine, Frame*);
390     static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned endLine);
391
392     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, JSC::ExecState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier);
393     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptID, unsigned lineNumber, unsigned columnNumber, JSC::ExecState*, unsigned long requestIdentifier);
394
395     // FIXME: Remove once we no longer generate stacks outside of Inspector.
396     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier);
397
398     static void consoleCountImpl(InstrumentingAgents*, JSC::ExecState*, PassRefPtr<ScriptArguments>);
399     static void startConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title);
400     static void stopConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title, PassRefPtr<ScriptCallStack>);
401     static void consoleTimeStampImpl(InstrumentingAgents*, Frame*, PassRefPtr<ScriptArguments>);
402
403     static void didRequestAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
404     static void didCancelAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
405     static InspectorInstrumentationCookie willFireAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
406     static void didFireAnimationFrameImpl(const InspectorInstrumentationCookie&);
407
408 #if ENABLE(JAVASCRIPT_DEBUGGER)
409     static void addStartProfilingMessageToConsoleImpl(InstrumentingAgents*, const String& title, unsigned lineNumber, unsigned columnNumber, const String& sourceURL);
410     static void addProfileImpl(InstrumentingAgents*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
411     static String getCurrentUserInitiatedProfileNameImpl(InstrumentingAgents*, bool incrementProfileNumber);
412     static bool profilerEnabledImpl(InstrumentingAgents*);
413 #endif
414
415 #if ENABLE(SQL_DATABASE)
416     static void didOpenDatabaseImpl(InstrumentingAgents*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
417 #endif
418
419     static void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
420
421     static bool shouldPauseDedicatedWorkerOnStartImpl(InstrumentingAgents*);
422     static void didStartWorkerGlobalScopeImpl(InstrumentingAgents*, WorkerGlobalScopeProxy*, const URL&);
423     static void workerGlobalScopeTerminatedImpl(InstrumentingAgents*, WorkerGlobalScopeProxy*);
424
425 #if ENABLE(WEB_SOCKETS)
426     static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol, Document*);
427     static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const ResourceRequest&, Document*);
428     static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const ResourceResponse&, Document*);
429     static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier, Document*);
430     static void didReceiveWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
431     static void didSendWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
432     static void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents*, unsigned long identifier, const String&);
433 #endif
434
435     static void networkStateChangedImpl(InstrumentingAgents*);
436     static void updateApplicationCacheStatusImpl(InstrumentingAgents*, Frame*);
437
438     static InstrumentingAgents* instrumentingAgentsForPage(Page*);
439     static InstrumentingAgents* instrumentingAgentsForFrame(Frame*);
440     static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext*);
441     static InstrumentingAgents* instrumentingAgentsForDocument(Document*);
442     static InstrumentingAgents* instrumentingAgentsForRenderer(RenderObject*);
443
444     static InstrumentingAgents* instrumentingAgentsForWorkerGlobalScope(WorkerGlobalScope*);
445     static InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ScriptExecutionContext*);
446
447     static void pauseOnNativeEventIfNeeded(InstrumentingAgents*, bool isDOMEvent, const String& eventName, bool synchronous);
448     static void cancelPauseOnNativeEvent(InstrumentingAgents*);
449     static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
450
451 #if USE(ACCELERATED_COMPOSITING)
452     static void layerTreeDidChangeImpl(InstrumentingAgents*);
453     static void renderLayerDestroyedImpl(InstrumentingAgents*, const RenderLayer*);
454     static void pseudoElementDestroyedImpl(InstrumentingAgents*, PseudoElement*);
455 #endif
456
457     static int s_frontendCounter;
458 #endif
459 };
460
461 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld& world)
462 {
463 #if ENABLE(INSPECTOR)
464     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
465         didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world);
466 #else
467     UNUSED_PARAM(frame);
468     UNUSED_PARAM(world);
469 #endif
470 }
471
472 inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame)
473 {
474 #if ENABLE(INSPECTOR)
475     FAST_RETURN_IF_NO_FRONTENDS(false);
476     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
477         return isDebuggerPausedImpl(instrumentingAgents);
478 #else
479     UNUSED_PARAM(frame);
480 #endif
481     return false;
482 }
483
484 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node* parent)
485 {
486 #if ENABLE(INSPECTOR)
487     FAST_RETURN_IF_NO_FRONTENDS(void());
488     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
489         willInsertDOMNodeImpl(instrumentingAgents, parent);
490 #else
491     UNUSED_PARAM(document);
492     UNUSED_PARAM(parent);
493 #endif
494 }
495
496 inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node* node)
497 {
498 #if ENABLE(INSPECTOR)
499     FAST_RETURN_IF_NO_FRONTENDS(void());
500     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
501         didInsertDOMNodeImpl(instrumentingAgents, node);
502 #else
503     UNUSED_PARAM(document);
504     UNUSED_PARAM(node);
505 #endif
506 }
507
508 inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node* node)
509 {
510 #if ENABLE(INSPECTOR)
511     FAST_RETURN_IF_NO_FRONTENDS(void());
512     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
513         willRemoveDOMNodeImpl(instrumentingAgents, node);
514 #else
515     UNUSED_PARAM(document);
516     UNUSED_PARAM(node);
517 #endif
518 }
519
520 inline void InspectorInstrumentation::didRemoveDOMNode(Document* document, Node* node)
521 {
522 #if ENABLE(INSPECTOR)
523     FAST_RETURN_IF_NO_FRONTENDS(void());
524     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
525         didRemoveDOMNodeImpl(instrumentingAgents, node);
526 #else
527     UNUSED_PARAM(document);
528     UNUSED_PARAM(node);
529 #endif
530 }
531
532 inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Element* element, const AtomicString& oldValue, const AtomicString& newValue)
533 {
534 #if ENABLE(INSPECTOR)
535     FAST_RETURN_IF_NO_FRONTENDS(void());
536     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
537         willModifyDOMAttrImpl(instrumentingAgents, element, oldValue, newValue);
538 #else
539     UNUSED_PARAM(document);
540     UNUSED_PARAM(element);
541     UNUSED_PARAM(oldValue);
542     UNUSED_PARAM(newValue);
543 #endif
544 }
545
546 inline void InspectorInstrumentation::didModifyDOMAttr(Document* document, Element* element, const AtomicString& name, const AtomicString& value)
547 {
548 #if ENABLE(INSPECTOR)
549     FAST_RETURN_IF_NO_FRONTENDS(void());
550     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
551         didModifyDOMAttrImpl(instrumentingAgents, element, name, value);
552 #else
553     UNUSED_PARAM(document);
554     UNUSED_PARAM(element);
555     UNUSED_PARAM(name);
556     UNUSED_PARAM(value);
557 #endif
558 }
559
560 inline void InspectorInstrumentation::didRemoveDOMAttr(Document* document, Element* element, const AtomicString& name)
561 {
562 #if ENABLE(INSPECTOR)
563     FAST_RETURN_IF_NO_FRONTENDS(void());
564     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
565         didRemoveDOMAttrImpl(instrumentingAgents, element, name);
566 #else
567     UNUSED_PARAM(document);
568     UNUSED_PARAM(element);
569     UNUSED_PARAM(name);
570 #endif
571 }
572
573 inline void InspectorInstrumentation::didInvalidateStyleAttr(Document* document, Node* node)
574 {
575 #if ENABLE(INSPECTOR)
576     FAST_RETURN_IF_NO_FRONTENDS(void());
577     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
578         didInvalidateStyleAttrImpl(instrumentingAgents, node);
579 #else
580     UNUSED_PARAM(document);
581     UNUSED_PARAM(node);
582 #endif
583 }
584
585 inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
586 {
587 #if ENABLE(INSPECTOR)
588     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
589         frameWindowDiscardedImpl(instrumentingAgents, domWindow);
590 #else
591     UNUSED_PARAM(frame);
592     UNUSED_PARAM(domWindow);
593 #endif
594 }
595
596 inline void InspectorInstrumentation::mediaQueryResultChanged(Document* document)
597 {
598 #if ENABLE(INSPECTOR)
599     FAST_RETURN_IF_NO_FRONTENDS(void());
600     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
601         mediaQueryResultChangedImpl(instrumentingAgents);
602 #else
603     UNUSED_PARAM(document);
604 #endif
605 }
606
607 inline void InspectorInstrumentation::didPushShadowRoot(Element* host, ShadowRoot* root)
608 {
609 #if ENABLE(INSPECTOR)
610     FAST_RETURN_IF_NO_FRONTENDS(void());
611     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(&host->document()))
612         didPushShadowRootImpl(instrumentingAgents, host, root);
613 #else
614     UNUSED_PARAM(host);
615     UNUSED_PARAM(root);
616 #endif
617 }
618
619 inline void InspectorInstrumentation::willPopShadowRoot(Element* host, ShadowRoot* root)
620 {
621 #if ENABLE(INSPECTOR)
622     FAST_RETURN_IF_NO_FRONTENDS(void());
623     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(&host->document()))
624         willPopShadowRootImpl(instrumentingAgents, host, root);
625 #else
626     UNUSED_PARAM(host);
627     UNUSED_PARAM(root);
628 #endif
629 }
630
631 inline void InspectorInstrumentation::didCreateNamedFlow(Document* document, WebKitNamedFlow* namedFlow)
632 {
633 #if ENABLE(INSPECTOR)
634     FAST_RETURN_IF_NO_FRONTENDS(void());
635     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
636         didCreateNamedFlowImpl(instrumentingAgents, document, namedFlow);
637 #else
638     UNUSED_PARAM(document);
639     UNUSED_PARAM(namedFlow);
640 #endif
641 }
642
643 inline void InspectorInstrumentation::willRemoveNamedFlow(Document* document, WebKitNamedFlow* namedFlow)
644 {
645 #if ENABLE(INSPECTOR)
646     FAST_RETURN_IF_NO_FRONTENDS(void());
647     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
648         willRemoveNamedFlowImpl(instrumentingAgents, document, namedFlow);
649 #else
650     UNUSED_PARAM(document);
651     UNUSED_PARAM(namedFlow);
652 #endif
653 }
654
655 inline void InspectorInstrumentation::didUpdateRegionLayout(Document* document, WebKitNamedFlow* namedFlow)
656 {
657 #if ENABLE(INSPECTOR)
658     FAST_RETURN_IF_NO_FRONTENDS(void());
659     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
660         didUpdateRegionLayoutImpl(instrumentingAgents, document, namedFlow);
661 #else
662     UNUSED_PARAM(document);
663     UNUSED_PARAM(namedFlow);
664 #endif
665 }
666
667 inline void InspectorInstrumentation::didChangeRegionOverset(Document* document, WebKitNamedFlow* namedFlow)
668 {
669 #if ENABLE(INSPECTOR)
670     FAST_RETURN_IF_NO_FRONTENDS(void());
671     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
672         didChangeRegionOversetImpl(instrumentingAgents, document, namedFlow);
673 #else
674     UNUSED_PARAM(document);
675     UNUSED_PARAM(namedFlow);
676 #endif
677 }
678
679 inline void InspectorInstrumentation::didRegisterNamedFlowContentElement(Document* document, WebKitNamedFlow* namedFlow, Node* contentElement, Node* nextContentElement)
680 {
681 #if ENABLE(INSPECTOR)
682     FAST_RETURN_IF_NO_FRONTENDS(void());
683     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
684         didRegisterNamedFlowContentElementImpl(instrumentingAgents, document, namedFlow, contentElement, nextContentElement);
685 #else
686     UNUSED_PARAM(document);
687     UNUSED_PARAM(namedFlow);
688     UNUSED_PARAM(contentElement);
689     UNUSED_PARAM(nextContentElement);
690 #endif
691 }
692
693 inline void InspectorInstrumentation::didUnregisterNamedFlowContentElement(Document* document, WebKitNamedFlow* namedFlow, Node* contentElement)
694 {
695 #if ENABLE(INSPECTOR)
696     FAST_RETURN_IF_NO_FRONTENDS(void());
697     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
698         didUnregisterNamedFlowContentElementImpl(instrumentingAgents, document, namedFlow, contentElement);
699 #else
700     UNUSED_PARAM(document);
701     UNUSED_PARAM(namedFlow);
702     UNUSED_PARAM(contentElement);
703 #endif
704 }
705
706 inline void InspectorInstrumentation::mouseDidMoveOverElement(Page* page, const HitTestResult& result, unsigned modifierFlags)
707 {
708 #if ENABLE(INSPECTOR)
709     FAST_RETURN_IF_NO_FRONTENDS(void());
710     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
711         mouseDidMoveOverElementImpl(instrumentingAgents, result, modifierFlags);
712 #else
713     UNUSED_PARAM(page);
714     UNUSED_PARAM(result);
715     UNUSED_PARAM(modifierFlags);
716 #endif
717 }
718
719 inline bool InspectorInstrumentation::handleTouchEvent(Page* page, Node* node)
720 {
721 #if ENABLE(INSPECTOR)
722     FAST_RETURN_IF_NO_FRONTENDS(false);
723     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
724         return handleTouchEventImpl(instrumentingAgents, node);
725 #else
726     UNUSED_PARAM(page);
727     UNUSED_PARAM(node);
728 #endif
729     return false;
730 }
731
732 inline bool InspectorInstrumentation::handleMousePress(Page* page)
733 {
734 #if ENABLE(INSPECTOR)
735     FAST_RETURN_IF_NO_FRONTENDS(false);
736     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
737         return handleMousePressImpl(instrumentingAgents);
738 #else
739     UNUSED_PARAM(page);
740 #endif
741     return false;
742 }
743
744 inline bool InspectorInstrumentation::forcePseudoState(Element* element, CSSSelector::PseudoType pseudoState)
745 {
746 #if ENABLE(INSPECTOR)
747     FAST_RETURN_IF_NO_FRONTENDS(false);
748     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(&element->document()))
749         return forcePseudoStateImpl(instrumentingAgents, element, pseudoState);
750 #else
751     UNUSED_PARAM(element);
752     UNUSED_PARAM(pseudoState);
753 #endif
754     return false;
755 }
756
757 inline void InspectorInstrumentation::characterDataModified(Document* document, CharacterData* characterData)
758 {
759 #if ENABLE(INSPECTOR)
760     FAST_RETURN_IF_NO_FRONTENDS(void());
761     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
762         characterDataModifiedImpl(instrumentingAgents, characterData);
763 #else
764     UNUSED_PARAM(document);
765     UNUSED_PARAM(characterData);
766 #endif
767 }
768
769 inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
770 {
771 #if ENABLE(INSPECTOR)
772     FAST_RETURN_IF_NO_FRONTENDS(void());
773     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
774         willSendXMLHttpRequestImpl(instrumentingAgents, url);
775 #else
776     UNUSED_PARAM(context);
777     UNUSED_PARAM(url);
778 #endif
779 }
780
781 inline void InspectorInstrumentation::didScheduleResourceRequest(Document* document, const String& url)
782 {
783 #if ENABLE(INSPECTOR)
784     FAST_RETURN_IF_NO_FRONTENDS(void());
785     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
786         didScheduleResourceRequestImpl(instrumentingAgents, url, document->frame());
787 #else
788     UNUSED_PARAM(document);
789     UNUSED_PARAM(url);
790 #endif
791 }
792
793 inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
794 {
795 #if ENABLE(INSPECTOR)
796     FAST_RETURN_IF_NO_FRONTENDS(void());
797     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
798         didInstallTimerImpl(instrumentingAgents, timerId, timeout, singleShot, context);
799 #else
800     UNUSED_PARAM(context);
801     UNUSED_PARAM(timerId);
802     UNUSED_PARAM(timeout);
803     UNUSED_PARAM(singleShot);
804 #endif
805 }
806
807 inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* context, int timerId)
808 {
809 #if ENABLE(INSPECTOR)
810     FAST_RETURN_IF_NO_FRONTENDS(void());
811     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
812         didRemoveTimerImpl(instrumentingAgents, timerId, context);
813 #else
814     UNUSED_PARAM(context);
815     UNUSED_PARAM(timerId);
816 #endif
817 }
818
819 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
820 {
821 #if ENABLE(INSPECTOR)
822     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
823     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
824         return willCallFunctionImpl(instrumentingAgents, scriptName, scriptLine, context);
825 #else
826     UNUSED_PARAM(context);
827     UNUSED_PARAM(scriptName);
828     UNUSED_PARAM(scriptLine);
829 #endif
830     return InspectorInstrumentationCookie();
831 }
832
833
834 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie)
835 {
836 #if ENABLE(INSPECTOR)
837     FAST_RETURN_IF_NO_FRONTENDS(void());
838     if (cookie.isValid())
839         didCallFunctionImpl(cookie);
840 #else
841     UNUSED_PARAM(cookie);
842 #endif
843 }
844
845 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
846 {
847 #if ENABLE(INSPECTOR)
848     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
849     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
850         return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context);
851 #else
852     UNUSED_PARAM(context);
853     UNUSED_PARAM(request);
854 #endif
855     return InspectorInstrumentationCookie();
856 }
857
858 inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
859 {
860 #if ENABLE(INSPECTOR)
861     FAST_RETURN_IF_NO_FRONTENDS(void());
862     if (cookie.isValid())
863         didDispatchXHRReadyStateChangeEventImpl(cookie);
864 #else
865     UNUSED_PARAM(cookie);
866 #endif
867 }
868
869 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, bool hasEventListeners)
870 {
871 #if ENABLE(INSPECTOR)
872     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
873     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
874         return willDispatchEventImpl(instrumentingAgents, event, hasEventListeners, document);
875 #else
876     UNUSED_PARAM(document);
877     UNUSED_PARAM(event);
878     UNUSED_PARAM(hasEventListeners);
879 #endif
880     return InspectorInstrumentationCookie();
881 }
882
883 inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie)
884 {
885 #if ENABLE(INSPECTOR)
886     FAST_RETURN_IF_NO_FRONTENDS(void());
887     if (cookie.isValid())
888         didDispatchEventImpl(cookie);
889 #else
890     UNUSED_PARAM(cookie);
891 #endif
892 }
893
894 inline InspectorInstrumentationCookie InspectorInstrumentation::willHandleEvent(ScriptExecutionContext* context, Event* event)
895 {
896 #if ENABLE(INSPECTOR)
897     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
898     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
899         return willHandleEventImpl(instrumentingAgents, event);
900 #else
901     UNUSED_PARAM(context);
902     UNUSED_PARAM(event);
903 #endif
904     return InspectorInstrumentationCookie();
905 }
906
907 inline void InspectorInstrumentation::didHandleEvent(const InspectorInstrumentationCookie& cookie)
908 {
909 #if ENABLE(INSPECTOR)
910     FAST_RETURN_IF_NO_FRONTENDS(void());
911     if (cookie.isValid())
912         didHandleEventImpl(cookie);
913 #else
914     UNUSED_PARAM(cookie);
915 #endif
916 }
917
918 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindow(Frame* frame, const Event& event, DOMWindow* window)
919 {
920 #if ENABLE(INSPECTOR)
921     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
922     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
923         return willDispatchEventOnWindowImpl(instrumentingAgents, event, window);
924 #else
925     UNUSED_PARAM(frame);
926     UNUSED_PARAM(event);
927     UNUSED_PARAM(window);
928 #endif
929     return InspectorInstrumentationCookie();
930 }
931
932 inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie)
933 {
934 #if ENABLE(INSPECTOR)
935     FAST_RETURN_IF_NO_FRONTENDS(void());
936     if (cookie.isValid())
937         didDispatchEventOnWindowImpl(cookie);
938 #else
939     UNUSED_PARAM(cookie);
940 #endif
941 }
942
943 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame* frame, const String& url, int lineNumber)
944 {
945 #if ENABLE(INSPECTOR)
946     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
947     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
948         return willEvaluateScriptImpl(instrumentingAgents, url, lineNumber, frame);
949 #else
950     UNUSED_PARAM(frame);
951     UNUSED_PARAM(url);
952     UNUSED_PARAM(lineNumber);
953 #endif
954     return InspectorInstrumentationCookie();
955 }
956
957 inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie)
958 {
959 #if ENABLE(INSPECTOR)
960     FAST_RETURN_IF_NO_FRONTENDS(void());
961     if (cookie.isValid())
962         didEvaluateScriptImpl(cookie);
963 #else
964     UNUSED_PARAM(cookie);
965 #endif
966 }
967
968 inline void InspectorInstrumentation::scriptsEnabled(Page* page, bool isEnabled)
969 {
970 #if ENABLE(INSPECTOR)
971     FAST_RETURN_IF_NO_FRONTENDS(void());
972     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
973         return scriptsEnabledImpl(instrumentingAgents, isEnabled);
974 #else
975     UNUSED_PARAM(page);
976     UNUSED_PARAM(isEnabled);
977 #endif
978 }
979
980 inline void InspectorInstrumentation::didCreateIsolatedContext(Frame* frame, JSC::ExecState* scriptState, SecurityOrigin* origin)
981 {
982 #if ENABLE(INSPECTOR)
983     FAST_RETURN_IF_NO_FRONTENDS(void());
984     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
985         return didCreateIsolatedContextImpl(instrumentingAgents, frame, scriptState, origin);
986 #else
987     UNUSED_PARAM(frame);
988     UNUSED_PARAM(scriptState);
989     UNUSED_PARAM(origin);
990 #endif
991 }
992
993 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext* context, int timerId)
994 {
995 #if ENABLE(INSPECTOR)
996     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
997     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
998         return willFireTimerImpl(instrumentingAgents, timerId, context);
999 #else
1000     UNUSED_PARAM(context);
1001     UNUSED_PARAM(timerId);
1002 #endif
1003     return InspectorInstrumentationCookie();
1004 }
1005
1006 inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentationCookie& cookie)
1007 {
1008 #if ENABLE(INSPECTOR)
1009     FAST_RETURN_IF_NO_FRONTENDS(void());
1010     if (cookie.isValid())
1011         didFireTimerImpl(cookie);
1012 #else
1013     UNUSED_PARAM(cookie);
1014 #endif
1015 }
1016
1017 inline void InspectorInstrumentation::didInvalidateLayout(Frame* frame)
1018 {
1019 #if ENABLE(INSPECTOR)
1020     FAST_RETURN_IF_NO_FRONTENDS(void());
1021     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1022         didInvalidateLayoutImpl(instrumentingAgents, frame);
1023 #else
1024     UNUSED_PARAM(frame);
1025 #endif
1026 }
1027
1028 inline InspectorInstrumentationCookie InspectorInstrumentation::willLayout(Frame* frame)
1029 {
1030 #if ENABLE(INSPECTOR)
1031     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1032     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1033         return willLayoutImpl(instrumentingAgents, frame);
1034 #else
1035     UNUSED_PARAM(frame);
1036 #endif
1037     return InspectorInstrumentationCookie();
1038 }
1039
1040 inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root)
1041 {
1042 #if ENABLE(INSPECTOR)
1043     FAST_RETURN_IF_NO_FRONTENDS(void());
1044     if (cookie.isValid())
1045         didLayoutImpl(cookie, root);
1046 #else
1047     UNUSED_PARAM(cookie);
1048     UNUSED_PARAM(root);
1049 #endif
1050 }
1051
1052 inline void InspectorInstrumentation::didScroll(Page* page)
1053 {
1054 #if ENABLE(INSPECTOR)
1055     FAST_RETURN_IF_NO_FRONTENDS(void());
1056     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1057         didScrollImpl(instrumentingAgents);
1058 #else
1059     UNUSED_PARAM(page);
1060 #endif
1061 }
1062
1063 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
1064 {
1065 #if ENABLE(INSPECTOR)
1066     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1067     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1068         return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context);
1069 #else
1070     UNUSED_PARAM(context);
1071     UNUSED_PARAM(request);
1072 #endif
1073     return InspectorInstrumentationCookie();
1074 }
1075
1076 inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
1077 {
1078 #if ENABLE(INSPECTOR)
1079     FAST_RETURN_IF_NO_FRONTENDS(void());
1080     if (cookie.isValid())
1081         didDispatchXHRLoadEventImpl(cookie);
1082 #else
1083     UNUSED_PARAM(cookie);
1084 #endif
1085 }
1086
1087 inline void InspectorInstrumentation::willPaint(RenderObject* renderer)
1088 {
1089 #if ENABLE(INSPECTOR)
1090     FAST_RETURN_IF_NO_FRONTENDS(void());
1091     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
1092         return willPaintImpl(instrumentingAgents, renderer);
1093 #else
1094     UNUSED_PARAM(renderer);
1095 #endif
1096 }
1097
1098 inline void InspectorInstrumentation::didPaint(RenderObject* renderer, GraphicsContext* context, const LayoutRect& rect)
1099 {
1100 #if ENABLE(INSPECTOR)
1101     FAST_RETURN_IF_NO_FRONTENDS(void());
1102     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderer(renderer))
1103         didPaintImpl(instrumentingAgents, renderer, context, rect);
1104 #else
1105     UNUSED_PARAM(renderer);
1106     UNUSED_PARAM(context);
1107     UNUSED_PARAM(rect);
1108 #endif
1109 }
1110
1111 inline void InspectorInstrumentation::willScrollLayer(Frame* frame)
1112 {
1113 #if ENABLE(INSPECTOR)
1114     FAST_RETURN_IF_NO_FRONTENDS(void());
1115     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1116         willScrollLayerImpl(instrumentingAgents, frame);
1117 #else
1118     UNUSED_PARAM(frame);
1119 #endif
1120 }
1121
1122 inline void InspectorInstrumentation::didScrollLayer(Frame* frame)
1123 {
1124 #if ENABLE(INSPECTOR)
1125     FAST_RETURN_IF_NO_FRONTENDS(void());
1126     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1127         didScrollLayerImpl(instrumentingAgents);
1128 #else
1129     UNUSED_PARAM(frame);
1130 #endif
1131 }
1132
1133 inline InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyle(Document* document)
1134 {
1135 #if ENABLE(INSPECTOR)
1136     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1137     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1138         return willRecalculateStyleImpl(instrumentingAgents, document->frame());
1139 #else
1140     UNUSED_PARAM(document);
1141 #endif
1142     return InspectorInstrumentationCookie();
1143 }
1144
1145 inline void InspectorInstrumentation::didRecalculateStyle(const InspectorInstrumentationCookie& cookie)
1146 {
1147 #if ENABLE(INSPECTOR)
1148     FAST_RETURN_IF_NO_FRONTENDS(void());
1149     if (cookie.isValid())
1150         didRecalculateStyleImpl(cookie);
1151 #else
1152     UNUSED_PARAM(cookie);
1153 #endif
1154 }
1155
1156 inline void InspectorInstrumentation::didScheduleStyleRecalculation(Document* document)
1157 {
1158 #if ENABLE(INSPECTOR)
1159     FAST_RETURN_IF_NO_FRONTENDS(void());
1160     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1161         didScheduleStyleRecalculationImpl(instrumentingAgents, document);
1162 #else
1163     UNUSED_PARAM(document);
1164 #endif
1165 }
1166
1167 inline void InspectorInstrumentation::applyEmulatedMedia(Frame* frame, String* media)
1168 {
1169 #if ENABLE(INSPECTOR)
1170     FAST_RETURN_IF_NO_FRONTENDS(void());
1171     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1172         applyEmulatedMediaImpl(instrumentingAgents, media);
1173 #else
1174     UNUSED_PARAM(frame);
1175     UNUSED_PARAM(media);
1176 #endif
1177 }
1178
1179 inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
1180 {
1181 #if ENABLE(INSPECTOR)
1182     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1183         willSendRequestImpl(instrumentingAgents, identifier, loader, request, redirectResponse);
1184 #else
1185     UNUSED_PARAM(frame);
1186     UNUSED_PARAM(identifier);
1187     UNUSED_PARAM(loader);
1188     UNUSED_PARAM(request);
1189     UNUSED_PARAM(redirectResponse);
1190 #endif
1191 }
1192
1193 inline void InspectorInstrumentation::continueAfterPingLoader(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)
1194 {
1195 #if ENABLE(INSPECTOR)
1196     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1197         InspectorInstrumentation::continueAfterPingLoaderImpl(instrumentingAgents, identifier, loader, request, response);
1198 #else
1199     UNUSED_PARAM(frame);
1200     UNUSED_PARAM(identifier);
1201     UNUSED_PARAM(loader);
1202     UNUSED_PARAM(request);
1203     UNUSED_PARAM(response);
1204 #endif
1205 }
1206
1207 inline void InspectorInstrumentation::markResourceAsCached(Page* page, unsigned long identifier)
1208 {
1209 #if ENABLE(INSPECTOR)
1210     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1211         markResourceAsCachedImpl(instrumentingAgents, identifier);
1212 #else
1213     UNUSED_PARAM(page);
1214     UNUSED_PARAM(identifier);
1215 #endif
1216 }
1217
1218 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, CachedResource* resource)
1219 {
1220 #if ENABLE(INSPECTOR)
1221     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1222         didLoadResourceFromMemoryCacheImpl(instrumentingAgents, loader, resource);
1223 #else
1224     UNUSED_PARAM(page);
1225     UNUSED_PARAM(loader);
1226     UNUSED_PARAM(resource);
1227 #endif
1228 }
1229
1230 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceData(Frame* frame, unsigned long identifier, int length)
1231 {
1232 #if ENABLE(INSPECTOR)
1233     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1234     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1235         return willReceiveResourceDataImpl(instrumentingAgents, identifier, frame, length);
1236 #else
1237     UNUSED_PARAM(frame);
1238     UNUSED_PARAM(identifier);
1239     UNUSED_PARAM(length);
1240 #endif
1241     return InspectorInstrumentationCookie();
1242 }
1243
1244 inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInstrumentationCookie& cookie)
1245 {
1246 #if ENABLE(INSPECTOR)
1247     FAST_RETURN_IF_NO_FRONTENDS(void());
1248     if (cookie.isValid())
1249         didReceiveResourceDataImpl(cookie);
1250 #else
1251     UNUSED_PARAM(cookie);
1252 #endif
1253 }
1254
1255 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
1256 {
1257 #if ENABLE(INSPECTOR)
1258     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1259         return willReceiveResourceResponseImpl(instrumentingAgents, identifier, response, frame);
1260 #else
1261     UNUSED_PARAM(frame);
1262     UNUSED_PARAM(identifier);
1263     UNUSED_PARAM(response);
1264 #endif
1265     return InspectorInstrumentationCookie();
1266 }
1267
1268 inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
1269 {
1270 #if ENABLE(INSPECTOR)
1271     // Call this unconditionally so that we're able to log to console with no front-end attached.
1272     if (cookie.isValid())
1273         didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
1274 #else
1275     UNUSED_PARAM(cookie);
1276     UNUSED_PARAM(identifier);
1277     UNUSED_PARAM(loader);
1278     UNUSED_PARAM(response);
1279     UNUSED_PARAM(resourceLoader);
1280 #endif
1281 }
1282
1283 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1284 {
1285 #if ENABLE(INSPECTOR)
1286     FAST_RETURN_IF_NO_FRONTENDS(void());
1287     InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
1288 #else
1289     UNUSED_PARAM(frame);
1290     UNUSED_PARAM(loader);
1291     UNUSED_PARAM(identifier);
1292     UNUSED_PARAM(r);
1293 #endif
1294 }
1295
1296 inline void InspectorInstrumentation::continueWithPolicyDownload(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1297 {
1298 #if ENABLE(INSPECTOR)
1299     FAST_RETURN_IF_NO_FRONTENDS(void());
1300     InspectorInstrumentation::continueWithPolicyDownloadImpl(frame, loader, identifier, r);
1301 #else
1302     UNUSED_PARAM(frame);
1303     UNUSED_PARAM(loader);
1304     UNUSED_PARAM(identifier);
1305     UNUSED_PARAM(r);
1306 #endif
1307 }
1308
1309 inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1310 {
1311 #if ENABLE(INSPECTOR)
1312     FAST_RETURN_IF_NO_FRONTENDS(void());
1313     InspectorInstrumentation::continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
1314 #else
1315     UNUSED_PARAM(frame);
1316     UNUSED_PARAM(loader);
1317     UNUSED_PARAM(identifier);
1318     UNUSED_PARAM(r);
1319 #endif
1320 }
1321
1322 inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
1323 {
1324 #if ENABLE(INSPECTOR)
1325     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1326         didReceiveDataImpl(instrumentingAgents, identifier, data, dataLength, encodedDataLength);
1327 #else
1328     UNUSED_PARAM(frame);
1329     UNUSED_PARAM(identifier);
1330     UNUSED_PARAM(data);
1331     UNUSED_PARAM(dataLength);
1332     UNUSED_PARAM(encodedDataLength);
1333 #endif
1334 }
1335
1336 inline void InspectorInstrumentation::didFinishLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, double finishTime)
1337 {
1338 #if ENABLE(INSPECTOR)
1339     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1340         didFinishLoadingImpl(instrumentingAgents, identifier, loader, finishTime);
1341 #else
1342     UNUSED_PARAM(frame);
1343     UNUSED_PARAM(loader);
1344     UNUSED_PARAM(identifier);
1345     UNUSED_PARAM(finishTime);
1346 #endif
1347 }
1348
1349 inline void InspectorInstrumentation::didFailLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceError& error)
1350 {
1351 #if ENABLE(INSPECTOR)
1352     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1353         didFailLoadingImpl(instrumentingAgents, identifier, loader, error);
1354 #else
1355     UNUSED_PARAM(frame);
1356     UNUSED_PARAM(loader);
1357     UNUSED_PARAM(identifier);
1358     UNUSED_PARAM(error);
1359 #endif
1360 }
1361
1362 inline void InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(ScriptExecutionContext* context, unsigned long identifier, ThreadableLoaderClient* client)
1363 {
1364 #if ENABLE(INSPECTOR)
1365     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1366         documentThreadableLoaderStartedLoadingForClientImpl(instrumentingAgents, identifier, client);
1367 #else
1368     UNUSED_PARAM(context);
1369     UNUSED_PARAM(identifier);
1370     UNUSED_PARAM(client);
1371 #endif
1372 }
1373
1374 inline void InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* context, ThreadableLoaderClient* client, const String& method, const URL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
1375 {
1376 #if ENABLE(INSPECTOR)
1377     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1378         willLoadXHRImpl(instrumentingAgents, client, method, url, async, formData, headers, includeCredentials);
1379 #else
1380     UNUSED_PARAM(context);
1381     UNUSED_PARAM(client);
1382     UNUSED_PARAM(method);
1383     UNUSED_PARAM(url);
1384     UNUSED_PARAM(async);
1385     UNUSED_PARAM(formData);
1386     UNUSED_PARAM(headers);
1387     UNUSED_PARAM(includeCredentials);
1388 #endif
1389 }
1390
1391 inline void InspectorInstrumentation::didFailXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client)
1392 {
1393 #if ENABLE(INSPECTOR)
1394     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1395         didFailXHRLoadingImpl(instrumentingAgents, client);
1396 #else
1397     UNUSED_PARAM(context);
1398     UNUSED_PARAM(client);
1399 #endif
1400 }
1401
1402
1403 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
1404 {
1405 #if ENABLE(INSPECTOR)
1406     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1407         didFinishXHRLoadingImpl(instrumentingAgents, client, identifier, sourceString, url, sendURL, sendLineNumber, sendColumnNumber);
1408 #else
1409     UNUSED_PARAM(context);
1410     UNUSED_PARAM(client);
1411     UNUSED_PARAM(identifier);
1412     UNUSED_PARAM(sourceString);
1413     UNUSED_PARAM(url);
1414     UNUSED_PARAM(sendURL);
1415     UNUSED_PARAM(sendLineNumber);
1416 #endif
1417 }
1418
1419 inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier)
1420 {
1421 #if ENABLE(INSPECTOR)
1422     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1423         didReceiveXHRResponseImpl(instrumentingAgents, identifier);
1424 #else
1425     UNUSED_PARAM(context);
1426     UNUSED_PARAM(identifier);
1427 #endif
1428 }
1429
1430 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
1431 {
1432 #if ENABLE(INSPECTOR)
1433     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1434         willLoadXHRSynchronouslyImpl(instrumentingAgents);
1435 #else
1436     UNUSED_PARAM(context);
1437 #endif
1438 }
1439
1440 inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context)
1441 {
1442 #if ENABLE(INSPECTOR)
1443     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1444         didLoadXHRSynchronouslyImpl(instrumentingAgents);
1445 #else
1446     UNUSED_PARAM(context);
1447 #endif
1448 }
1449
1450 inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
1451 {
1452 #if ENABLE(INSPECTOR)
1453     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1454         scriptImportedImpl(instrumentingAgents, identifier, sourceString);
1455 #else
1456     UNUSED_PARAM(context);
1457     UNUSED_PARAM(identifier);
1458     UNUSED_PARAM(sourceString);
1459 #endif
1460 }
1461
1462 inline void InspectorInstrumentation::scriptExecutionBlockedByCSP(ScriptExecutionContext* context, const String& directiveText)
1463 {
1464 #if ENABLE(INSPECTOR)
1465     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1466         scriptExecutionBlockedByCSPImpl(instrumentingAgents, directiveText);
1467 #else
1468     UNUSED_PARAM(context);
1469     UNUSED_PARAM(directiveText);
1470 #endif
1471 }
1472
1473 inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
1474 {
1475 #if ENABLE(INSPECTOR)
1476     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1477         didReceiveScriptResponseImpl(instrumentingAgents, identifier);
1478 #else
1479     UNUSED_PARAM(context);
1480     UNUSED_PARAM(identifier);
1481 #endif
1482 }
1483
1484 inline void InspectorInstrumentation::domContentLoadedEventFired(Frame* frame)
1485 {
1486 #if ENABLE(INSPECTOR)
1487     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1488         domContentLoadedEventFiredImpl(instrumentingAgents, frame);
1489 #else
1490     UNUSED_PARAM(frame);
1491 #endif
1492 }
1493
1494 inline void InspectorInstrumentation::loadEventFired(Frame* frame)
1495 {
1496 #if ENABLE(INSPECTOR)
1497     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1498         loadEventFiredImpl(instrumentingAgents, frame);
1499 #else
1500     UNUSED_PARAM(frame);
1501 #endif
1502 }
1503
1504 inline void InspectorInstrumentation::frameDetachedFromParent(Frame* frame)
1505 {
1506 #if ENABLE(INSPECTOR)
1507     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1508         frameDetachedFromParentImpl(instrumentingAgents, frame);
1509 #else
1510     UNUSED_PARAM(frame);
1511 #endif
1512 }
1513
1514 inline void InspectorInstrumentation::didCommitLoad(Frame* frame, DocumentLoader* loader)
1515 {
1516 #if ENABLE(INSPECTOR)
1517     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1518         didCommitLoadImpl(instrumentingAgents, frame->page(), loader);
1519 #else
1520     UNUSED_PARAM(frame);
1521     UNUSED_PARAM(loader);
1522 #endif
1523 }
1524
1525 inline void InspectorInstrumentation::frameDocumentUpdated(Frame* frame)
1526 {
1527 #if ENABLE(INSPECTOR)
1528     FAST_RETURN_IF_NO_FRONTENDS(void());
1529     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1530         frameDocumentUpdatedImpl(instrumentingAgents, frame);
1531 #else
1532     UNUSED_PARAM(frame);
1533 #endif
1534 }
1535
1536 inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame* frame, DocumentLoader* loader)
1537 {
1538 #if ENABLE(INSPECTOR)
1539     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1540         loaderDetachedFromFrameImpl(instrumentingAgents, loader);
1541 #else
1542     UNUSED_PARAM(frame);
1543     UNUSED_PARAM(loader);
1544 #endif
1545 }
1546
1547 inline void InspectorInstrumentation::frameStartedLoading(Frame& frame)
1548 {
1549 #if ENABLE(INSPECTOR)
1550     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1551         frameStartedLoadingImpl(*instrumentingAgents, frame);
1552 #else
1553     UNUSED_PARAM(frame);
1554 #endif
1555 }
1556
1557 inline void InspectorInstrumentation::frameStoppedLoading(Frame& frame)
1558 {
1559 #if ENABLE(INSPECTOR)
1560     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1561         frameStoppedLoadingImpl(*instrumentingAgents, frame);
1562 #else
1563     UNUSED_PARAM(frame);
1564 #endif
1565 }
1566
1567 inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, double delay)
1568 {
1569 #if ENABLE(INSPECTOR)
1570     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1571         frameScheduledNavigationImpl(*instrumentingAgents, frame, delay);
1572 #else
1573     UNUSED_PARAM(frame);
1574     UNUSED_PARAM(delay);
1575 #endif
1576 }
1577
1578 inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame)
1579 {
1580 #if ENABLE(INSPECTOR)
1581     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
1582         frameClearedScheduledNavigationImpl(*instrumentingAgents, frame);
1583 #else
1584     UNUSED_PARAM(frame);
1585 #endif
1586 }
1587
1588 inline InspectorInstrumentationCookie InspectorInstrumentation::willRunJavaScriptDialog(Page* page, const String& message)
1589 {
1590 #if ENABLE(INSPECTOR)
1591     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1592     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1593         return willRunJavaScriptDialogImpl(instrumentingAgents, message);
1594 #else
1595     UNUSED_PARAM(page);
1596     UNUSED_PARAM(message);
1597 #endif
1598     return InspectorInstrumentationCookie();
1599 }
1600
1601 inline void InspectorInstrumentation::didRunJavaScriptDialog(const InspectorInstrumentationCookie& cookie)
1602 {
1603 #if ENABLE(INSPECTOR)
1604     FAST_RETURN_IF_NO_FRONTENDS(void());
1605     if (cookie.isValid())
1606         didRunJavaScriptDialogImpl(cookie);
1607 #else
1608     UNUSED_PARAM(cookie);
1609 #endif
1610 }
1611
1612 inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource* cachedResource)
1613 {
1614 #if ENABLE(INSPECTOR)
1615     FAST_RETURN_IF_NO_FRONTENDS(void());
1616     willDestroyCachedResourceImpl(cachedResource);
1617 #else
1618     UNUSED_PARAM(cachedResource);
1619 #endif
1620 }
1621
1622 inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned startLine)
1623 {
1624 #if ENABLE(INSPECTOR)
1625     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1626     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1627         return willWriteHTMLImpl(instrumentingAgents, startLine, document->frame());
1628 #else
1629     UNUSED_PARAM(document);
1630     UNUSED_PARAM(startLine);
1631 #endif
1632     return InspectorInstrumentationCookie();
1633 }
1634
1635 inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned endLine)
1636 {
1637 #if ENABLE(INSPECTOR)
1638     FAST_RETURN_IF_NO_FRONTENDS(void());
1639     if (cookie.isValid())
1640         didWriteHTMLImpl(cookie, endLine);
1641 #else
1642     UNUSED_PARAM(cookie);
1643     UNUSED_PARAM(endLine);
1644 #endif
1645 }
1646
1647 inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
1648 {
1649 #if ENABLE(INSPECTOR)
1650     FAST_RETURN_IF_NO_FRONTENDS(void());
1651     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1652         didDispatchDOMStorageEventImpl(instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
1653 #else
1654     UNUSED_PARAM(key);
1655     UNUSED_PARAM(oldValue);
1656     UNUSED_PARAM(newValue);
1657     UNUSED_PARAM(storageType);
1658     UNUSED_PARAM(securityOrigin);
1659     UNUSED_PARAM(page);
1660 #endif // ENABLE(INSPECTOR)
1661 }
1662
1663 inline bool InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext* context)
1664 {
1665 #if ENABLE(INSPECTOR)
1666     FAST_RETURN_IF_NO_FRONTENDS(false);
1667     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1668         return shouldPauseDedicatedWorkerOnStartImpl(instrumentingAgents);
1669 #else
1670     UNUSED_PARAM(context);
1671 #endif
1672     return false;
1673 }
1674
1675 inline void InspectorInstrumentation::didStartWorkerGlobalScope(ScriptExecutionContext* context, WorkerGlobalScopeProxy* proxy, const URL& url)
1676 {
1677 #if ENABLE(INSPECTOR)
1678     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1679         didStartWorkerGlobalScopeImpl(instrumentingAgents, proxy, url);
1680 #else
1681     UNUSED_PARAM(context);
1682     UNUSED_PARAM(proxy);
1683     UNUSED_PARAM(url);
1684 #endif
1685 }
1686
1687 inline void InspectorInstrumentation::workerGlobalScopeTerminated(ScriptExecutionContext* context, WorkerGlobalScopeProxy* proxy)
1688 {
1689 #if ENABLE(INSPECTOR)
1690     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1691         workerGlobalScopeTerminatedImpl(instrumentingAgents, proxy);
1692 #else
1693     UNUSED_PARAM(context);
1694     UNUSED_PARAM(proxy);
1695 #endif
1696 }
1697
1698 #if ENABLE(WEB_SOCKETS)
1699 inline void InspectorInstrumentation::didCreateWebSocket(Document* document, unsigned long identifier, const URL& requestURL, const URL& documentURL, const String& protocol)
1700 {
1701 #if ENABLE(INSPECTOR)
1702     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1703         didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL, protocol, document);
1704 #else
1705     UNUSED_PARAM(document);
1706     UNUSED_PARAM(identifier);
1707     UNUSED_PARAM(requestURL);
1708     UNUSED_PARAM(documentURL);
1709     UNUSED_PARAM(protocol);
1710 #endif
1711 }
1712
1713 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const ResourceRequest& request)
1714 {
1715 #if ENABLE(INSPECTOR)
1716     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1717         willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request, document);
1718 #else
1719     UNUSED_PARAM(document);
1720     UNUSED_PARAM(identifier);
1721     UNUSED_PARAM(request);
1722 #endif
1723 }
1724
1725 inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(Document* document, unsigned long identifier, const ResourceResponse& response)
1726 {
1727 #if ENABLE(INSPECTOR)
1728     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1729         didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response, document);
1730 #else
1731     UNUSED_PARAM(document);
1732     UNUSED_PARAM(identifier);
1733     UNUSED_PARAM(response);
1734 #endif
1735 }
1736
1737 inline void InspectorInstrumentation::didCloseWebSocket(Document* document, unsigned long identifier)
1738 {
1739 #if ENABLE(INSPECTOR)
1740     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1741         didCloseWebSocketImpl(instrumentingAgents, identifier, document);
1742 #else
1743     UNUSED_PARAM(document);
1744     UNUSED_PARAM(identifier);
1745 #endif
1746 }
1747 inline void InspectorInstrumentation::didReceiveWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1748 {
1749 #if ENABLE(INSPECTOR)
1750     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1751         didReceiveWebSocketFrameImpl(instrumentingAgents, identifier, frame);
1752 #else
1753     UNUSED_PARAM(document);
1754     UNUSED_PARAM(identifier);
1755     UNUSED_PARAM(frame);
1756 #endif
1757 }
1758 inline void InspectorInstrumentation::didReceiveWebSocketFrameError(Document* document, unsigned long identifier, const String& errorMessage)
1759 {
1760 #if ENABLE(INSPECTOR)
1761     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1762         didReceiveWebSocketFrameErrorImpl(instrumentingAgents, identifier, errorMessage);
1763 #else
1764     UNUSED_PARAM(document);
1765     UNUSED_PARAM(identifier);
1766     UNUSED_PARAM(errorMessage);
1767 #endif
1768 }
1769 inline void InspectorInstrumentation::didSendWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1770 {
1771 #if ENABLE(INSPECTOR)
1772     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1773         didSendWebSocketFrameImpl(instrumentingAgents, identifier, frame);
1774 #else
1775     UNUSED_PARAM(document);
1776     UNUSED_PARAM(identifier);
1777     UNUSED_PARAM(frame);
1778 #endif
1779 }
1780 #endif
1781
1782 inline void InspectorInstrumentation::networkStateChanged(Page* page)
1783 {
1784 #if ENABLE(INSPECTOR)
1785     FAST_RETURN_IF_NO_FRONTENDS(void());
1786     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1787         networkStateChangedImpl(instrumentingAgents);
1788 #else
1789     UNUSED_PARAM(page);
1790 #endif
1791 }
1792
1793 inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
1794 {
1795 #if ENABLE(INSPECTOR)
1796     FAST_RETURN_IF_NO_FRONTENDS(void());
1797     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1798         updateApplicationCacheStatusImpl(instrumentingAgents, frame);
1799 #else
1800     UNUSED_PARAM(frame);
1801 #endif
1802 }
1803
1804 inline void InspectorInstrumentation::didRequestAnimationFrame(Document* document, int callbackId)
1805 {
1806 #if ENABLE(INSPECTOR)
1807     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1808         didRequestAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1809 #else
1810     UNUSED_PARAM(document);
1811     UNUSED_PARAM(callbackId);
1812 #endif
1813 }
1814
1815 inline void InspectorInstrumentation::didCancelAnimationFrame(Document* document, int callbackId)
1816 {
1817 #if ENABLE(INSPECTOR)
1818     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1819         didCancelAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1820 #else
1821     UNUSED_PARAM(document);
1822     UNUSED_PARAM(callbackId);
1823 #endif
1824 }
1825
1826 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimationFrame(Document* document, int callbackId)
1827 {
1828 #if ENABLE(INSPECTOR)
1829     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1830         return willFireAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1831 #else
1832     UNUSED_PARAM(document);
1833     UNUSED_PARAM(callbackId);
1834 #endif
1835     return InspectorInstrumentationCookie();
1836 }
1837
1838 inline void InspectorInstrumentation::didFireAnimationFrame(const InspectorInstrumentationCookie& cookie)
1839 {
1840 #if ENABLE(INSPECTOR)
1841     FAST_RETURN_IF_NO_FRONTENDS(void());
1842     if (cookie.isValid())
1843         didFireAnimationFrameImpl(cookie);
1844 #else
1845     UNUSED_PARAM(cookie);
1846 #endif
1847 }
1848
1849 #if USE(ACCELERATED_COMPOSITING)
1850 inline void InspectorInstrumentation::layerTreeDidChange(Page* page)
1851 {
1852 #if ENABLE(INSPECTOR)
1853     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1854         layerTreeDidChangeImpl(instrumentingAgents);
1855 #else
1856     UNUSED_PARAM(page);
1857 #endif
1858 }
1859
1860 inline void InspectorInstrumentation::renderLayerDestroyed(Page* page, const RenderLayer* renderLayer)
1861 {
1862 #if ENABLE(INSPECTOR)
1863     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1864         renderLayerDestroyedImpl(instrumentingAgents, renderLayer);
1865 #else
1866     UNUSED_PARAM(page);
1867     UNUSED_PARAM(renderLayer);
1868 #endif
1869 }
1870
1871 inline void InspectorInstrumentation::pseudoElementDestroyed(Page* page, PseudoElement* pseudoElement)
1872 {
1873 #if ENABLE(INSPECTOR)
1874     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1875         pseudoElementDestroyedImpl(instrumentingAgents, pseudoElement);
1876 #else
1877     UNUSED_PARAM(page);
1878     UNUSED_PARAM(pseudoElement);
1879 #endif
1880 }
1881 #endif
1882
1883 #if ENABLE(INSPECTOR)
1884 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForContext(ScriptExecutionContext* context)
1885 {
1886     if (!context)
1887         return nullptr;
1888     if (context->isDocument())
1889         return instrumentingAgentsForPage(toDocument(context)->page());
1890     return instrumentingAgentsForNonDocumentContext(context);
1891 }
1892
1893 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForFrame(Frame* frame)
1894 {
1895     if (frame)
1896         return instrumentingAgentsForPage(frame->page());
1897     return nullptr;
1898 }
1899
1900 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForDocument(Document* document)
1901 {
1902     if (document) {
1903         Page* page = document->page();
1904 #if ENABLE(TEMPLATE_ELEMENT)
1905         if (!page && document->templateDocumentHost())
1906             page = document->templateDocumentHost()->page();
1907 #endif
1908         return instrumentingAgentsForPage(page);
1909     }
1910     return nullptr;
1911 }
1912 #endif
1913
1914 } // namespace WebCore
1915
1916 #endif // !defined(InspectorInstrumentation_h)