Web Inspector: Protocol Extension: Add "regionLayoutUpdate" event
[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 "ConsoleTypes.h"
36 #include "Element.h"
37 #include "Frame.h"
38 #include "Page.h"
39 #include "ScriptExecutionContext.h"
40 #include "StorageArea.h"
41
42 #if USE(JSC)
43 namespace JSC {
44 class ExecState;
45 }
46 #endif
47
48 namespace WebCore {
49
50 class CSSRule;
51 class CharacterData;
52 class DOMWindow;
53 class DOMWrapperWorld;
54 class Database;
55 class Document;
56 class Element;
57 class EventContext;
58 class DocumentLoader;
59 class DeviceOrientationData;
60 class GeolocationPosition;
61 class GraphicsContext;
62 class HitTestResult;
63 class InspectorCSSAgent;
64 class InspectorTimelineAgent;
65 class InstrumentingAgents;
66 class KURL;
67 class Node;
68 class RenderObject;
69 class ResourceRequest;
70 class ResourceResponse;
71 class ScriptArguments;
72 class ScriptCallStack;
73 class ScriptExecutionContext;
74 class ScriptObject;
75 class ScriptProfile;
76 class SecurityOrigin;
77 class ShadowRoot;
78 class StorageArea;
79 class StyleRule;
80 class WorkerContext;
81 class WorkerContextProxy;
82 class XMLHttpRequest;
83
84 #if USE(JSC)
85 typedef JSC::ExecState ScriptState;
86 #else
87 class ScriptState;
88 #endif
89
90 #if ENABLE(WEB_SOCKETS)
91 struct WebSocketFrame;
92 class WebSocketHandshakeRequest;
93 class WebSocketHandshakeResponse;
94 #endif
95
96 #define FAST_RETURN_IF_NO_FRONTENDS(value) if (!hasFrontends()) return value;
97
98 typedef pair<InstrumentingAgents*, int> InspectorInstrumentationCookie;
99
100 class InspectorInstrumentation {
101 public:
102     static void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
103     static bool isDebuggerPaused(Frame*);
104
105     static void willInsertDOMNode(Document*, Node* parent);
106     static void didInsertDOMNode(Document*, Node*);
107     static void willRemoveDOMNode(Document*, Node*);
108     static void willModifyDOMAttr(Document*, Element*, const AtomicString& oldValue, const AtomicString& newValue);
109     static void didModifyDOMAttr(Document*, Element*, const AtomicString& name, const AtomicString& value);
110     static void didRemoveDOMAttr(Document*, Element*, const AtomicString& name);
111     static void characterDataModified(Document*, CharacterData*);
112     static void didInvalidateStyleAttr(Document*, Node*);
113     static void frameWindowDiscarded(Frame*, DOMWindow*);
114     static void mediaQueryResultChanged(Document*);
115     static void didPushShadowRoot(Element* host, ShadowRoot*);
116     static void willPopShadowRoot(Element* host, ShadowRoot*);
117     static void didCreateNamedFlow(Document*, WebKitNamedFlow*);
118     static void willRemoveNamedFlow(Document*, WebKitNamedFlow*);
119     static void didUpdateRegionLayout(Document*, WebKitNamedFlow*);
120
121     static void mouseDidMoveOverElement(Page*, const HitTestResult&, unsigned modifierFlags);
122     static bool handleMousePress(Page*);
123     static bool forcePseudoState(Element*, CSSSelector::PseudoType);
124
125     static void willSendXMLHttpRequest(ScriptExecutionContext*, const String& url);
126     static void didScheduleResourceRequest(Document*, const String& url);
127     static void didInstallTimer(ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
128     static void didRemoveTimer(ScriptExecutionContext*, int timerId);
129
130     static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
131     static void didCallFunction(const InspectorInstrumentationCookie&);
132     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext*, XMLHttpRequest*);
133     static void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie&);
134     static InspectorInstrumentationCookie willDispatchEvent(Document*, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors);
135     static void didDispatchEvent(const InspectorInstrumentationCookie&);
136     static InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext*, Event*);
137     static void didHandleEvent(const InspectorInstrumentationCookie&);
138     static InspectorInstrumentationCookie willDispatchEventOnWindow(Frame*, const Event& event, DOMWindow* window);
139     static void didDispatchEventOnWindow(const InspectorInstrumentationCookie&);
140     static InspectorInstrumentationCookie willEvaluateScript(Frame*, const String& url, int lineNumber);
141     static void didEvaluateScript(const InspectorInstrumentationCookie&);
142     static void didCreateIsolatedContext(Frame*, ScriptState*, SecurityOrigin*);
143     static InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext*, int timerId);
144     static void didFireTimer(const InspectorInstrumentationCookie&);
145     static void didBeginFrame(Page*);
146     static void didCancelFrame(Page*);
147     static void didInvalidateLayout(Frame*);
148     static InspectorInstrumentationCookie willLayout(Frame*);
149     static void didLayout(const InspectorInstrumentationCookie&, RenderObject*);
150     static void didScroll(Page*);
151     static InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext*, XMLHttpRequest*);
152     static void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie&);
153     static InspectorInstrumentationCookie willPaint(Frame*, GraphicsContext*, const LayoutRect&);
154     static void didPaint(const InspectorInstrumentationCookie&);
155     static void willComposite(Page*);
156     static void didComposite(Page*);
157     static InspectorInstrumentationCookie willRecalculateStyle(Document*);
158     static void didRecalculateStyle(const InspectorInstrumentationCookie&);
159     static void didScheduleStyleRecalculation(Document*);
160     static InspectorInstrumentationCookie willMatchRule(Document*, const StyleRule*);
161     static void didMatchRule(const InspectorInstrumentationCookie&, bool matched);
162     static InspectorInstrumentationCookie willProcessRule(Document*, const StyleRule*);
163     static void didProcessRule(const InspectorInstrumentationCookie&);
164     static void willProcessTask(Page*);
165     static void didProcessTask(Page*);
166
167     static void applyUserAgentOverride(Frame*, String*);
168     static void applyScreenWidthOverride(Frame*, long*);
169     static void applyScreenHeightOverride(Frame*, long*);
170     static bool shouldApplyScreenWidthOverride(Frame*);
171     static bool shouldApplyScreenHeightOverride(Frame*);
172     static void willSendRequest(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
173     static void continueAfterPingLoader(Frame*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
174     static void markResourceAsCached(Page*, unsigned long identifier);
175     static void didLoadResourceFromMemoryCache(Page*, DocumentLoader*, CachedResource*);
176     static InspectorInstrumentationCookie willReceiveResourceData(Frame*, unsigned long identifier, int length);
177     static void didReceiveResourceData(const InspectorInstrumentationCookie&);
178     static InspectorInstrumentationCookie willReceiveResourceResponse(Frame*, unsigned long identifier, const ResourceResponse&);
179     static void didReceiveResourceResponse(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
180     static void continueAfterXFrameOptionsDenied(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
181     static void continueWithPolicyDownload(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
182     static void continueWithPolicyIgnore(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
183     static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
184     static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
185     static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
186     static void resourceRetrievedByXMLHttpRequest(ScriptExecutionContext*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
187     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
188     static void willLoadXHRSynchronously(ScriptExecutionContext*);
189     static void didLoadXHRSynchronously(ScriptExecutionContext*);
190     static void scriptImported(ScriptExecutionContext*, unsigned long identifier, const String& sourceString);
191     static void didReceiveScriptResponse(ScriptExecutionContext*, unsigned long identifier);
192     static void domContentLoadedEventFired(Frame*);
193     static void loadEventFired(Frame*);
194     static void frameDetachedFromParent(Frame*);
195     static void didCommitLoad(Frame*, DocumentLoader*);
196     static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
197     static void willDestroyCachedResource(CachedResource*);
198
199     static InspectorInstrumentationCookie willWriteHTML(Document*, unsigned int length, unsigned int startLine);
200     static void didWriteHTML(const InspectorInstrumentationCookie&, unsigned int endLine);
201
202     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
203     static void addMessageToConsole(Page*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber);
204 #if ENABLE(WORKERS)
205     static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
206     static void addMessageToConsole(WorkerContext*, MessageSource, MessageType, MessageLevel, const String& message, const String&, unsigned lineNumber);
207 #endif
208     static void consoleCount(Page*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
209     static void startConsoleTiming(Frame*, const String& title);
210     static void stopConsoleTiming(Frame*, const String& title, PassRefPtr<ScriptCallStack>);
211     static void consoleTimeStamp(Frame*, PassRefPtr<ScriptArguments>);
212
213     static void didRequestAnimationFrame(Document*, int callbackId);
214     static void didCancelAnimationFrame(Document*, int callbackId);
215     static InspectorInstrumentationCookie willFireAnimationFrame(Document*, int callbackId);
216     static void didFireAnimationFrame(const InspectorInstrumentationCookie&);
217
218 #if ENABLE(JAVASCRIPT_DEBUGGER)
219     static void addStartProfilingMessageToConsole(Page*, const String& title, unsigned lineNumber, const String& sourceURL);
220     static void addProfile(Page*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
221     static String getCurrentUserInitiatedProfileName(Page*, bool incrementProfileNumber);
222     static bool profilerEnabled(Page*);
223 #endif
224
225 #if ENABLE(SQL_DATABASE)
226     static void didOpenDatabase(ScriptExecutionContext*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
227 #endif
228
229     static void didUseDOMStorage(Page*, StorageArea*, bool isLocalStorage, Frame*);
230     static void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
231
232 #if ENABLE(WORKERS)
233     static bool shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext*);
234     static void didStartWorkerContext(ScriptExecutionContext*, WorkerContextProxy*, const KURL&);
235     static void workerContextTerminated(ScriptExecutionContext*, WorkerContextProxy*);
236     static void willEvaluateWorkerScript(WorkerContext*, int workerThreadStartMode);
237 #endif
238
239 #if ENABLE(WEB_SOCKETS)
240     static void didCreateWebSocket(ScriptExecutionContext*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
241     static void willSendWebSocketHandshakeRequest(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeRequest&);
242     static void didReceiveWebSocketHandshakeResponse(ScriptExecutionContext*, unsigned long identifier, const WebSocketHandshakeResponse&);
243     static void didCloseWebSocket(ScriptExecutionContext*, unsigned long identifier);
244     static void didReceiveWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
245     static void didSendWebSocketFrame(Document*, unsigned long identifier, const WebSocketFrame&);
246     static void didReceiveWebSocketFrameError(Document*, unsigned long identifier, const String& errorMessage);
247 #endif
248
249 #if ENABLE(WEBGL)
250     static ScriptObject wrapWebGLRenderingContextForInstrumentation(Document*, const ScriptObject&);
251 #endif
252
253     static void networkStateChanged(Page*);
254     static void updateApplicationCacheStatus(Frame*);
255
256 #if ENABLE(INSPECTOR)
257     static void frontendCreated() { s_frontendCounter += 1; }
258     static void frontendDeleted() { s_frontendCounter -= 1; }
259     static bool hasFrontends() { return s_frontendCounter; }
260     static bool hasFrontendForScriptContext(ScriptExecutionContext*);
261     static bool collectingHTMLParseErrors(Page*);
262 #else
263     static bool hasFrontends() { return false; }
264     static bool hasFrontendForScriptContext(ScriptExecutionContext*) { return false; }
265     static bool collectingHTMLParseErrors(Page*) { return false; }
266 #endif
267
268 #if ENABLE(GEOLOCATION)
269     static GeolocationPosition* overrideGeolocationPosition(Page*, GeolocationPosition*);
270 #endif
271
272     static void registerInstrumentingAgents(InstrumentingAgents*);
273     static void unregisterInstrumentingAgents(InstrumentingAgents*);
274
275     static DeviceOrientationData* overrideDeviceOrientation(Page*, DeviceOrientationData*);
276
277 private:
278 #if ENABLE(INSPECTOR)
279     static void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
280     static bool isDebuggerPausedImpl(InstrumentingAgents*);
281
282     static void willInsertDOMNodeImpl(InstrumentingAgents*, Node* parent);
283     static void didInsertDOMNodeImpl(InstrumentingAgents*, Node*);
284     static void willRemoveDOMNodeImpl(InstrumentingAgents*, Node*);
285     static void didRemoveDOMNodeImpl(InstrumentingAgents*, Node*);
286     static void willModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& oldValue, const AtomicString& newValue);
287     static void didModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name, const AtomicString& value);
288     static void didRemoveDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name);
289     static void characterDataModifiedImpl(InstrumentingAgents*, CharacterData*);
290     static void didInvalidateStyleAttrImpl(InstrumentingAgents*, Node*);
291     static void frameWindowDiscardedImpl(InstrumentingAgents*, DOMWindow*);
292     static void mediaQueryResultChangedImpl(InstrumentingAgents*);
293     static void didPushShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
294     static void willPopShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
295     static void didCreateNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
296     static void willRemoveNamedFlowImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
297     static void didUpdateRegionLayoutImpl(InstrumentingAgents*, Document*, WebKitNamedFlow*);
298
299     static void mouseDidMoveOverElementImpl(InstrumentingAgents*, const HitTestResult&, unsigned modifierFlags);
300     static bool handleMousePressImpl(InstrumentingAgents*);
301     static bool forcePseudoStateImpl(InstrumentingAgents*, Element*, CSSSelector::PseudoType);
302
303     static void willSendXMLHttpRequestImpl(InstrumentingAgents*, const String& url);
304     static void didScheduleResourceRequestImpl(InstrumentingAgents*, const String& url, Frame*);
305     static void didInstallTimerImpl(InstrumentingAgents*, int timerId, int timeout, bool singleShot, ScriptExecutionContext*);
306     static void didRemoveTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*);
307
308     static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, const String& scriptName, int scriptLine, ScriptExecutionContext*);
309     static void didCallFunctionImpl(const InspectorInstrumentationCookie&);
310     static InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
311     static void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
312     static InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, const Event&, DOMWindow*, Node*, const Vector<EventContext>& ancestors, Document*);
313     static InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
314     static void didHandleEventImpl(const InspectorInstrumentationCookie&);
315     static void didDispatchEventImpl(const InspectorInstrumentationCookie&);
316     static InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents*, const Event&, DOMWindow*);
317     static void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
318     static InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, const String& url, int lineNumber, Frame*);
319     static void didEvaluateScriptImpl(const InspectorInstrumentationCookie&);
320     static void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, ScriptState*, SecurityOrigin*);
321     static InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents*, int timerId, ScriptExecutionContext*);
322     static void didFireTimerImpl(const InspectorInstrumentationCookie&);
323     static void didBeginFrameImpl(InstrumentingAgents*);
324     static void didCancelFrameImpl(InstrumentingAgents*);
325     static void didInvalidateLayoutImpl(InstrumentingAgents*, Frame*);
326     static InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*);
327     static void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
328     static void didScrollImpl(InstrumentingAgents*);
329     static InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, XMLHttpRequest*, ScriptExecutionContext*);
330     static void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
331     static InspectorInstrumentationCookie willPaintImpl(InstrumentingAgents*, GraphicsContext*, const LayoutRect&, Frame*);
332     static void didPaintImpl(const InspectorInstrumentationCookie&);
333     static void willCompositeImpl(InstrumentingAgents*);
334     static void didCompositeImpl(InstrumentingAgents*);
335     static InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Frame*);
336     static void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
337     static void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
338     static InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, const StyleRule*);
339     static void didMatchRuleImpl(const InspectorInstrumentationCookie&, bool matched);
340     static InspectorInstrumentationCookie willProcessRuleImpl(InstrumentingAgents*, const StyleRule*);
341     static void didProcessRuleImpl(const InspectorInstrumentationCookie&);
342     static void willProcessTaskImpl(InstrumentingAgents*);
343     static void didProcessTaskImpl(InstrumentingAgents*);
344
345     static void applyUserAgentOverrideImpl(InstrumentingAgents*, String*);
346     static void applyScreenWidthOverrideImpl(InstrumentingAgents*, long*);
347     static void applyScreenHeightOverrideImpl(InstrumentingAgents*, long*);
348     static bool shouldApplyScreenWidthOverrideImpl(InstrumentingAgents*);
349     static bool shouldApplyScreenHeightOverrideImpl(InstrumentingAgents*);
350     static void willSendRequestImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
351     static void continueAfterPingLoaderImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
352     static void markResourceAsCachedImpl(InstrumentingAgents*, unsigned long identifier);
353     static void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents*, DocumentLoader*, CachedResource*);
354     static InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, unsigned long identifier, Frame*, int length);
355     static void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
356     static InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents*, unsigned long identifier, const ResourceResponse&, Frame*);
357     static void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
358     static void didReceiveResourceResponseButCanceledImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
359     static void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
360     static void continueWithPolicyDownloadImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
361     static void continueWithPolicyIgnoreImpl(Frame*, DocumentLoader*, unsigned long identifier, const ResourceResponse&);
362     static void didReceiveDataImpl(InstrumentingAgents*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
363     static void didFinishLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, double finishTime);
364     static void didFailLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, const ResourceError&);
365     static void resourceRetrievedByXMLHttpRequestImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
366     static void didReceiveXHRResponseImpl(InstrumentingAgents*, unsigned long identifier);
367     static void willLoadXHRSynchronouslyImpl(InstrumentingAgents*);
368     static void didLoadXHRSynchronouslyImpl(InstrumentingAgents*);
369     static void scriptImportedImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString);
370     static void didReceiveScriptResponseImpl(InstrumentingAgents*, unsigned long identifier);
371     static void domContentLoadedEventFiredImpl(InstrumentingAgents*, Frame*);
372     static void loadEventFiredImpl(InstrumentingAgents*, Frame*);
373     static void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
374     static void didCommitLoadImpl(InstrumentingAgents*, Page*, DocumentLoader*);
375     static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
376     static void willDestroyCachedResourceImpl(CachedResource*);
377
378     static InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, unsigned int length, unsigned int startLine, Frame*);
379     static void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned int endLine);
380
381     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
382     static void addMessageToConsoleImpl(InstrumentingAgents*, MessageSource, MessageType, MessageLevel, const String& message, const String& scriptId, unsigned lineNumber);
383     static void consoleCountImpl(InstrumentingAgents*, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>);
384     static void startConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title);
385     static void stopConsoleTimingImpl(InstrumentingAgents*, Frame*, const String& title, PassRefPtr<ScriptCallStack>);
386     static void consoleTimeStampImpl(InstrumentingAgents*, Frame*, PassRefPtr<ScriptArguments>);
387
388     static void didRequestAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
389     static void didCancelAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
390     static InspectorInstrumentationCookie willFireAnimationFrameImpl(InstrumentingAgents*, int callbackId, Frame*);
391     static void didFireAnimationFrameImpl(const InspectorInstrumentationCookie&);
392
393 #if ENABLE(JAVASCRIPT_DEBUGGER)
394     static void addStartProfilingMessageToConsoleImpl(InstrumentingAgents*, const String& title, unsigned lineNumber, const String& sourceURL);
395     static void addProfileImpl(InstrumentingAgents*, RefPtr<ScriptProfile>, PassRefPtr<ScriptCallStack>);
396     static String getCurrentUserInitiatedProfileNameImpl(InstrumentingAgents*, bool incrementProfileNumber);
397     static bool profilerEnabledImpl(InstrumentingAgents*);
398 #endif
399
400 #if ENABLE(SQL_DATABASE)
401     static void didOpenDatabaseImpl(InstrumentingAgents*, PassRefPtr<Database>, const String& domain, const String& name, const String& version);
402 #endif
403
404     static void didUseDOMStorageImpl(InstrumentingAgents*, StorageArea*, bool isLocalStorage, Frame*);
405     static void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
406
407 #if ENABLE(WORKERS)
408     static bool shouldPauseDedicatedWorkerOnStartImpl(InstrumentingAgents*);
409     static void didStartWorkerContextImpl(InstrumentingAgents*, WorkerContextProxy*, const KURL&);
410     static void workerContextTerminatedImpl(InstrumentingAgents*, WorkerContextProxy*);
411 #endif
412
413 #if ENABLE(WEB_SOCKETS)
414     static void didCreateWebSocketImpl(InstrumentingAgents*, unsigned long identifier, const KURL& requestURL, const KURL& documentURL);
415     static void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeRequest&);
416     static void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketHandshakeResponse&);
417     static void didCloseWebSocketImpl(InstrumentingAgents*, unsigned long identifier);
418     static void didReceiveWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
419     static void didSendWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
420     static void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents*, unsigned long identifier, const String&);
421 #endif
422
423     static void networkStateChangedImpl(InstrumentingAgents*);
424     static void updateApplicationCacheStatusImpl(InstrumentingAgents*, Frame*);
425
426     static InstrumentingAgents* instrumentingAgentsForPage(Page*);
427     static InstrumentingAgents* instrumentingAgentsForFrame(Frame*);
428     static InstrumentingAgents* instrumentingAgentsForContext(ScriptExecutionContext*);
429     static InstrumentingAgents* instrumentingAgentsForDocument(Document*);
430 #if ENABLE(WORKERS)
431     static InstrumentingAgents* instrumentingAgentsForWorkerContext(WorkerContext*);
432     static InstrumentingAgents* instrumentingAgentsForNonDocumentContext(ScriptExecutionContext*);
433 #endif
434
435     static bool collectingHTMLParseErrors(InstrumentingAgents*);
436     static void pauseOnNativeEventIfNeeded(InstrumentingAgents*, bool isDOMEvent, const String& eventName, bool synchronous);
437     static void cancelPauseOnNativeEvent(InstrumentingAgents*);
438     static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
439
440 #if ENABLE(GEOLOCATION)
441     static GeolocationPosition* overrideGeolocationPositionImpl(InstrumentingAgents*, GeolocationPosition*);
442 #endif
443
444     static DeviceOrientationData* overrideDeviceOrientationImpl(InstrumentingAgents*, DeviceOrientationData*);
445     static int s_frontendCounter;
446 #endif
447 };
448
449 inline void InspectorInstrumentation::didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
450 {
451 #if ENABLE(INSPECTOR)
452     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
453         didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world);
454 #endif
455 }
456
457 inline bool InspectorInstrumentation::isDebuggerPaused(Frame* frame)
458 {
459 #if ENABLE(INSPECTOR)
460     FAST_RETURN_IF_NO_FRONTENDS(false);
461     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
462         return isDebuggerPausedImpl(instrumentingAgents);
463 #endif
464     return false;
465 }
466
467 inline void InspectorInstrumentation::willInsertDOMNode(Document* document, Node* parent)
468 {
469 #if ENABLE(INSPECTOR)
470     FAST_RETURN_IF_NO_FRONTENDS(void());
471     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
472         willInsertDOMNodeImpl(instrumentingAgents, parent);
473 #endif
474 }
475
476 inline void InspectorInstrumentation::didInsertDOMNode(Document* document, Node* node)
477 {
478 #if ENABLE(INSPECTOR)
479     FAST_RETURN_IF_NO_FRONTENDS(void());
480     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
481         didInsertDOMNodeImpl(instrumentingAgents, node);
482 #endif
483 }
484
485 inline void InspectorInstrumentation::willRemoveDOMNode(Document* document, Node* node)
486 {
487 #if ENABLE(INSPECTOR)
488     FAST_RETURN_IF_NO_FRONTENDS(void());
489     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document)) {
490         willRemoveDOMNodeImpl(instrumentingAgents, node);
491         didRemoveDOMNodeImpl(instrumentingAgents, node);
492     }
493 #endif
494 }
495
496 inline void InspectorInstrumentation::willModifyDOMAttr(Document* document, Element* element, const AtomicString& oldValue, const AtomicString& newValue)
497 {
498 #if ENABLE(INSPECTOR)
499     FAST_RETURN_IF_NO_FRONTENDS(void());
500     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
501         willModifyDOMAttrImpl(instrumentingAgents, element, oldValue, newValue);
502 #endif
503 }
504
505 inline void InspectorInstrumentation::didModifyDOMAttr(Document* document, Element* element, const AtomicString& name, const AtomicString& value)
506 {
507 #if ENABLE(INSPECTOR)
508     FAST_RETURN_IF_NO_FRONTENDS(void());
509     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
510         didModifyDOMAttrImpl(instrumentingAgents, element, name, value);
511 #endif
512 }
513
514 inline void InspectorInstrumentation::didRemoveDOMAttr(Document* document, Element* element, const AtomicString& name)
515 {
516 #if ENABLE(INSPECTOR)
517     FAST_RETURN_IF_NO_FRONTENDS(void());
518     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
519         didRemoveDOMAttrImpl(instrumentingAgents, element, name);
520 #endif
521 }
522
523 inline void InspectorInstrumentation::didInvalidateStyleAttr(Document* document, Node* node)
524 {
525 #if ENABLE(INSPECTOR)
526     FAST_RETURN_IF_NO_FRONTENDS(void());
527     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
528         didInvalidateStyleAttrImpl(instrumentingAgents, node);
529 #endif
530 }
531
532 inline void InspectorInstrumentation::frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
533 {
534 #if ENABLE(INSPECTOR)
535     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
536         frameWindowDiscardedImpl(instrumentingAgents, domWindow);
537 #endif
538 }
539
540 inline void InspectorInstrumentation::mediaQueryResultChanged(Document* document)
541 {
542 #if ENABLE(INSPECTOR)
543     FAST_RETURN_IF_NO_FRONTENDS(void());
544     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
545         mediaQueryResultChangedImpl(instrumentingAgents);
546 #endif
547 }
548
549 inline void InspectorInstrumentation::didPushShadowRoot(Element* host, ShadowRoot* root)
550 {
551 #if ENABLE(INSPECTOR)
552     FAST_RETURN_IF_NO_FRONTENDS(void());
553     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host->ownerDocument()))
554         didPushShadowRootImpl(instrumentingAgents, host, root);
555 #endif
556 }
557
558 inline void InspectorInstrumentation::willPopShadowRoot(Element* host, ShadowRoot* root)
559 {
560 #if ENABLE(INSPECTOR)
561     FAST_RETURN_IF_NO_FRONTENDS(void());
562     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(host->ownerDocument()))
563         willPopShadowRootImpl(instrumentingAgents, host, root);
564 #endif
565 }
566
567 inline void InspectorInstrumentation::didCreateNamedFlow(Document* document, WebKitNamedFlow* namedFlow)
568 {
569 #if ENABLE(INSPECTOR)
570     FAST_RETURN_IF_NO_FRONTENDS(void());
571     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
572         didCreateNamedFlowImpl(instrumentingAgents, document, namedFlow);
573 #endif
574 }
575
576 inline void InspectorInstrumentation::willRemoveNamedFlow(Document* document, WebKitNamedFlow* namedFlow)
577 {
578 #if ENABLE(INSPECTOR)
579     FAST_RETURN_IF_NO_FRONTENDS(void());
580     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
581         willRemoveNamedFlowImpl(instrumentingAgents, document, namedFlow);
582 #endif
583 }
584
585 inline void InspectorInstrumentation::didUpdateRegionLayout(Document* document, WebKitNamedFlow* namedFlow)
586 {
587 #if ENABLE(INSPECTOR)
588     FAST_RETURN_IF_NO_FRONTENDS(void());
589     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
590         didUpdateRegionLayoutImpl(instrumentingAgents, document, namedFlow);
591 #endif
592 }
593
594 inline void InspectorInstrumentation::mouseDidMoveOverElement(Page* page, const HitTestResult& result, unsigned modifierFlags)
595 {
596 #if ENABLE(INSPECTOR)
597     FAST_RETURN_IF_NO_FRONTENDS(void());
598     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
599         mouseDidMoveOverElementImpl(instrumentingAgents, result, modifierFlags);
600 #endif
601 }
602
603 inline bool InspectorInstrumentation::handleMousePress(Page* page)
604 {
605 #if ENABLE(INSPECTOR)
606     FAST_RETURN_IF_NO_FRONTENDS(false);
607     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
608         return handleMousePressImpl(instrumentingAgents);
609 #endif
610     return false;
611 }
612
613 inline bool InspectorInstrumentation::forcePseudoState(Element* element, CSSSelector::PseudoType pseudoState)
614 {
615 #if ENABLE(INSPECTOR)
616     FAST_RETURN_IF_NO_FRONTENDS(false);
617     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(element->document()))
618         return forcePseudoStateImpl(instrumentingAgents, element, pseudoState);
619 #endif
620     return false;
621 }
622
623 inline void InspectorInstrumentation::characterDataModified(Document* document, CharacterData* characterData)
624 {
625 #if ENABLE(INSPECTOR)
626     FAST_RETURN_IF_NO_FRONTENDS(void());
627     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
628         characterDataModifiedImpl(instrumentingAgents, characterData);
629 #endif
630 }
631
632 inline void InspectorInstrumentation::willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
633 {
634 #if ENABLE(INSPECTOR)
635     FAST_RETURN_IF_NO_FRONTENDS(void());
636     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
637         willSendXMLHttpRequestImpl(instrumentingAgents, url);
638 #endif
639 }
640
641 inline void InspectorInstrumentation::didScheduleResourceRequest(Document* document, const String& url)
642 {
643 #if ENABLE(INSPECTOR)
644     FAST_RETURN_IF_NO_FRONTENDS(void());
645     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
646         didScheduleResourceRequestImpl(instrumentingAgents, url, document->frame());
647 #endif
648 }
649
650 inline void InspectorInstrumentation::didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
651 {
652 #if ENABLE(INSPECTOR)
653     FAST_RETURN_IF_NO_FRONTENDS(void());
654     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
655         didInstallTimerImpl(instrumentingAgents, timerId, timeout, singleShot, context);
656 #endif
657 }
658
659 inline void InspectorInstrumentation::didRemoveTimer(ScriptExecutionContext* context, int timerId)
660 {
661 #if ENABLE(INSPECTOR)
662     FAST_RETURN_IF_NO_FRONTENDS(void());
663     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
664         didRemoveTimerImpl(instrumentingAgents, timerId, context);
665 #endif
666 }
667
668 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
669 {
670 #if ENABLE(INSPECTOR)
671     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
672     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
673         return willCallFunctionImpl(instrumentingAgents, scriptName, scriptLine, context);
674 #endif
675     return InspectorInstrumentationCookie();
676 }
677
678
679 inline void InspectorInstrumentation::didCallFunction(const InspectorInstrumentationCookie& cookie)
680 {
681 #if ENABLE(INSPECTOR)
682     FAST_RETURN_IF_NO_FRONTENDS(void());
683     if (cookie.first)
684         didCallFunctionImpl(cookie);
685 #endif
686 }
687
688 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
689 {
690 #if ENABLE(INSPECTOR)
691     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
692     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
693         return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, request, context);
694 #endif
695     return InspectorInstrumentationCookie();
696 }
697
698 inline void InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
699 {
700 #if ENABLE(INSPECTOR)
701     FAST_RETURN_IF_NO_FRONTENDS(void());
702     if (cookie.first)
703         didDispatchXHRReadyStateChangeEventImpl(cookie);
704 #endif
705 }
706
707 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const Vector<EventContext>& ancestors)
708 {
709 #if ENABLE(INSPECTOR)
710     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
711     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
712         return willDispatchEventImpl(instrumentingAgents, event, window, node, ancestors, document);
713 #endif
714     return InspectorInstrumentationCookie();
715 }
716
717 inline void InspectorInstrumentation::didDispatchEvent(const InspectorInstrumentationCookie& cookie)
718 {
719 #if ENABLE(INSPECTOR)
720     FAST_RETURN_IF_NO_FRONTENDS(void());
721     if (cookie.first)
722         didDispatchEventImpl(cookie);
723 #endif
724 }
725
726 inline InspectorInstrumentationCookie InspectorInstrumentation::willHandleEvent(ScriptExecutionContext* context, Event* event)
727 {
728 #if ENABLE(INSPECTOR)
729     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
730     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
731         return willHandleEventImpl(instrumentingAgents, event);
732 #endif
733     return InspectorInstrumentationCookie();
734 }
735
736 inline void InspectorInstrumentation::didHandleEvent(const InspectorInstrumentationCookie& cookie)
737 {
738 #if ENABLE(INSPECTOR)
739     FAST_RETURN_IF_NO_FRONTENDS(void());
740     if (cookie.first)
741         didHandleEventImpl(cookie);
742 #endif
743 }
744
745 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindow(Frame* frame, const Event& event, DOMWindow* window)
746 {
747 #if ENABLE(INSPECTOR)
748     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
749     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
750         return willDispatchEventOnWindowImpl(instrumentingAgents, event, window);
751 #endif
752     return InspectorInstrumentationCookie();
753 }
754
755 inline void InspectorInstrumentation::didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie)
756 {
757 #if ENABLE(INSPECTOR)
758     FAST_RETURN_IF_NO_FRONTENDS(void());
759     if (cookie.first)
760         didDispatchEventOnWindowImpl(cookie);
761 #endif
762 }
763
764 inline InspectorInstrumentationCookie InspectorInstrumentation::willEvaluateScript(Frame* frame, const String& url, int lineNumber)
765 {
766 #if ENABLE(INSPECTOR)
767     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
768     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
769         return willEvaluateScriptImpl(instrumentingAgents, url, lineNumber, frame);
770 #endif
771     return InspectorInstrumentationCookie();
772 }
773
774 inline void InspectorInstrumentation::didEvaluateScript(const InspectorInstrumentationCookie& cookie)
775 {
776 #if ENABLE(INSPECTOR)
777     FAST_RETURN_IF_NO_FRONTENDS(void());
778     if (cookie.first)
779         didEvaluateScriptImpl(cookie);
780 #endif
781 }
782
783 inline void InspectorInstrumentation::didCreateIsolatedContext(Frame* frame, ScriptState* scriptState, SecurityOrigin* origin)
784 {
785 #if ENABLE(INSPECTOR)
786     FAST_RETURN_IF_NO_FRONTENDS(void());
787     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
788         return didCreateIsolatedContextImpl(instrumentingAgents, frame, scriptState, origin);
789 #endif
790 }
791
792 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireTimer(ScriptExecutionContext* context, int timerId)
793 {
794 #if ENABLE(INSPECTOR)
795     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
796     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
797         return willFireTimerImpl(instrumentingAgents, timerId, context);
798 #endif
799     return InspectorInstrumentationCookie();
800 }
801
802 inline void InspectorInstrumentation::didFireTimer(const InspectorInstrumentationCookie& cookie)
803 {
804 #if ENABLE(INSPECTOR)
805     FAST_RETURN_IF_NO_FRONTENDS(void());
806     if (cookie.first)
807         didFireTimerImpl(cookie);
808 #endif
809 }
810
811 inline void InspectorInstrumentation::didBeginFrame(Page* page)
812 {
813 #if ENABLE(INSPECTOR)
814     FAST_RETURN_IF_NO_FRONTENDS(void());
815     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
816         didBeginFrameImpl(instrumentingAgents);
817 #endif
818 }
819
820 inline void InspectorInstrumentation::didCancelFrame(Page* page)
821 {
822 #if ENABLE(INSPECTOR)
823     FAST_RETURN_IF_NO_FRONTENDS(void());
824     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
825         didCancelFrameImpl(instrumentingAgents);
826 #endif
827 }
828
829 inline void InspectorInstrumentation::didInvalidateLayout(Frame* frame)
830 {
831 #if ENABLE(INSPECTOR)
832     FAST_RETURN_IF_NO_FRONTENDS(void());
833     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
834         didInvalidateLayoutImpl(instrumentingAgents, frame);
835 #endif
836 }
837
838 inline InspectorInstrumentationCookie InspectorInstrumentation::willLayout(Frame* frame)
839 {
840 #if ENABLE(INSPECTOR)
841     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
842     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
843         return willLayoutImpl(instrumentingAgents, frame);
844 #endif
845     return InspectorInstrumentationCookie();
846 }
847
848 inline void InspectorInstrumentation::didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root)
849 {
850 #if ENABLE(INSPECTOR)
851     FAST_RETURN_IF_NO_FRONTENDS(void());
852     if (cookie.first)
853         didLayoutImpl(cookie, root);
854 #endif
855 }
856
857 inline void InspectorInstrumentation::didScroll(Page* page)
858 {
859 #if ENABLE(INSPECTOR)
860     FAST_RETURN_IF_NO_FRONTENDS(void());
861     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
862         didScrollImpl(instrumentingAgents);
863 #endif
864 }
865
866 inline InspectorInstrumentationCookie InspectorInstrumentation::willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
867 {
868 #if ENABLE(INSPECTOR)
869     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
870     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
871         return willDispatchXHRLoadEventImpl(instrumentingAgents, request, context);
872 #endif
873     return InspectorInstrumentationCookie();
874 }
875
876 inline void InspectorInstrumentation::didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
877 {
878 #if ENABLE(INSPECTOR)
879     FAST_RETURN_IF_NO_FRONTENDS(void());
880     if (cookie.first)
881         didDispatchXHRLoadEventImpl(cookie);
882 #endif
883 }
884
885 inline InspectorInstrumentationCookie InspectorInstrumentation::willPaint(Frame* frame, GraphicsContext* context, const LayoutRect& rect)
886 {
887 #if ENABLE(INSPECTOR)
888     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
889     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
890         return willPaintImpl(instrumentingAgents, context, rect, frame);
891 #endif
892     return InspectorInstrumentationCookie();
893 }
894
895 inline void InspectorInstrumentation::didPaint(const InspectorInstrumentationCookie& cookie)
896 {
897 #if ENABLE(INSPECTOR)
898     FAST_RETURN_IF_NO_FRONTENDS(void());
899     if (cookie.first)
900         didPaintImpl(cookie);
901 #endif
902 }
903
904 inline void InspectorInstrumentation::willComposite(Page* page)
905 {
906 #if ENABLE(INSPECTOR)
907     FAST_RETURN_IF_NO_FRONTENDS(void());
908     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
909         willCompositeImpl(instrumentingAgents);
910 #endif
911 }
912
913 inline void InspectorInstrumentation::didComposite(Page* page)
914 {
915 #if ENABLE(INSPECTOR)
916     FAST_RETURN_IF_NO_FRONTENDS(void());
917     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
918         didCompositeImpl(instrumentingAgents);
919 #endif
920 }
921
922 inline InspectorInstrumentationCookie InspectorInstrumentation::willRecalculateStyle(Document* document)
923 {
924 #if ENABLE(INSPECTOR)
925     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
926     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
927         return willRecalculateStyleImpl(instrumentingAgents, document->frame());
928 #endif
929     return InspectorInstrumentationCookie();
930 }
931
932 inline void InspectorInstrumentation::didRecalculateStyle(const InspectorInstrumentationCookie& cookie)
933 {
934 #if ENABLE(INSPECTOR)
935     FAST_RETURN_IF_NO_FRONTENDS(void());
936     if (cookie.first)
937         didRecalculateStyleImpl(cookie);
938 #endif
939 }
940
941 inline void InspectorInstrumentation::didScheduleStyleRecalculation(Document* document)
942 {
943 #if ENABLE(INSPECTOR)
944     FAST_RETURN_IF_NO_FRONTENDS(void());
945     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
946         didScheduleStyleRecalculationImpl(instrumentingAgents, document);
947 #endif
948 }
949
950 inline InspectorInstrumentationCookie InspectorInstrumentation::willMatchRule(Document* document, const StyleRule* rule)
951 {
952 #if ENABLE(INSPECTOR)
953     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
954     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
955         return willMatchRuleImpl(instrumentingAgents, rule);
956 #endif
957     return InspectorInstrumentationCookie();
958 }
959
960 inline void InspectorInstrumentation::didMatchRule(const InspectorInstrumentationCookie& cookie, bool matched)
961 {
962 #if ENABLE(INSPECTOR)
963     FAST_RETURN_IF_NO_FRONTENDS(void());
964     if (cookie.first)
965         didMatchRuleImpl(cookie, matched);
966 #endif
967 }
968
969 inline InspectorInstrumentationCookie InspectorInstrumentation::willProcessRule(Document* document, const StyleRule* rule)
970 {
971 #if ENABLE(INSPECTOR)
972     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
973     if (!rule)
974         return InspectorInstrumentationCookie();
975     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
976         return willProcessRuleImpl(instrumentingAgents, rule);
977 #endif
978     return InspectorInstrumentationCookie();
979 }
980
981 inline void InspectorInstrumentation::didProcessRule(const InspectorInstrumentationCookie& cookie)
982 {
983 #if ENABLE(INSPECTOR)
984     FAST_RETURN_IF_NO_FRONTENDS(void());
985     if (cookie.first)
986         didProcessRuleImpl(cookie);
987 #endif
988 }
989
990 inline void InspectorInstrumentation::willProcessTask(Page* page)
991 {
992 #if ENABLE(INSPECTOR)
993     FAST_RETURN_IF_NO_FRONTENDS(void());
994     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
995         willProcessTaskImpl(instrumentingAgents);
996 #endif
997 }
998
999 inline void InspectorInstrumentation::didProcessTask(Page* page)
1000 {
1001 #if ENABLE(INSPECTOR)
1002     FAST_RETURN_IF_NO_FRONTENDS(void());
1003     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1004         didProcessTaskImpl(instrumentingAgents);
1005 #endif
1006 }
1007
1008 inline void InspectorInstrumentation::applyUserAgentOverride(Frame* frame, String* userAgent)
1009 {
1010 #if ENABLE(INSPECTOR)
1011     FAST_RETURN_IF_NO_FRONTENDS(void());
1012     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1013         applyUserAgentOverrideImpl(instrumentingAgents, userAgent);
1014 #endif
1015 }
1016
1017 inline void InspectorInstrumentation::applyScreenWidthOverride(Frame* frame, long* width)
1018 {
1019 #if ENABLE(INSPECTOR)
1020     FAST_RETURN_IF_NO_FRONTENDS(void());
1021     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1022         applyScreenWidthOverrideImpl(instrumentingAgents, width);
1023 #endif
1024 }
1025
1026 inline void InspectorInstrumentation::applyScreenHeightOverride(Frame* frame, long* height)
1027 {
1028 #if ENABLE(INSPECTOR)
1029     FAST_RETURN_IF_NO_FRONTENDS(void());
1030     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1031         applyScreenHeightOverrideImpl(instrumentingAgents, height);
1032 #endif
1033 }
1034
1035 inline bool InspectorInstrumentation::shouldApplyScreenWidthOverride(Frame* frame)
1036 {
1037 #if ENABLE(INSPECTOR)
1038     FAST_RETURN_IF_NO_FRONTENDS(false);
1039     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1040         return shouldApplyScreenWidthOverrideImpl(instrumentingAgents);
1041 #endif
1042     return false;
1043 }
1044
1045 inline bool InspectorInstrumentation::shouldApplyScreenHeightOverride(Frame* frame)
1046 {
1047 #if ENABLE(INSPECTOR)
1048     FAST_RETURN_IF_NO_FRONTENDS(false);
1049     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1050         return shouldApplyScreenHeightOverrideImpl(instrumentingAgents);
1051 #endif
1052     return false;
1053 }
1054
1055 inline void InspectorInstrumentation::willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
1056 {
1057 #if ENABLE(INSPECTOR)
1058     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1059         willSendRequestImpl(instrumentingAgents, identifier, loader, request, redirectResponse);
1060 #endif
1061 }
1062
1063 inline void InspectorInstrumentation::continueAfterPingLoader(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)
1064 {
1065 #if ENABLE(INSPECTOR)
1066     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1067         InspectorInstrumentation::continueAfterPingLoaderImpl(instrumentingAgents, identifier, loader, request, response);
1068 #endif
1069 }
1070
1071 inline void InspectorInstrumentation::markResourceAsCached(Page* page, unsigned long identifier)
1072 {
1073 #if ENABLE(INSPECTOR)
1074     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1075         markResourceAsCachedImpl(instrumentingAgents, identifier);
1076 #endif
1077 }
1078
1079 inline void InspectorInstrumentation::didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, CachedResource* resource)
1080 {
1081 #if ENABLE(INSPECTOR)
1082     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1083         didLoadResourceFromMemoryCacheImpl(instrumentingAgents, loader, resource);
1084 #endif
1085 }
1086
1087 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceData(Frame* frame, unsigned long identifier, int length)
1088 {
1089 #if ENABLE(INSPECTOR)
1090     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1091     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1092         return willReceiveResourceDataImpl(instrumentingAgents, identifier, frame, length);
1093 #endif
1094     return InspectorInstrumentationCookie();
1095 }
1096
1097 inline void InspectorInstrumentation::didReceiveResourceData(const InspectorInstrumentationCookie& cookie)
1098 {
1099 #if ENABLE(INSPECTOR)
1100     FAST_RETURN_IF_NO_FRONTENDS(void());
1101     if (cookie.first)
1102         didReceiveResourceDataImpl(cookie);
1103 #endif
1104 }
1105
1106 inline InspectorInstrumentationCookie InspectorInstrumentation::willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
1107 {
1108 #if ENABLE(INSPECTOR)
1109     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1110         return willReceiveResourceResponseImpl(instrumentingAgents, identifier, response, frame);
1111 #endif
1112     return InspectorInstrumentationCookie();
1113 }
1114
1115 inline void InspectorInstrumentation::didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
1116 {
1117 #if ENABLE(INSPECTOR)
1118     // Call this unconditionally so that we're able to log to console with no front-end attached.
1119     didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
1120 #endif
1121 }
1122
1123 inline void InspectorInstrumentation::continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1124 {
1125 #if ENABLE(INSPECTOR)
1126     FAST_RETURN_IF_NO_FRONTENDS(void());
1127     InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
1128 #endif
1129 }
1130
1131 inline void InspectorInstrumentation::continueWithPolicyDownload(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1132 {
1133 #if ENABLE(INSPECTOR)
1134     FAST_RETURN_IF_NO_FRONTENDS(void());
1135     InspectorInstrumentation::continueWithPolicyDownloadImpl(frame, loader, identifier, r);
1136 #endif
1137 }
1138
1139 inline void InspectorInstrumentation::continueWithPolicyIgnore(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
1140 {
1141 #if ENABLE(INSPECTOR)
1142     FAST_RETURN_IF_NO_FRONTENDS(void());
1143     InspectorInstrumentation::continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
1144 #endif
1145 }
1146
1147 inline void InspectorInstrumentation::didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
1148 {
1149 #if ENABLE(INSPECTOR)
1150     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1151         didReceiveDataImpl(instrumentingAgents, identifier, data, dataLength, encodedDataLength);
1152 #endif
1153 }
1154
1155 inline void InspectorInstrumentation::didFinishLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, double finishTime)
1156 {
1157 #if ENABLE(INSPECTOR)
1158     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1159         didFinishLoadingImpl(instrumentingAgents, identifier, loader, finishTime);
1160 #endif
1161 }
1162
1163 inline void InspectorInstrumentation::didFailLoading(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceError& error)
1164 {
1165 #if ENABLE(INSPECTOR)
1166     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1167         didFailLoadingImpl(instrumentingAgents, identifier, loader, error);
1168 #endif
1169 }
1170
1171 inline void InspectorInstrumentation::resourceRetrievedByXMLHttpRequest(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
1172 {
1173 #if ENABLE(INSPECTOR)
1174     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1175         resourceRetrievedByXMLHttpRequestImpl(instrumentingAgents, identifier, sourceString, url, sendURL, sendLineNumber);
1176 #endif
1177 }
1178
1179 inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier)
1180 {
1181 #if ENABLE(INSPECTOR)
1182     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1183         didReceiveXHRResponseImpl(instrumentingAgents, identifier);
1184 #endif
1185 }
1186
1187 inline void InspectorInstrumentation::willLoadXHRSynchronously(ScriptExecutionContext* context)
1188 {
1189 #if ENABLE(INSPECTOR)
1190     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1191         willLoadXHRSynchronouslyImpl(instrumentingAgents);
1192 #endif
1193 }
1194
1195 inline void InspectorInstrumentation::didLoadXHRSynchronously(ScriptExecutionContext* context)
1196 {
1197 #if ENABLE(INSPECTOR)
1198     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1199         didLoadXHRSynchronouslyImpl(instrumentingAgents);
1200 #endif
1201 }
1202
1203 inline void InspectorInstrumentation::scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
1204 {
1205 #if ENABLE(INSPECTOR)
1206     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1207         scriptImportedImpl(instrumentingAgents, identifier, sourceString);
1208 #endif
1209 }
1210
1211 inline void InspectorInstrumentation::didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
1212 {
1213 #if ENABLE(INSPECTOR)
1214     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1215         didReceiveScriptResponseImpl(instrumentingAgents, identifier);
1216 #endif
1217 }
1218
1219 inline void InspectorInstrumentation::domContentLoadedEventFired(Frame* frame)
1220 {
1221 #if ENABLE(INSPECTOR)
1222     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1223         domContentLoadedEventFiredImpl(instrumentingAgents, frame);
1224 #endif
1225 }
1226
1227 inline void InspectorInstrumentation::loadEventFired(Frame* frame)
1228 {
1229 #if ENABLE(INSPECTOR)
1230     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1231         loadEventFiredImpl(instrumentingAgents, frame);
1232 #endif
1233 }
1234
1235 inline void InspectorInstrumentation::frameDetachedFromParent(Frame* frame)
1236 {
1237 #if ENABLE(INSPECTOR)
1238     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1239         frameDetachedFromParentImpl(instrumentingAgents, frame);
1240 #endif
1241 }
1242
1243 inline void InspectorInstrumentation::didCommitLoad(Frame* frame, DocumentLoader* loader)
1244 {
1245 #if ENABLE(INSPECTOR)
1246     if (!frame)
1247         return;
1248     Page* page = frame->page();
1249     if (!page)
1250         return;
1251     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1252         didCommitLoadImpl(instrumentingAgents, page, loader);
1253 #endif
1254 }
1255
1256 inline void InspectorInstrumentation::loaderDetachedFromFrame(Frame* frame, DocumentLoader* loader)
1257 {
1258 #if ENABLE(INSPECTOR)
1259     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1260         loaderDetachedFromFrameImpl(instrumentingAgents, loader);
1261 #endif
1262 }
1263
1264 inline void InspectorInstrumentation::willDestroyCachedResource(CachedResource* cachedResource)
1265 {
1266 #if ENABLE(INSPECTOR)
1267     FAST_RETURN_IF_NO_FRONTENDS(void());
1268     willDestroyCachedResourceImpl(cachedResource);
1269 #endif
1270 }
1271
1272 inline InspectorInstrumentationCookie InspectorInstrumentation::willWriteHTML(Document* document, unsigned int length, unsigned int startLine)
1273 {
1274 #if ENABLE(INSPECTOR)
1275     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
1276     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1277         return willWriteHTMLImpl(instrumentingAgents, length, startLine, document->frame());
1278 #endif
1279     return InspectorInstrumentationCookie();
1280 }
1281
1282 inline void InspectorInstrumentation::didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned int endLine)
1283 {
1284 #if ENABLE(INSPECTOR)
1285     FAST_RETURN_IF_NO_FRONTENDS(void());
1286     if (cookie.first)
1287         didWriteHTMLImpl(cookie, endLine);
1288 #endif
1289 }
1290
1291 inline void InspectorInstrumentation::didUseDOMStorage(Page* page, StorageArea* storageArea, bool isLocalStorage, Frame* frame)
1292 {
1293 #if ENABLE(INSPECTOR)
1294     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1295         didUseDOMStorageImpl(instrumentingAgents, storageArea, isLocalStorage, frame);
1296 #endif
1297 }
1298
1299 inline void InspectorInstrumentation::didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Page* page)
1300 {
1301 #if ENABLE(INSPECTOR)
1302     FAST_RETURN_IF_NO_FRONTENDS(void());
1303     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1304         didDispatchDOMStorageEventImpl(instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin, page);
1305 #endif // ENABLE(INSPECTOR)
1306 }
1307
1308 #if ENABLE(WORKERS)
1309 inline bool InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(ScriptExecutionContext* context)
1310 {
1311 #if ENABLE(INSPECTOR)
1312     FAST_RETURN_IF_NO_FRONTENDS(false);
1313     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1314         return shouldPauseDedicatedWorkerOnStartImpl(instrumentingAgents);
1315 #endif
1316     return false;
1317 }
1318
1319 inline void InspectorInstrumentation::didStartWorkerContext(ScriptExecutionContext* context, WorkerContextProxy* proxy, const KURL& url)
1320 {
1321 #if ENABLE(INSPECTOR)
1322     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1323         didStartWorkerContextImpl(instrumentingAgents, proxy, url);
1324 #endif
1325 }
1326
1327 inline void InspectorInstrumentation::workerContextTerminated(ScriptExecutionContext* context, WorkerContextProxy* proxy)
1328 {
1329 #if ENABLE(INSPECTOR)
1330     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1331         workerContextTerminatedImpl(instrumentingAgents, proxy);
1332 #endif
1333 }
1334
1335 #endif
1336
1337
1338 #if ENABLE(WEB_SOCKETS)
1339 inline void InspectorInstrumentation::didCreateWebSocket(ScriptExecutionContext* context, unsigned long identifier, const KURL& requestURL, const KURL& documentURL)
1340 {
1341 #if ENABLE(INSPECTOR)
1342     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1343         didCreateWebSocketImpl(instrumentingAgents, identifier, requestURL, documentURL);
1344 #endif
1345 }
1346
1347 inline void InspectorInstrumentation::willSendWebSocketHandshakeRequest(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeRequest& request)
1348 {
1349 #if ENABLE(INSPECTOR)
1350     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1351         willSendWebSocketHandshakeRequestImpl(instrumentingAgents, identifier, request);
1352 #endif
1353 }
1354
1355 inline void InspectorInstrumentation::didReceiveWebSocketHandshakeResponse(ScriptExecutionContext* context, unsigned long identifier, const WebSocketHandshakeResponse& response)
1356 {
1357 #if ENABLE(INSPECTOR)
1358     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1359         didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, identifier, response);
1360 #endif
1361 }
1362
1363 inline void InspectorInstrumentation::didCloseWebSocket(ScriptExecutionContext* context, unsigned long identifier)
1364 {
1365 #if ENABLE(INSPECTOR)
1366     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
1367         didCloseWebSocketImpl(instrumentingAgents, identifier);
1368 #endif
1369 }
1370 inline void InspectorInstrumentation::didReceiveWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1371 {
1372 #if ENABLE(INSPECTOR)
1373     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1374         didReceiveWebSocketFrameImpl(instrumentingAgents, identifier, frame);
1375 #endif
1376 }
1377 inline void InspectorInstrumentation::didReceiveWebSocketFrameError(Document* document, unsigned long identifier, const String& errorMessage)
1378 {
1379 #if ENABLE(INSPECTOR)
1380     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1381         didReceiveWebSocketFrameErrorImpl(instrumentingAgents, identifier, errorMessage);
1382 #endif
1383 }
1384 inline void InspectorInstrumentation::didSendWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
1385 {
1386 #if ENABLE(INSPECTOR)
1387     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1388         didSendWebSocketFrameImpl(instrumentingAgents, identifier, frame);
1389 #endif
1390 }
1391 #endif
1392
1393 inline void InspectorInstrumentation::networkStateChanged(Page* page)
1394 {
1395 #if ENABLE(INSPECTOR)
1396     FAST_RETURN_IF_NO_FRONTENDS(void());
1397     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1398         networkStateChangedImpl(instrumentingAgents);
1399 #endif
1400 }
1401
1402 inline void InspectorInstrumentation::updateApplicationCacheStatus(Frame* frame)
1403 {
1404 #if ENABLE(INSPECTOR)
1405     FAST_RETURN_IF_NO_FRONTENDS(void());
1406     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
1407         updateApplicationCacheStatusImpl(instrumentingAgents, frame);
1408 #endif
1409 }
1410
1411 inline void InspectorInstrumentation::didRequestAnimationFrame(Document* document, int callbackId)
1412 {
1413 #if ENABLE(INSPECTOR)
1414     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1415         didRequestAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1416 #endif
1417 }
1418
1419 inline void InspectorInstrumentation::didCancelAnimationFrame(Document* document, int callbackId)
1420 {
1421 #if ENABLE(INSPECTOR)
1422     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1423         didCancelAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1424 #endif
1425 }
1426
1427 inline InspectorInstrumentationCookie InspectorInstrumentation::willFireAnimationFrame(Document* document, int callbackId)
1428 {
1429 #if ENABLE(INSPECTOR)
1430     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
1431         return willFireAnimationFrameImpl(instrumentingAgents, callbackId, document->frame());
1432 #endif
1433     return InspectorInstrumentationCookie();
1434 }
1435
1436 inline void InspectorInstrumentation::didFireAnimationFrame(const InspectorInstrumentationCookie& cookie)
1437 {
1438 #if ENABLE(INSPECTOR)
1439     FAST_RETURN_IF_NO_FRONTENDS(void());
1440     if (cookie.first)
1441         didFireAnimationFrameImpl(cookie);
1442 #endif
1443 }
1444
1445 #if ENABLE(GEOLOCATION)
1446 inline GeolocationPosition* InspectorInstrumentation::overrideGeolocationPosition(Page* page, GeolocationPosition* position)
1447 {
1448 #if ENABLE(INSPECTOR)
1449     FAST_RETURN_IF_NO_FRONTENDS(position);
1450     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1451         return overrideGeolocationPositionImpl(instrumentingAgents, position);
1452 #endif
1453     return position;
1454 }
1455 #endif
1456
1457 inline DeviceOrientationData* InspectorInstrumentation::overrideDeviceOrientation(Page* page, DeviceOrientationData* deviceOrientation)
1458 {
1459 #if ENABLE(INSPECTOR)
1460     FAST_RETURN_IF_NO_FRONTENDS(deviceOrientation);
1461     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1462         return overrideDeviceOrientationImpl(instrumentingAgents, deviceOrientation);
1463 #endif
1464     return deviceOrientation;
1465 }
1466
1467 #if ENABLE(INSPECTOR)
1468 inline bool InspectorInstrumentation::collectingHTMLParseErrors(Page* page)
1469 {
1470     FAST_RETURN_IF_NO_FRONTENDS(false);
1471     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
1472         return collectingHTMLParseErrors(instrumentingAgents);
1473     return false;
1474 }
1475
1476 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForContext(ScriptExecutionContext* context)
1477 {
1478     if (!context)
1479         return 0;
1480     if (context->isDocument())
1481         return instrumentingAgentsForPage(static_cast<Document*>(context)->page());
1482 #if ENABLE(WORKERS)
1483     return instrumentingAgentsForNonDocumentContext(context);
1484 #else
1485     return 0;
1486 #endif
1487 }
1488
1489 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForFrame(Frame* frame)
1490 {
1491     if (frame)
1492         return instrumentingAgentsForPage(frame->page());
1493     return 0;
1494 }
1495
1496 inline InstrumentingAgents* InspectorInstrumentation::instrumentingAgentsForDocument(Document* document)
1497 {
1498     if (document)
1499         return instrumentingAgentsForPage(document->page());
1500     return 0;
1501 }
1502 #endif
1503
1504 } // namespace WebCore
1505
1506 #endif // !defined(InspectorInstrumentation_h)