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