OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 11 matching lines...) Expand all Loading... |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | |
33 #if ENABLE(INSPECTOR) | |
34 | |
35 #include "InspectorInstrumentation.h" | 32 #include "InspectorInstrumentation.h" |
36 | 33 |
37 #include "CSSRule.h" | 34 #include "CSSRule.h" |
38 #include "CSSStyleRule.h" | 35 #include "CSSStyleRule.h" |
39 #include "ConsoleAPITypes.h" | 36 #include "ConsoleAPITypes.h" |
40 #include "ConsoleTypes.h" | 37 #include "ConsoleTypes.h" |
41 #include "DOMWindow.h" | 38 #include "DOMWindow.h" |
42 #include "Database.h" | 39 #include "Database.h" |
43 #include "DeviceOrientationData.h" | 40 #include "DeviceOrientationData.h" |
44 #include "DocumentLoader.h" | 41 #include "DocumentLoader.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { | 150 { |
154 } | 151 } |
155 | 152 |
156 void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgen
ts* instrumentingAgents, Frame* frame, DOMWrapperWorld* world) | 153 void InspectorInstrumentation::didClearWindowObjectInWorldImpl(InstrumentingAgen
ts* instrumentingAgents, Frame* frame, DOMWrapperWorld* world) |
157 { | 154 { |
158 InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent(); | 155 InspectorPageAgent* pageAgent = instrumentingAgents->inspectorPageAgent(); |
159 if (pageAgent) | 156 if (pageAgent) |
160 pageAgent->didClearWindowObjectInWorld(frame, world); | 157 pageAgent->didClearWindowObjectInWorld(frame, world); |
161 if (InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent()) | 158 if (InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent()) |
162 inspectorAgent->didClearWindowObjectInWorld(frame, world); | 159 inspectorAgent->didClearWindowObjectInWorld(frame, world); |
163 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
164 if (PageDebuggerAgent* debuggerAgent = instrumentingAgents->pageDebuggerAgen
t()) { | 160 if (PageDebuggerAgent* debuggerAgent = instrumentingAgents->pageDebuggerAgen
t()) { |
165 if (pageAgent && world == mainThreadNormalWorld() && frame == pageAgent-
>mainFrame()) | 161 if (pageAgent && world == mainThreadNormalWorld() && frame == pageAgent-
>mainFrame()) |
166 debuggerAgent->didClearMainFrameWindowObject(); | 162 debuggerAgent->didClearMainFrameWindowObject(); |
167 } | 163 } |
168 #endif | |
169 if (PageRuntimeAgent* pageRuntimeAgent = instrumentingAgents->pageRuntimeAge
nt()) { | 164 if (PageRuntimeAgent* pageRuntimeAgent = instrumentingAgents->pageRuntimeAge
nt()) { |
170 if (world == mainThreadNormalWorld()) | 165 if (world == mainThreadNormalWorld()) |
171 pageRuntimeAgent->didCreateMainWorldContext(frame); | 166 pageRuntimeAgent->didCreateMainWorldContext(frame); |
172 } | 167 } |
173 } | 168 } |
174 | 169 |
175 bool InspectorInstrumentation::isDebuggerPausedImpl(InstrumentingAgents* instrum
entingAgents) | 170 bool InspectorInstrumentation::isDebuggerPausedImpl(InstrumentingAgents* instrum
entingAgents) |
176 { | 171 { |
177 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
178 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) | 172 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) |
179 return debuggerAgent->isPaused(); | 173 return debuggerAgent->isPaused(); |
180 #endif | |
181 return false; | 174 return false; |
182 } | 175 } |
183 | 176 |
184 void InspectorInstrumentation::willInsertDOMNodeImpl(InstrumentingAgents* instru
mentingAgents, Node* parent) | 177 void InspectorInstrumentation::willInsertDOMNodeImpl(InstrumentingAgents* instru
mentingAgents, Node* parent) |
185 { | 178 { |
186 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
187 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 179 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
188 domDebuggerAgent->willInsertDOMNode(parent); | 180 domDebuggerAgent->willInsertDOMNode(parent); |
189 #endif | |
190 } | 181 } |
191 | 182 |
192 void InspectorInstrumentation::didInsertDOMNodeImpl(InstrumentingAgents* instrum
entingAgents, Node* node) | 183 void InspectorInstrumentation::didInsertDOMNodeImpl(InstrumentingAgents* instrum
entingAgents, Node* node) |
193 { | 184 { |
194 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 185 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
195 domAgent->didInsertDOMNode(node); | 186 domAgent->didInsertDOMNode(node); |
196 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
197 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 187 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
198 domDebuggerAgent->didInsertDOMNode(node); | 188 domDebuggerAgent->didInsertDOMNode(node); |
199 #endif | |
200 } | 189 } |
201 | 190 |
202 void InspectorInstrumentation::willRemoveDOMNodeImpl(InstrumentingAgents* instru
mentingAgents, Node* node) | 191 void InspectorInstrumentation::willRemoveDOMNodeImpl(InstrumentingAgents* instru
mentingAgents, Node* node) |
203 { | 192 { |
204 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
205 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 193 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
206 domDebuggerAgent->willRemoveDOMNode(node); | 194 domDebuggerAgent->willRemoveDOMNode(node); |
207 #endif | |
208 } | 195 } |
209 | 196 |
210 void InspectorInstrumentation::didRemoveDOMNodeImpl(InstrumentingAgents* instrum
entingAgents, Node* node) | 197 void InspectorInstrumentation::didRemoveDOMNodeImpl(InstrumentingAgents* instrum
entingAgents, Node* node) |
211 { | 198 { |
212 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
213 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 199 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
214 domDebuggerAgent->didRemoveDOMNode(node); | 200 domDebuggerAgent->didRemoveDOMNode(node); |
215 #endif | |
216 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 201 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
217 domAgent->didRemoveDOMNode(node); | 202 domAgent->didRemoveDOMNode(node); |
218 } | 203 } |
219 | 204 |
220 void InspectorInstrumentation::willModifyDOMAttrImpl(InstrumentingAgents* instru
mentingAgents, Element* element, const AtomicString& oldValue, const AtomicStrin
g& newValue) | 205 void InspectorInstrumentation::willModifyDOMAttrImpl(InstrumentingAgents* instru
mentingAgents, Element* element, const AtomicString& oldValue, const AtomicStrin
g& newValue) |
221 { | 206 { |
222 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
223 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 207 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
224 domDebuggerAgent->willModifyDOMAttr(element); | 208 domDebuggerAgent->willModifyDOMAttr(element); |
225 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 209 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
226 domAgent->willModifyDOMAttr(element, oldValue, newValue); | 210 domAgent->willModifyDOMAttr(element, oldValue, newValue); |
227 #endif | |
228 } | 211 } |
229 | 212 |
230 void InspectorInstrumentation::didModifyDOMAttrImpl(InstrumentingAgents* instrum
entingAgents, Element* element, const AtomicString& name, const AtomicString& va
lue) | 213 void InspectorInstrumentation::didModifyDOMAttrImpl(InstrumentingAgents* instrum
entingAgents, Element* element, const AtomicString& name, const AtomicString& va
lue) |
231 { | 214 { |
232 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 215 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
233 domAgent->didModifyDOMAttr(element, name, value); | 216 domAgent->didModifyDOMAttr(element, name, value); |
234 } | 217 } |
235 | 218 |
236 void InspectorInstrumentation::didRemoveDOMAttrImpl(InstrumentingAgents* instrum
entingAgents, Element* element, const AtomicString& name) | 219 void InspectorInstrumentation::didRemoveDOMAttrImpl(InstrumentingAgents* instrum
entingAgents, Element* element, const AtomicString& name) |
237 { | 220 { |
238 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 221 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
239 domAgent->didRemoveDOMAttr(element, name); | 222 domAgent->didRemoveDOMAttr(element, name); |
240 } | 223 } |
241 | 224 |
242 void InspectorInstrumentation::didInvalidateStyleAttrImpl(InstrumentingAgents* i
nstrumentingAgents, Node* node) | 225 void InspectorInstrumentation::didInvalidateStyleAttrImpl(InstrumentingAgents* i
nstrumentingAgents, Node* node) |
243 { | 226 { |
244 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 227 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
245 domAgent->didInvalidateStyleAttr(node); | 228 domAgent->didInvalidateStyleAttr(node); |
246 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
247 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 229 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
248 domDebuggerAgent->didInvalidateStyleAttr(node); | 230 domDebuggerAgent->didInvalidateStyleAttr(node); |
249 #endif | |
250 } | 231 } |
251 | 232 |
252 void InspectorInstrumentation::frameWindowDiscardedImpl(InstrumentingAgents* ins
trumentingAgents, DOMWindow* window) | 233 void InspectorInstrumentation::frameWindowDiscardedImpl(InstrumentingAgents* ins
trumentingAgents, DOMWindow* window) |
253 { | 234 { |
254 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) | 235 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) |
255 consoleAgent->frameWindowDiscarded(window); | 236 consoleAgent->frameWindowDiscarded(window); |
256 } | 237 } |
257 | 238 |
258 void InspectorInstrumentation::mediaQueryResultChangedImpl(InstrumentingAgents*
instrumentingAgents) | 239 void InspectorInstrumentation::mediaQueryResultChangedImpl(InstrumentingAgents*
instrumentingAgents) |
259 { | 240 { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 306 } |
326 | 307 |
327 void InspectorInstrumentation::characterDataModifiedImpl(InstrumentingAgents* in
strumentingAgents, CharacterData* characterData) | 308 void InspectorInstrumentation::characterDataModifiedImpl(InstrumentingAgents* in
strumentingAgents, CharacterData* characterData) |
328 { | 309 { |
329 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) | 310 if (InspectorDOMAgent* domAgent = instrumentingAgents->inspectorDOMAgent()) |
330 domAgent->characterDataModified(characterData); | 311 domAgent->characterDataModified(characterData); |
331 } | 312 } |
332 | 313 |
333 void InspectorInstrumentation::willSendXMLHttpRequestImpl(InstrumentingAgents* i
nstrumentingAgents, const String& url) | 314 void InspectorInstrumentation::willSendXMLHttpRequestImpl(InstrumentingAgents* i
nstrumentingAgents, const String& url) |
334 { | 315 { |
335 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
336 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 316 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
337 domDebuggerAgent->willSendXMLHttpRequest(url); | 317 domDebuggerAgent->willSendXMLHttpRequest(url); |
338 #endif | |
339 } | 318 } |
340 | 319 |
341 void InspectorInstrumentation::didScheduleResourceRequestImpl(InstrumentingAgent
s* instrumentingAgents, const String& url, Frame* frame) | 320 void InspectorInstrumentation::didScheduleResourceRequestImpl(InstrumentingAgent
s* instrumentingAgents, const String& url, Frame* frame) |
342 { | 321 { |
343 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) | 322 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) |
344 timelineAgent->didScheduleResourceRequest(url, frame); | 323 timelineAgent->didScheduleResourceRequest(url, frame); |
345 } | 324 } |
346 | 325 |
347 void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents* instrume
ntingAgents, int timerId, int timeout, bool singleShot, ScriptExecutionContext*
context) | 326 void InspectorInstrumentation::didInstallTimerImpl(InstrumentingAgents* instrume
ntingAgents, int timerId, int timeout, bool singleShot, ScriptExecutionContext*
context) |
348 { | 327 { |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 } | 814 } |
836 | 815 |
837 void InspectorInstrumentation::scriptImportedImpl(InstrumentingAgents* instrumen
tingAgents, unsigned long identifier, const String& sourceString) | 816 void InspectorInstrumentation::scriptImportedImpl(InstrumentingAgents* instrumen
tingAgents, unsigned long identifier, const String& sourceString) |
838 { | 817 { |
839 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorRe
sourceAgent()) | 818 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorRe
sourceAgent()) |
840 resourceAgent->setInitialScriptContent(identifier, sourceString); | 819 resourceAgent->setInitialScriptContent(identifier, sourceString); |
841 } | 820 } |
842 | 821 |
843 void InspectorInstrumentation::scriptExecutionBlockedByCSPImpl(InstrumentingAgen
ts* instrumentingAgents, const String& directiveText) | 822 void InspectorInstrumentation::scriptExecutionBlockedByCSPImpl(InstrumentingAgen
ts* instrumentingAgents, const String& directiveText) |
844 { | 823 { |
845 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
846 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) | 824 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) |
847 debuggerAgent->scriptExecutionBlockedByCSP(directiveText); | 825 debuggerAgent->scriptExecutionBlockedByCSP(directiveText); |
848 #endif | |
849 } | 826 } |
850 | 827 |
851 void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents*
instrumentingAgents, unsigned long identifier) | 828 void InspectorInstrumentation::didReceiveScriptResponseImpl(InstrumentingAgents*
instrumentingAgents, unsigned long identifier) |
852 { | 829 { |
853 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorRe
sourceAgent()) | 830 if (InspectorResourceAgent* resourceAgent = instrumentingAgents->inspectorRe
sourceAgent()) |
854 resourceAgent->didReceiveScriptResponse(identifier); | 831 resourceAgent->didReceiveScriptResponse(identifier); |
855 } | 832 } |
856 | 833 |
857 void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgent
s* instrumentingAgents, Frame* frame) | 834 void InspectorInstrumentation::domContentLoadedEventFiredImpl(InstrumentingAgent
s* instrumentingAgents, Frame* frame) |
858 { | 835 { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 { | 984 { |
1008 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) | 985 if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie)) |
1009 timelineAgent->didWriteHTML(endLine); | 986 timelineAgent->didWriteHTML(endLine); |
1010 } | 987 } |
1011 | 988 |
1012 // FIXME: Drop this once we no longer generate stacks outside of Inspector. | 989 // FIXME: Drop this once we no longer generate stacks outside of Inspector. |
1013 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long request
Identifier) | 990 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long request
Identifier) |
1014 { | 991 { |
1015 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) | 992 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) |
1016 consoleAgent->addMessageToConsole(source, type, level, message, callStac
k, requestIdentifier); | 993 consoleAgent->addMessageToConsole(source, type, level, message, callStac
k, requestIdentifier); |
1017 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1018 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) | 994 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) |
1019 debuggerAgent->addMessageToConsole(source, type); | 995 debuggerAgent->addMessageToConsole(source, type); |
1020 #endif | |
1021 } | 996 } |
1022 | 997 |
1023 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, u
nsigned long requestIdentifier) | 998 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, u
nsigned long requestIdentifier) |
1024 { | 999 { |
1025 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) | 1000 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) |
1026 consoleAgent->addMessageToConsole(source, type, level, message, state, a
rguments, requestIdentifier); | 1001 consoleAgent->addMessageToConsole(source, type, level, message, state, a
rguments, requestIdentifier); |
1027 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1028 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) | 1002 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) |
1029 debuggerAgent->addMessageToConsole(source, type); | 1003 debuggerAgent->addMessageToConsole(source, type); |
1030 #endif | |
1031 } | 1004 } |
1032 | 1005 |
1033 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, const String& scriptId, unsigned lineNumber, ScriptState* st
ate, unsigned long requestIdentifier) | 1006 void InspectorInstrumentation::addMessageToConsoleImpl(InstrumentingAgents* inst
rumentingAgents, MessageSource source, MessageType type, MessageLevel level, con
st String& message, const String& scriptId, unsigned lineNumber, ScriptState* st
ate, unsigned long requestIdentifier) |
1034 { | 1007 { |
1035 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) | 1008 if (InspectorConsoleAgent* consoleAgent = instrumentingAgents->inspectorCons
oleAgent()) |
1036 consoleAgent->addMessageToConsole(source, type, level, message, scriptId
, lineNumber, state, requestIdentifier); | 1009 consoleAgent->addMessageToConsole(source, type, level, message, scriptId
, lineNumber, state, requestIdentifier); |
1037 } | 1010 } |
1038 | 1011 |
1039 void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents* instrumenti
ngAgents, ScriptState* state, PassRefPtr<ScriptArguments> arguments) | 1012 void InspectorInstrumentation::consoleCountImpl(InstrumentingAgents* instrumenti
ngAgents, ScriptState* state, PassRefPtr<ScriptArguments> arguments) |
1040 { | 1013 { |
(...skipping 19 matching lines...) Expand all Loading... |
1060 | 1033 |
1061 void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents* instrum
entingAgents, Frame* frame, PassRefPtr<ScriptArguments> arguments) | 1034 void InspectorInstrumentation::consoleTimeStampImpl(InstrumentingAgents* instrum
entingAgents, Frame* frame, PassRefPtr<ScriptArguments> arguments) |
1062 { | 1035 { |
1063 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) { | 1036 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) { |
1064 String message; | 1037 String message; |
1065 arguments->getFirstArgumentAsString(message); | 1038 arguments->getFirstArgumentAsString(message); |
1066 timelineAgent->didTimeStamp(frame, message); | 1039 timelineAgent->didTimeStamp(frame, message); |
1067 } | 1040 } |
1068 } | 1041 } |
1069 | 1042 |
1070 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1071 void InspectorInstrumentation::addStartProfilingMessageToConsoleImpl(Instrumenti
ngAgents* instrumentingAgents, const String& title, unsigned lineNumber, const S
tring& sourceURL) | 1043 void InspectorInstrumentation::addStartProfilingMessageToConsoleImpl(Instrumenti
ngAgents* instrumentingAgents, const String& title, unsigned lineNumber, const S
tring& sourceURL) |
1072 { | 1044 { |
1073 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) | 1045 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) |
1074 profilerAgent->addStartProfilingMessageToConsole(title, lineNumber, sour
ceURL); | 1046 profilerAgent->addStartProfilingMessageToConsole(title, lineNumber, sour
ceURL); |
1075 } | 1047 } |
1076 | 1048 |
1077 void InspectorInstrumentation::addProfileImpl(InstrumentingAgents* instrumenting
Agents, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack) | 1049 void InspectorInstrumentation::addProfileImpl(InstrumentingAgents* instrumenting
Agents, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack) |
1078 { | 1050 { |
1079 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) { | 1051 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) { |
1080 const ScriptCallFrame& lastCaller = callStack->at(0); | 1052 const ScriptCallFrame& lastCaller = callStack->at(0); |
1081 profilerAgent->addProfile(profile, lastCaller.lineNumber(), lastCaller.s
ourceURL()); | 1053 profilerAgent->addProfile(profile, lastCaller.lineNumber(), lastCaller.s
ourceURL()); |
1082 } | 1054 } |
1083 } | 1055 } |
1084 | 1056 |
1085 String InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(Instrume
ntingAgents* instrumentingAgents, bool incrementProfileNumber) | 1057 String InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(Instrume
ntingAgents* instrumentingAgents, bool incrementProfileNumber) |
1086 { | 1058 { |
1087 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) | 1059 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) |
1088 return profilerAgent->getCurrentUserInitiatedProfileName(incrementProfil
eNumber); | 1060 return profilerAgent->getCurrentUserInitiatedProfileName(incrementProfil
eNumber); |
1089 return ""; | 1061 return ""; |
1090 } | 1062 } |
1091 | 1063 |
1092 bool InspectorInstrumentation::profilerEnabledImpl(InstrumentingAgents* instrume
ntingAgents) | 1064 bool InspectorInstrumentation::profilerEnabledImpl(InstrumentingAgents* instrume
ntingAgents) |
1093 { | 1065 { |
1094 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) | 1066 if (InspectorProfilerAgent* profilerAgent = instrumentingAgents->inspectorPr
ofilerAgent()) |
1095 return profilerAgent->enabled(); | 1067 return profilerAgent->enabled(); |
1096 return false; | 1068 return false; |
1097 } | 1069 } |
1098 #endif | |
1099 | 1070 |
1100 #if ENABLE(SQL_DATABASE) | 1071 #if ENABLE(SQL_DATABASE) |
1101 void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents* instrume
ntingAgents, PassRefPtr<Database> database, const String& domain, const String&
name, const String& version) | 1072 void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents* instrume
ntingAgents, PassRefPtr<Database> database, const String& domain, const String&
name, const String& version) |
1102 { | 1073 { |
1103 InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent(); | 1074 InspectorAgent* inspectorAgent = instrumentingAgents->inspectorAgent(); |
1104 if (!inspectorAgent || !inspectorAgent->developerExtrasEnabled()) | 1075 if (!inspectorAgent || !inspectorAgent->developerExtrasEnabled()) |
1105 return; | 1076 return; |
1106 if (InspectorDatabaseAgent* dbAgent = instrumentingAgents->inspectorDatabase
Agent()) | 1077 if (InspectorDatabaseAgent* dbAgent = instrumentingAgents->inspectorDatabase
Agent()) |
1107 dbAgent->didOpenDatabase(database, domain, name, version); | 1078 dbAgent->didOpenDatabase(database, domain, name, version); |
1108 } | 1079 } |
(...skipping 19 matching lines...) Expand all Loading... |
1128 workerAgent->didStartWorkerContext(workerContextProxy, url); | 1099 workerAgent->didStartWorkerContext(workerContextProxy, url); |
1129 } | 1100 } |
1130 | 1101 |
1131 void InspectorInstrumentation::willEvaluateWorkerScript(WorkerContext* workerCon
text, int workerThreadStartMode) | 1102 void InspectorInstrumentation::willEvaluateWorkerScript(WorkerContext* workerCon
text, int workerThreadStartMode) |
1132 { | 1103 { |
1133 if (workerThreadStartMode != PauseWorkerContextOnStart) | 1104 if (workerThreadStartMode != PauseWorkerContextOnStart) |
1134 return; | 1105 return; |
1135 InstrumentingAgents* instrumentingAgents = instrumentationForWorkerContext(w
orkerContext); | 1106 InstrumentingAgents* instrumentingAgents = instrumentationForWorkerContext(w
orkerContext); |
1136 if (!instrumentingAgents) | 1107 if (!instrumentingAgents) |
1137 return; | 1108 return; |
1138 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1139 if (WorkerRuntimeAgent* runtimeAgent = instrumentingAgents->workerRuntimeAge
nt()) | 1109 if (WorkerRuntimeAgent* runtimeAgent = instrumentingAgents->workerRuntimeAge
nt()) |
1140 runtimeAgent->pauseWorkerContext(workerContext); | 1110 runtimeAgent->pauseWorkerContext(workerContext); |
1141 #endif | |
1142 } | 1111 } |
1143 | 1112 |
1144 void InspectorInstrumentation::workerContextTerminatedImpl(InstrumentingAgents*
instrumentingAgents, WorkerContextProxy* proxy) | 1113 void InspectorInstrumentation::workerContextTerminatedImpl(InstrumentingAgents*
instrumentingAgents, WorkerContextProxy* proxy) |
1145 { | 1114 { |
1146 if (InspectorWorkerAgent* workerAgent = instrumentingAgents->inspectorWorker
Agent()) | 1115 if (InspectorWorkerAgent* workerAgent = instrumentingAgents->inspectorWorker
Agent()) |
1147 workerAgent->workerContextTerminated(proxy); | 1116 workerAgent->workerContextTerminated(proxy); |
1148 } | 1117 } |
1149 #endif | 1118 #endif |
1150 | 1119 |
1151 #if ENABLE(WEB_SOCKETS) | 1120 #if ENABLE(WEB_SOCKETS) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 } | 1203 } |
1235 | 1204 |
1236 bool InspectorInstrumentation::timelineAgentEnabled(ScriptExecutionContext* scri
ptExecutionContext) | 1205 bool InspectorInstrumentation::timelineAgentEnabled(ScriptExecutionContext* scri
ptExecutionContext) |
1237 { | 1206 { |
1238 InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(scr
iptExecutionContext); | 1207 InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(scr
iptExecutionContext); |
1239 return instrumentingAgents && instrumentingAgents->inspectorTimelineAgent(); | 1208 return instrumentingAgents && instrumentingAgents->inspectorTimelineAgent(); |
1240 } | 1209 } |
1241 | 1210 |
1242 void InspectorInstrumentation::pauseOnNativeEventIfNeeded(InstrumentingAgents* i
nstrumentingAgents, bool isDOMEvent, const String& eventName, bool synchronous) | 1211 void InspectorInstrumentation::pauseOnNativeEventIfNeeded(InstrumentingAgents* i
nstrumentingAgents, bool isDOMEvent, const String& eventName, bool synchronous) |
1243 { | 1212 { |
1244 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1245 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) | 1213 if (InspectorDOMDebuggerAgent* domDebuggerAgent = instrumentingAgents->inspe
ctorDOMDebuggerAgent()) |
1246 domDebuggerAgent->pauseOnNativeEventIfNeeded(isDOMEvent, eventName, sync
hronous); | 1214 domDebuggerAgent->pauseOnNativeEventIfNeeded(isDOMEvent, eventName, sync
hronous); |
1247 #endif | |
1248 } | 1215 } |
1249 | 1216 |
1250 void InspectorInstrumentation::cancelPauseOnNativeEvent(InstrumentingAgents* ins
trumentingAgents) | 1217 void InspectorInstrumentation::cancelPauseOnNativeEvent(InstrumentingAgents* ins
trumentingAgents) |
1251 { | 1218 { |
1252 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
1253 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) | 1219 if (InspectorDebuggerAgent* debuggerAgent = instrumentingAgents->inspectorDe
buggerAgent()) |
1254 debuggerAgent->cancelPauseOnNextStatement(); | 1220 debuggerAgent->cancelPauseOnNextStatement(); |
1255 #endif | |
1256 } | 1221 } |
1257 | 1222 |
1258 void InspectorInstrumentation::didRequestAnimationFrameImpl(InstrumentingAgents*
instrumentingAgents, int callbackId, Frame* frame) | 1223 void InspectorInstrumentation::didRequestAnimationFrameImpl(InstrumentingAgents*
instrumentingAgents, int callbackId, Frame* frame) |
1259 { | 1224 { |
1260 pauseOnNativeEventIfNeeded(instrumentingAgents, false, requestAnimationFrame
EventName, true); | 1225 pauseOnNativeEventIfNeeded(instrumentingAgents, false, requestAnimationFrame
EventName, true); |
1261 | 1226 |
1262 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) | 1227 if (InspectorTimelineAgent* timelineAgent = instrumentingAgents->inspectorTi
melineAgent()) |
1263 timelineAgent->didRequestAnimationFrame(callbackId, frame); | 1228 timelineAgent->didRequestAnimationFrame(callbackId, frame); |
1264 } | 1229 } |
1265 | 1230 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1389 const char BeginFrame[] = "BeginFrame"; | 1354 const char BeginFrame[] = "BeginFrame"; |
1390 }; | 1355 }; |
1391 | 1356 |
1392 namespace InstrumentationEventArguments { | 1357 namespace InstrumentationEventArguments { |
1393 const char LayerId[] = "layerId"; | 1358 const char LayerId[] = "layerId"; |
1394 const char PageId[] = "pageId"; | 1359 const char PageId[] = "pageId"; |
1395 }; | 1360 }; |
1396 | 1361 |
1397 } // namespace WebCore | 1362 } // namespace WebCore |
1398 | 1363 |
1399 #endif // !ENABLE(INSPECTOR) | |
OLD | NEW |