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