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