blob: 69cafffe5d879f3ea90639b155ca1ed58f9bc1c6 [file] [log] [blame]
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +01001/*
2* Copyright (C) 2013 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_inl_h
32#define InspectorInstrumentation_inl_h
33
34namespace WebCore {
35
36namespace InspectorInstrumentation {
37
38void didClearWindowObjectInWorldImpl(InstrumentingAgents*, Frame*, DOMWrapperWorld*);
39void willInsertDOMNodeImpl(InstrumentingAgents*, Node* parent);
40void didInsertDOMNodeImpl(InstrumentingAgents*, Node*);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +010041void willRemoveDOMNodeImpl(InstrumentingAgents*, Node*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010042void willModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& oldValue, const AtomicString& newValue);
43void didModifyDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name, const AtomicString& value);
44void didRemoveDOMAttrImpl(InstrumentingAgents*, Element*, const AtomicString& name);
45void characterDataModifiedImpl(InstrumentingAgents*, CharacterData*);
46void didInvalidateStyleAttrImpl(InstrumentingAgents*, Node*);
Torne (Richard Coles)81a51572013-05-13 16:52:28 +010047void activeStyleSheetsUpdatedImpl(InstrumentingAgents*, Document*, const Vector<RefPtr<StyleSheet> >&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010048void frameWindowDiscardedImpl(InstrumentingAgents*, DOMWindow*);
49void mediaQueryResultChangedImpl(InstrumentingAgents*);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +010050void didPushShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
51void willPopShadowRootImpl(InstrumentingAgents*, Element* host, ShadowRoot*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010052void didCreateNamedFlowImpl(InstrumentingAgents*, Document*, NamedFlow*);
53void willRemoveNamedFlowImpl(InstrumentingAgents*, Document*, NamedFlow*);
54void didUpdateRegionLayoutImpl(InstrumentingAgents*, Document*, NamedFlow*);
55void willSendXMLHttpRequestImpl(InstrumentingAgents*, const String& url);
56void didScheduleResourceRequestImpl(InstrumentingAgents*, Document*, const String& url);
57void didInstallTimerImpl(InstrumentingAgents*, ScriptExecutionContext*, int timerId, int timeout, bool singleShot);
58void didRemoveTimerImpl(InstrumentingAgents*, ScriptExecutionContext*, int timerId);
59InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents*, ScriptExecutionContext*, const String& scriptName, int scriptLine);
60void didCallFunctionImpl(const InspectorInstrumentationCookie&);
61InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEventImpl(InstrumentingAgents*, ScriptExecutionContext*, XMLHttpRequest*);
62void didDispatchXHRReadyStateChangeEventImpl(const InspectorInstrumentationCookie&);
63InspectorInstrumentationCookie willDispatchEventImpl(InstrumentingAgents*, Document*, const Event&, DOMWindow*, Node*, const EventPath&);
64void didDispatchEventImpl(const InspectorInstrumentationCookie&);
65InspectorInstrumentationCookie willHandleEventImpl(InstrumentingAgents*, Event*);
66void didHandleEventImpl(const InspectorInstrumentationCookie&);
67InspectorInstrumentationCookie willDispatchEventOnWindowImpl(InstrumentingAgents*, const Event&, DOMWindow*);
68void didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie&);
69InspectorInstrumentationCookie willEvaluateScriptImpl(InstrumentingAgents*, Frame*, const String& url, int lineNumber);
70void didEvaluateScriptImpl(const InspectorInstrumentationCookie&);
71void scriptsEnabledImpl(InstrumentingAgents*, bool isEnabled);
72void didCreateIsolatedContextImpl(InstrumentingAgents*, Frame*, ScriptState*, SecurityOrigin*);
73InspectorInstrumentationCookie willFireTimerImpl(InstrumentingAgents*, ScriptExecutionContext*, int timerId);
74void didFireTimerImpl(const InspectorInstrumentationCookie&);
75void didInvalidateLayoutImpl(InstrumentingAgents*, Frame*);
76InspectorInstrumentationCookie willLayoutImpl(InstrumentingAgents*, Frame*);
77void didLayoutImpl(const InspectorInstrumentationCookie&, RenderObject*);
78void didScrollImpl(InstrumentingAgents*);
79void didResizeMainFrameImpl(InstrumentingAgents*);
80InspectorInstrumentationCookie willDispatchXHRLoadEventImpl(InstrumentingAgents*, ScriptExecutionContext*, XMLHttpRequest*);
81void didDispatchXHRLoadEventImpl(const InspectorInstrumentationCookie&);
82void willScrollLayerImpl(InstrumentingAgents*, Frame*);
83void didScrollLayerImpl(InstrumentingAgents*);
84void willPaintImpl(InstrumentingAgents*, RenderObject*);
85void didPaintImpl(InstrumentingAgents*, RenderObject*, GraphicsContext*, const LayoutRect&);
86InspectorInstrumentationCookie willRecalculateStyleImpl(InstrumentingAgents*, Document*);
87void didRecalculateStyleImpl(const InspectorInstrumentationCookie&);
88void didRecalculateStyleForElementImpl(InstrumentingAgents*);
89void didScheduleStyleRecalculationImpl(InstrumentingAgents*, Document*);
90InspectorInstrumentationCookie willMatchRuleImpl(InstrumentingAgents*, StyleRule*, InspectorCSSOMWrappers&, DocumentStyleSheetCollection*);
91void didMatchRuleImpl(const InspectorInstrumentationCookie&, bool matched);
92void didProcessRuleImpl(const InspectorInstrumentationCookie&);
93void applyUserAgentOverrideImpl(InstrumentingAgents*, String*);
94void applyScreenWidthOverrideImpl(InstrumentingAgents*, long*);
95void applyScreenHeightOverrideImpl(InstrumentingAgents*, long*);
96void applyEmulatedMediaImpl(InstrumentingAgents*, String*);
97void willSendRequestImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse& redirectResponse);
98void continueAfterPingLoaderImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, ResourceRequest&, const ResourceResponse&);
99void markResourceAsCachedImpl(InstrumentingAgents*, unsigned long identifier);
100void didLoadResourceFromMemoryCacheImpl(InstrumentingAgents*, DocumentLoader*, CachedResource*);
101InspectorInstrumentationCookie willReceiveResourceDataImpl(InstrumentingAgents*, Frame*, unsigned long identifier, int length);
102void didReceiveResourceDataImpl(const InspectorInstrumentationCookie&);
103InspectorInstrumentationCookie willReceiveResourceResponseImpl(InstrumentingAgents*, Frame*, unsigned long identifier, const ResourceResponse&);
104void didReceiveResourceResponseImpl(const InspectorInstrumentationCookie&, unsigned long identifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100105void continueAfterXFrameOptionsDeniedImpl(Frame*, DocumentLoader*, unsigned long, const ResourceResponse&);
106void continueWithPolicyDownloadImpl(Frame*, DocumentLoader*, unsigned long, const ResourceResponse&);
107void continueWithPolicyIgnoreImpl(Frame*, DocumentLoader*, unsigned long, const ResourceResponse&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100108void didReceiveDataImpl(InstrumentingAgents*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100109void didFinishLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, double finishTime);
110void didFailLoadingImpl(InstrumentingAgents*, unsigned long identifier, DocumentLoader*, const ResourceError&);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100111void documentThreadableLoaderStartedLoadingForClientImpl(InstrumentingAgents*, unsigned long identifier, ThreadableLoaderClient*);
112void willLoadXHRImpl(InstrumentingAgents*, ThreadableLoaderClient*, const String&, const KURL&, bool, PassRefPtr<FormData>, const HTTPHeaderMap&, bool);
113void didFailXHRLoadingImpl(InstrumentingAgents*, ThreadableLoaderClient*);
114void didFinishXHRLoadingImpl(InstrumentingAgents*, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
115void didReceiveXHRResponseImpl(InstrumentingAgents*, unsigned long identifier);
116void willLoadXHRSynchronouslyImpl(InstrumentingAgents*);
117void didLoadXHRSynchronouslyImpl(InstrumentingAgents*);
118void scriptImportedImpl(InstrumentingAgents*, unsigned long identifier, const String& sourceString);
119void scriptExecutionBlockedByCSPImpl(InstrumentingAgents*, const String& directiveText);
120void didReceiveScriptResponseImpl(InstrumentingAgents*, unsigned long identifier);
121void domContentLoadedEventFiredImpl(InstrumentingAgents*, Frame*);
122void loadEventFiredImpl(InstrumentingAgents*, Frame*);
123void frameDetachedFromParentImpl(InstrumentingAgents*, Frame*);
124void didCommitLoadImpl(InstrumentingAgents*, Frame*, DocumentLoader*);
125void frameDocumentUpdatedImpl(InstrumentingAgents*, Frame*);
126void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
127void frameStartedLoadingImpl(InstrumentingAgents*, Frame*);
128void frameStoppedLoadingImpl(InstrumentingAgents*, Frame*);
129void frameScheduledNavigationImpl(InstrumentingAgents*, Frame*, double delay);
130void frameClearedScheduledNavigationImpl(InstrumentingAgents*, Frame*);
131InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents*, const String& message);
132void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100133void willDestroyCachedResourceImpl(CachedResource*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100134InspectorInstrumentationCookie willWriteHTMLImpl(InstrumentingAgents*, Document*, unsigned startLine);
135void didWriteHTMLImpl(const InspectorInstrumentationCookie&, unsigned endLine);
136void didRequestAnimationFrameImpl(InstrumentingAgents*, Document*, int callbackId);
137void didCancelAnimationFrameImpl(InstrumentingAgents*, Document*, int callbackId);
138InspectorInstrumentationCookie willFireAnimationFrameImpl(InstrumentingAgents*, Document*, int callbackId);
139void didFireAnimationFrameImpl(const InspectorInstrumentationCookie&);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100140void didDispatchDOMStorageEventImpl(InstrumentingAgents*, const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100141void didStartWorkerContextImpl(InstrumentingAgents*, WorkerContextProxy*, const KURL&);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100142void willEvaluateWorkerScriptImpl(InstrumentingAgents*, WorkerContext*, int workerThreadStartMode);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100143void workerContextTerminatedImpl(InstrumentingAgents*, WorkerContextProxy*);
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100144void didCreateWebSocketImpl(InstrumentingAgents*, Document*, unsigned long identifier, const KURL& requestURL, const String& protocol);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100145void willSendWebSocketHandshakeRequestImpl(InstrumentingAgents*, Document*, unsigned long identifier, const WebSocketHandshakeRequest&);
146void didReceiveWebSocketHandshakeResponseImpl(InstrumentingAgents*, Document*, unsigned long identifier, const WebSocketHandshakeResponse&);
147void didCloseWebSocketImpl(InstrumentingAgents*, Document*, unsigned long identifier);
148void didReceiveWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
149void didSendWebSocketFrameImpl(InstrumentingAgents*, unsigned long identifier, const WebSocketFrame&);
150void didReceiveWebSocketFrameErrorImpl(InstrumentingAgents*, unsigned long identifier, const String&);
151void networkStateChangedImpl(InstrumentingAgents*);
152void updateApplicationCacheStatusImpl(InstrumentingAgents*, Frame*);
153void layerTreeDidChangeImpl(InstrumentingAgents*);
154void renderLayerDestroyedImpl(InstrumentingAgents*, const RenderLayer*);
155void pseudoElementDestroyedImpl(InstrumentingAgents*, PseudoElement*);
156
157inline void didClearWindowObjectInWorld(Frame* frame, DOMWrapperWorld* world)
158{
159 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
160 didClearWindowObjectInWorldImpl(instrumentingAgents, frame, world);
161}
162
163inline void willInsertDOMNode(Document* document, Node* parent)
164{
165 FAST_RETURN_IF_NO_FRONTENDS(void());
166 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
167 willInsertDOMNodeImpl(instrumentingAgents, parent);
168}
169
170inline void didInsertDOMNode(Document* document, Node* node)
171{
172 FAST_RETURN_IF_NO_FRONTENDS(void());
173 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
174 didInsertDOMNodeImpl(instrumentingAgents, node);
175}
176
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100177inline void willRemoveDOMNode(Document* document, Node* node)
178{
179 FAST_RETURN_IF_NO_FRONTENDS(void());
180 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
181 willRemoveDOMNodeImpl(instrumentingAgents, node);
182}
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100183
184inline void willModifyDOMAttr(Document* document, Element* element, const AtomicString& oldValue, const AtomicString& newValue)
185{
186 FAST_RETURN_IF_NO_FRONTENDS(void());
187 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
188 willModifyDOMAttrImpl(instrumentingAgents, element, oldValue, newValue);
189}
190
191inline void didModifyDOMAttr(Document* document, Element* element, const AtomicString& name, const AtomicString& value)
192{
193 FAST_RETURN_IF_NO_FRONTENDS(void());
194 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
195 didModifyDOMAttrImpl(instrumentingAgents, element, name, value);
196}
197
198inline void didRemoveDOMAttr(Document* document, Element* element, const AtomicString& name)
199{
200 FAST_RETURN_IF_NO_FRONTENDS(void());
201 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
202 didRemoveDOMAttrImpl(instrumentingAgents, element, name);
203}
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100204
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100205inline void characterDataModified(Document* document, CharacterData* characterData)
206{
207 FAST_RETURN_IF_NO_FRONTENDS(void());
208 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
209 characterDataModifiedImpl(instrumentingAgents, characterData);
210}
211
212inline void didInvalidateStyleAttr(Document* document, Node* node)
213{
214 FAST_RETURN_IF_NO_FRONTENDS(void());
215 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
216 didInvalidateStyleAttrImpl(instrumentingAgents, node);
217}
218
219inline void activeStyleSheetsUpdated(Document* document, const Vector<RefPtr<StyleSheet> >& newSheets)
220{
221 FAST_RETURN_IF_NO_FRONTENDS(void());
222 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
Torne (Richard Coles)81a51572013-05-13 16:52:28 +0100223 activeStyleSheetsUpdatedImpl(instrumentingAgents, document, newSheets);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100224}
225
226inline void frameWindowDiscarded(Frame* frame, DOMWindow* domWindow)
227{
228 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
229 frameWindowDiscardedImpl(instrumentingAgents, domWindow);
230}
231
232inline void mediaQueryResultChanged(Document* document)
233{
234 FAST_RETURN_IF_NO_FRONTENDS(void());
235 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
236 mediaQueryResultChangedImpl(instrumentingAgents);
237}
238
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100239inline void didPushShadowRoot(Element* host, ShadowRoot* root)
240{
241 FAST_RETURN_IF_NO_FRONTENDS(void());
242 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForElement(host))
243 didPushShadowRootImpl(instrumentingAgents, host, root);
244}
245
246inline void willPopShadowRoot(Element* host, ShadowRoot* root)
247{
248 FAST_RETURN_IF_NO_FRONTENDS(void());
249 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForElement(host))
250 willPopShadowRootImpl(instrumentingAgents, host, root);
251}
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100252
253inline void didCreateNamedFlow(Document* document, NamedFlow* namedFlow)
254{
255 FAST_RETURN_IF_NO_FRONTENDS(void());
256 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
257 didCreateNamedFlowImpl(instrumentingAgents, document, namedFlow);
258}
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100259
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100260inline void willRemoveNamedFlow(Document* document, NamedFlow* namedFlow)
261{
262 FAST_RETURN_IF_NO_FRONTENDS(void());
263 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
264 willRemoveNamedFlowImpl(instrumentingAgents, document, namedFlow);
265}
266
267inline void didUpdateRegionLayout(Document* document, NamedFlow* namedFlow)
268{
269 FAST_RETURN_IF_NO_FRONTENDS(void());
270 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
271 didUpdateRegionLayoutImpl(instrumentingAgents, document, namedFlow);
272}
273
274inline void willSendXMLHttpRequest(ScriptExecutionContext* context, const String& url)
275{
276 FAST_RETURN_IF_NO_FRONTENDS(void());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100277 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100278 willSendXMLHttpRequestImpl(instrumentingAgents, url);
279}
280
281inline void didScheduleResourceRequest(Document* document, const String& url)
282{
283 FAST_RETURN_IF_NO_FRONTENDS(void());
284 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
285 didScheduleResourceRequestImpl(instrumentingAgents, document, url);
286}
287
288inline void didInstallTimer(ScriptExecutionContext* context, int timerId, int timeout, bool singleShot)
289{
290 FAST_RETURN_IF_NO_FRONTENDS(void());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100291 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100292 didInstallTimerImpl(instrumentingAgents, context, timerId, timeout, singleShot);
293}
294
295inline void didRemoveTimer(ScriptExecutionContext* context, int timerId)
296{
297 FAST_RETURN_IF_NO_FRONTENDS(void());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100298 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100299 didRemoveTimerImpl(instrumentingAgents, context, timerId);
300}
301
302inline InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
303{
304 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100305 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100306 return willCallFunctionImpl(instrumentingAgents, context, scriptName, scriptLine);
307 return InspectorInstrumentationCookie();
308}
309
310inline void didCallFunction(const InspectorInstrumentationCookie& cookie)
311{
312 FAST_RETURN_IF_NO_FRONTENDS(void());
313 if (cookie.isValid())
314 didCallFunctionImpl(cookie);
315}
316
317inline InspectorInstrumentationCookie willDispatchXHRReadyStateChangeEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
318{
319 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100320 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100321 return willDispatchXHRReadyStateChangeEventImpl(instrumentingAgents, context, request);
322 return InspectorInstrumentationCookie();
323}
324
325inline void didDispatchXHRReadyStateChangeEvent(const InspectorInstrumentationCookie& cookie)
326{
327 FAST_RETURN_IF_NO_FRONTENDS(void());
328 if (cookie.isValid())
329 didDispatchXHRReadyStateChangeEventImpl(cookie);
330}
331
332inline InspectorInstrumentationCookie willDispatchEvent(Document* document, const Event& event, DOMWindow* window, Node* node, const EventPath& eventPath)
333{
334 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
335 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
336 return willDispatchEventImpl(instrumentingAgents, document, event, window, node, eventPath);
337 return InspectorInstrumentationCookie();
338}
339
340inline void didDispatchEvent(const InspectorInstrumentationCookie& cookie)
341{
342 FAST_RETURN_IF_NO_FRONTENDS(void());
343 if (cookie.isValid())
344 didDispatchEventImpl(cookie);
345}
346
347inline InspectorInstrumentationCookie willHandleEvent(ScriptExecutionContext* context, Event* event)
348{
349 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100350 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100351 return willHandleEventImpl(instrumentingAgents, event);
352 return InspectorInstrumentationCookie();
353}
354
355inline void didHandleEvent(const InspectorInstrumentationCookie& cookie)
356{
357 FAST_RETURN_IF_NO_FRONTENDS(void());
358 if (cookie.isValid())
359 didHandleEventImpl(cookie);
360}
361
362inline InspectorInstrumentationCookie willDispatchEventOnWindow(Frame* frame, const Event& event, DOMWindow* window)
363{
364 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
365 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
366 return willDispatchEventOnWindowImpl(instrumentingAgents, event, window);
367 return InspectorInstrumentationCookie();
368}
369
370inline void didDispatchEventOnWindow(const InspectorInstrumentationCookie& cookie)
371{
372 FAST_RETURN_IF_NO_FRONTENDS(void());
373 if (cookie.isValid())
374 didDispatchEventOnWindowImpl(cookie);
375}
376
377inline InspectorInstrumentationCookie willEvaluateScript(Frame* frame, const String& url, int lineNumber)
378{
379 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
380 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
381 return willEvaluateScriptImpl(instrumentingAgents, frame, url, lineNumber);
382 return InspectorInstrumentationCookie();
383}
384
385inline void didEvaluateScript(const InspectorInstrumentationCookie& cookie)
386{
387 FAST_RETURN_IF_NO_FRONTENDS(void());
388 if (cookie.isValid())
389 didEvaluateScriptImpl(cookie);
390}
391
392inline void scriptsEnabled(Page* page, bool isEnabled)
393{
394 FAST_RETURN_IF_NO_FRONTENDS(void());
395 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
396 scriptsEnabledImpl(instrumentingAgents, isEnabled);
397}
398
399inline void didCreateIsolatedContext(Frame* frame, ScriptState* scriptState, SecurityOrigin* origin)
400{
401 FAST_RETURN_IF_NO_FRONTENDS(void());
402 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
403 didCreateIsolatedContextImpl(instrumentingAgents, frame, scriptState, origin);
404}
405
406inline InspectorInstrumentationCookie willFireTimer(ScriptExecutionContext* context, int timerId)
407{
408 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100409 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100410 return willFireTimerImpl(instrumentingAgents, context, timerId);
411 return InspectorInstrumentationCookie();
412}
413
414inline void didFireTimer(const InspectorInstrumentationCookie& cookie)
415{
416 FAST_RETURN_IF_NO_FRONTENDS(void());
417 if (cookie.isValid())
418 didFireTimerImpl(cookie);
419}
420
421inline void didInvalidateLayout(Frame* frame)
422{
423 FAST_RETURN_IF_NO_FRONTENDS(void());
424 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
425 didInvalidateLayoutImpl(instrumentingAgents, frame);
426}
427
428inline InspectorInstrumentationCookie willLayout(Frame* frame)
429{
430 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
431 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
432 return willLayoutImpl(instrumentingAgents, frame);
433 return InspectorInstrumentationCookie();
434}
435
436inline void didLayout(const InspectorInstrumentationCookie& cookie, RenderObject* root)
437{
438 FAST_RETURN_IF_NO_FRONTENDS(void());
439 if (cookie.isValid())
440 didLayoutImpl(cookie, root);
441}
442
443inline void didScroll(Page* page)
444{
445 FAST_RETURN_IF_NO_FRONTENDS(void());
446 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
447 didScrollImpl(instrumentingAgents);
448}
449
450inline void didResizeMainFrame(Page* page)
451{
452 FAST_RETURN_IF_NO_FRONTENDS(void());
453 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
454 didResizeMainFrameImpl(instrumentingAgents);
455}
456
457inline InspectorInstrumentationCookie willDispatchXHRLoadEvent(ScriptExecutionContext* context, XMLHttpRequest* request)
458{
459 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100460 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100461 return willDispatchXHRLoadEventImpl(instrumentingAgents, context, request);
462 return InspectorInstrumentationCookie();
463}
464
465inline void didDispatchXHRLoadEvent(const InspectorInstrumentationCookie& cookie)
466{
467 FAST_RETURN_IF_NO_FRONTENDS(void());
468 if (cookie.isValid())
469 didDispatchXHRLoadEventImpl(cookie);
470}
471
472inline void willScrollLayer(Frame* frame)
473{
474 FAST_RETURN_IF_NO_FRONTENDS(void());
475 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
476 willScrollLayerImpl(instrumentingAgents, frame);
477}
478
479inline void didScrollLayer(Frame* frame)
480{
481 FAST_RETURN_IF_NO_FRONTENDS(void());
482 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
483 didScrollLayerImpl(instrumentingAgents);
484}
485
486inline void willPaint(RenderObject* renderer)
487{
488 FAST_RETURN_IF_NO_FRONTENDS(void());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100489 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderObject(renderer))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100490 willPaintImpl(instrumentingAgents, renderer);
491}
492
493inline void didPaint(RenderObject* renderer, GraphicsContext* context, const LayoutRect& rect)
494{
495 FAST_RETURN_IF_NO_FRONTENDS(void());
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100496 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForRenderObject(renderer))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100497 didPaintImpl(instrumentingAgents, renderer, context, rect);
498}
499
500inline InspectorInstrumentationCookie willRecalculateStyle(Document* document)
501{
502 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
503 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
504 return willRecalculateStyleImpl(instrumentingAgents, document);
505 return InspectorInstrumentationCookie();
506}
507
508inline void didRecalculateStyle(const InspectorInstrumentationCookie& cookie)
509{
510 FAST_RETURN_IF_NO_FRONTENDS(void());
511 if (cookie.isValid())
512 didRecalculateStyleImpl(cookie);
513}
514
515inline void didRecalculateStyleForElement(Element* element)
516{
517 FAST_RETURN_IF_NO_FRONTENDS(void());
518 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForElement(element))
519 didRecalculateStyleForElementImpl(instrumentingAgents);
520}
521
522inline void didScheduleStyleRecalculation(Document* document)
523{
524 FAST_RETURN_IF_NO_FRONTENDS(void());
525 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
526 didScheduleStyleRecalculationImpl(instrumentingAgents, document);
527}
528
529inline InspectorInstrumentationCookie willMatchRule(Document* document, StyleRule* rule, InspectorCSSOMWrappers& inspectorCSSOMWrappers, DocumentStyleSheetCollection* styleSheetCollection)
530{
531 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
532 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
533 return willMatchRuleImpl(instrumentingAgents, rule, inspectorCSSOMWrappers, styleSheetCollection);
534 return InspectorInstrumentationCookie();
535}
536
537inline void didMatchRule(const InspectorInstrumentationCookie& cookie, bool matched)
538{
539 FAST_RETURN_IF_NO_FRONTENDS(void());
540 if (cookie.isValid())
541 didMatchRuleImpl(cookie, matched);
542}
543
544inline void didProcessRule(const InspectorInstrumentationCookie& cookie)
545{
546 FAST_RETURN_IF_NO_FRONTENDS(void());
547 if (cookie.isValid())
548 didProcessRuleImpl(cookie);
549}
550
551inline void applyUserAgentOverride(Frame* frame, String* userAgent)
552{
553 FAST_RETURN_IF_NO_FRONTENDS(void());
554 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
555 applyUserAgentOverrideImpl(instrumentingAgents, userAgent);
556}
557
558inline void applyScreenWidthOverride(Frame* frame, long* width)
559{
560 FAST_RETURN_IF_NO_FRONTENDS(void());
561 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
562 applyScreenWidthOverrideImpl(instrumentingAgents, width);
563}
564
565inline void applyScreenHeightOverride(Frame* frame, long* height)
566{
567 FAST_RETURN_IF_NO_FRONTENDS(void());
568 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
569 applyScreenHeightOverrideImpl(instrumentingAgents, height);
570}
571
572inline void applyEmulatedMedia(Frame* frame, String* media)
573{
574 FAST_RETURN_IF_NO_FRONTENDS(void());
575 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
576 applyEmulatedMediaImpl(instrumentingAgents, media);
577}
578
579inline void willSendRequest(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& redirectResponse)
580{
581 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
582 willSendRequestImpl(instrumentingAgents, identifier, loader, request, redirectResponse);
583}
584
585inline void continueAfterPingLoader(Frame* frame, unsigned long identifier, DocumentLoader* loader, ResourceRequest& request, const ResourceResponse& response)
586{
587 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
588 continueAfterPingLoaderImpl(instrumentingAgents, identifier, loader, request, response);
589}
590
591inline void markResourceAsCached(Page* page, unsigned long identifier)
592{
593 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
594 markResourceAsCachedImpl(instrumentingAgents, identifier);
595}
596
597inline void didLoadResourceFromMemoryCache(Page* page, DocumentLoader* loader, CachedResource* resource)
598{
599 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
600 didLoadResourceFromMemoryCacheImpl(instrumentingAgents, loader, resource);
601}
602
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100603inline InspectorInstrumentationCookie willReceiveResourceData(Frame* frame, unsigned long identifier, int length)
604{
605 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
606 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
607 return willReceiveResourceDataImpl(instrumentingAgents, frame, identifier, length);
608 return InspectorInstrumentationCookie();
609}
610
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100611inline void didReceiveResourceData(const InspectorInstrumentationCookie& cookie)
612{
613 FAST_RETURN_IF_NO_FRONTENDS(void());
614 if (cookie.isValid())
615 didReceiveResourceDataImpl(cookie);
616}
617
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100618inline InspectorInstrumentationCookie willReceiveResourceResponse(Frame* frame, unsigned long identifier, const ResourceResponse& response)
619{
620 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
621 return willReceiveResourceResponseImpl(instrumentingAgents, frame, identifier, response);
622 return InspectorInstrumentationCookie();
623}
624
625inline void didReceiveResourceResponse(const InspectorInstrumentationCookie& cookie, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
626{
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100627 if (cookie.isValid())
628 didReceiveResourceResponseImpl(cookie, identifier, loader, response, resourceLoader);
629}
630
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100631inline void continueAfterXFrameOptionsDenied(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
632{
633 FAST_RETURN_IF_NO_FRONTENDS(void());
634 continueAfterXFrameOptionsDeniedImpl(frame, loader, identifier, r);
635}
636
637inline void continueWithPolicyDownload(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
638{
639 FAST_RETURN_IF_NO_FRONTENDS(void());
640 continueWithPolicyDownloadImpl(frame, loader, identifier, r);
641}
642
643inline void continueWithPolicyIgnore(Frame* frame, DocumentLoader* loader, unsigned long identifier, const ResourceResponse& r)
644{
645 FAST_RETURN_IF_NO_FRONTENDS(void());
646 continueWithPolicyIgnoreImpl(frame, loader, identifier, r);
647}
648
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100649inline void didReceiveData(Frame* frame, unsigned long identifier, const char* data, int dataLength, int encodedDataLength)
650{
651 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
652 didReceiveDataImpl(instrumentingAgents, identifier, data, dataLength, encodedDataLength);
653}
654
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100655inline void didFinishLoading(Frame* frame, unsigned long identifier, DocumentLoader* loader, double finishTime)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100656{
657 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100658 didFinishLoadingImpl(instrumentingAgents, identifier, loader, finishTime);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100659}
660
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100661inline void didFailLoading(Frame* frame, unsigned long identifier, DocumentLoader* loader, const ResourceError& error)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100662{
663 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100664 didFailLoadingImpl(instrumentingAgents, identifier, loader, error);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100665}
666
667inline void documentThreadableLoaderStartedLoadingForClient(ScriptExecutionContext* context, unsigned long identifier, ThreadableLoaderClient* client)
668{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100669 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100670 documentThreadableLoaderStartedLoadingForClientImpl(instrumentingAgents, identifier, client);
671}
672
673inline void willLoadXHR(ScriptExecutionContext* context, ThreadableLoaderClient* client, const String& method, const KURL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
674{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100675 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100676 willLoadXHRImpl(instrumentingAgents, client, method, url, async, formData, headers, includeCredentials);
677}
678
679inline void didFailXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client)
680{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100681 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100682 didFailXHRLoadingImpl(instrumentingAgents, client);
683}
684
685inline void didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
686{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100687 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100688 didFinishXHRLoadingImpl(instrumentingAgents, client, identifier, sourceString, url, sendURL, sendLineNumber);
689}
690
691inline void didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier)
692{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100693 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100694 didReceiveXHRResponseImpl(instrumentingAgents, identifier);
695}
696
697inline void willLoadXHRSynchronously(ScriptExecutionContext* context)
698{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100699 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100700 willLoadXHRSynchronouslyImpl(instrumentingAgents);
701}
702
703inline void didLoadXHRSynchronously(ScriptExecutionContext* context)
704{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100705 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100706 didLoadXHRSynchronouslyImpl(instrumentingAgents);
707}
708
709inline void scriptImported(ScriptExecutionContext* context, unsigned long identifier, const String& sourceString)
710{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100711 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100712 scriptImportedImpl(instrumentingAgents, identifier, sourceString);
713}
714
715inline void scriptExecutionBlockedByCSP(ScriptExecutionContext* context, const String& directiveText)
716{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100717 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100718 scriptExecutionBlockedByCSPImpl(instrumentingAgents, directiveText);
719}
720
721inline void didReceiveScriptResponse(ScriptExecutionContext* context, unsigned long identifier)
722{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100723 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100724 didReceiveScriptResponseImpl(instrumentingAgents, identifier);
725}
726
727inline void domContentLoadedEventFired(Frame* frame)
728{
729 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
730 domContentLoadedEventFiredImpl(instrumentingAgents, frame);
731}
732
733inline void loadEventFired(Frame* frame)
734{
735 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
736 loadEventFiredImpl(instrumentingAgents, frame);
737}
738
739inline void frameDetachedFromParent(Frame* frame)
740{
741 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
742 frameDetachedFromParentImpl(instrumentingAgents, frame);
743}
744
745inline void didCommitLoad(Frame* frame, DocumentLoader* loader)
746{
747 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
748 didCommitLoadImpl(instrumentingAgents, frame, loader);
749}
750
751inline void frameDocumentUpdated(Frame* frame)
752{
753 FAST_RETURN_IF_NO_FRONTENDS(void());
754 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
755 frameDocumentUpdatedImpl(instrumentingAgents, frame);
756}
757
758inline void loaderDetachedFromFrame(Frame* frame, DocumentLoader* loader)
759{
760 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
761 loaderDetachedFromFrameImpl(instrumentingAgents, loader);
762}
763
764inline void frameStartedLoading(Frame* frame)
765{
766 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
767 frameStartedLoadingImpl(instrumentingAgents, frame);
768}
769
770inline void frameStoppedLoading(Frame* frame)
771{
772 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
773 frameStoppedLoadingImpl(instrumentingAgents, frame);
774}
775
776inline void frameScheduledNavigation(Frame* frame, double delay)
777{
778 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
779 frameScheduledNavigationImpl(instrumentingAgents, frame, delay);
780}
781
782inline void frameClearedScheduledNavigation(Frame* frame)
783{
784 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
785 frameClearedScheduledNavigationImpl(instrumentingAgents, frame);
786}
787
788inline InspectorInstrumentationCookie willRunJavaScriptDialog(Page* page, const String& message)
789{
790 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
791 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
792 return willRunJavaScriptDialogImpl(instrumentingAgents, message);
793 return InspectorInstrumentationCookie();
794}
795
796inline void didRunJavaScriptDialog(const InspectorInstrumentationCookie& cookie)
797{
798 FAST_RETURN_IF_NO_FRONTENDS(void());
799 if (cookie.isValid())
800 didRunJavaScriptDialogImpl(cookie);
801}
802
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100803inline void willDestroyCachedResource(CachedResource* cachedResource)
804{
805 FAST_RETURN_IF_NO_FRONTENDS(void());
806 willDestroyCachedResourceImpl(cachedResource);
807}
808
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100809inline InspectorInstrumentationCookie willWriteHTML(Document* document, unsigned startLine)
810{
811 FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());
812 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
813 return willWriteHTMLImpl(instrumentingAgents, document, startLine);
814 return InspectorInstrumentationCookie();
815}
816
817inline void didWriteHTML(const InspectorInstrumentationCookie& cookie, unsigned endLine)
818{
819 FAST_RETURN_IF_NO_FRONTENDS(void());
820 if (cookie.isValid())
821 didWriteHTMLImpl(cookie, endLine);
822}
823
824inline void didRequestAnimationFrame(Document* document, int callbackId)
825{
826 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
827 didRequestAnimationFrameImpl(instrumentingAgents, document, callbackId);
828}
829
830inline void didCancelAnimationFrame(Document* document, int callbackId)
831{
832 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
833 didCancelAnimationFrameImpl(instrumentingAgents, document, callbackId);
834}
835
836inline InspectorInstrumentationCookie willFireAnimationFrame(Document* document, int callbackId)
837{
838 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
839 return willFireAnimationFrameImpl(instrumentingAgents, document, callbackId);
840 return InspectorInstrumentationCookie();
841}
842
843inline void didFireAnimationFrame(const InspectorInstrumentationCookie& cookie)
844{
845 FAST_RETURN_IF_NO_FRONTENDS(void());
846 if (cookie.isValid())
847 didFireAnimationFrameImpl(cookie);
848}
849
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100850inline void didDispatchDOMStorageEvent(Page* page, const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin)
851{
852 FAST_RETURN_IF_NO_FRONTENDS(void());
853 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
854 didDispatchDOMStorageEventImpl(instrumentingAgents, key, oldValue, newValue, storageType, securityOrigin);
855}
856
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100857inline void didStartWorkerContext(ScriptExecutionContext* context, WorkerContextProxy* proxy, const KURL& url)
858{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100859 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100860 didStartWorkerContextImpl(instrumentingAgents, proxy, url);
861}
862
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100863inline void willEvaluateWorkerScript(WorkerContext* context, int workerThreadStartMode)
864{
865 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerContext(context))
866 willEvaluateWorkerScriptImpl(instrumentingAgents, context, workerThreadStartMode);
867}
868
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100869inline void workerContextTerminated(ScriptExecutionContext* context, WorkerContextProxy* proxy)
870{
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100871 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForScriptExecutionContext(context))
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100872 workerContextTerminatedImpl(instrumentingAgents, proxy);
873}
874
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100875inline void didCreateWebSocket(Document* document, unsigned long identifier, const KURL& requestURL, const String& protocol)
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100876{
877 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
Torne (Richard Coles)93ac45c2013-05-29 14:40:20 +0100878 didCreateWebSocketImpl(instrumentingAgents, document, identifier, requestURL, protocol);
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100879}
880
881inline void willSendWebSocketHandshakeRequest(Document* document, unsigned long identifier, const WebSocketHandshakeRequest& request)
882{
883 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
884 willSendWebSocketHandshakeRequestImpl(instrumentingAgents, document, identifier, request);
885}
886
887inline void didReceiveWebSocketHandshakeResponse(Document* document, unsigned long identifier, const WebSocketHandshakeResponse& response)
888{
889 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
890 didReceiveWebSocketHandshakeResponseImpl(instrumentingAgents, document, identifier, response);
891}
892
893inline void didCloseWebSocket(Document* document, unsigned long identifier)
894{
895 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
896 didCloseWebSocketImpl(instrumentingAgents, document, identifier);
897}
898
899inline void didReceiveWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
900{
901 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
902 didReceiveWebSocketFrameImpl(instrumentingAgents, identifier, frame);
903}
904
905inline void didSendWebSocketFrame(Document* document, unsigned long identifier, const WebSocketFrame& frame)
906{
907 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
908 didSendWebSocketFrameImpl(instrumentingAgents, identifier, frame);
909}
910
911inline void didReceiveWebSocketFrameError(Document* document, unsigned long identifier, const String& errorMessage)
912{
913 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
914 didReceiveWebSocketFrameErrorImpl(instrumentingAgents, identifier, errorMessage);
915}
916
917inline void networkStateChanged(Page* page)
918{
919 FAST_RETURN_IF_NO_FRONTENDS(void());
920 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
921 networkStateChangedImpl(instrumentingAgents);
922}
923
924inline void updateApplicationCacheStatus(Frame* frame)
925{
926 FAST_RETURN_IF_NO_FRONTENDS(void());
927 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
928 updateApplicationCacheStatusImpl(instrumentingAgents, frame);
929}
930
931inline void layerTreeDidChange(Page* page)
932{
933 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
934 layerTreeDidChangeImpl(instrumentingAgents);
935}
936
937inline void renderLayerDestroyed(Page* page, const RenderLayer* renderLayer)
938{
939 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
940 renderLayerDestroyedImpl(instrumentingAgents, renderLayer);
941}
942
943inline void pseudoElementDestroyed(Page* page, PseudoElement* pseudoElement)
944{
945 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
946 pseudoElementDestroyedImpl(instrumentingAgents, pseudoElement);
947}
948
949} // namespace InspectorInstrumentation
950
951} // namespace WebCore
952
953#endif // !defined(InspectorInstrumentation_inl_h)