Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: Source/WebCore/inspector/InspectorInstrumentation.cpp

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

Powered by Google App Engine
This is Rietveld 408576698