OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 { | 259 { |
260 return scriptDebugServer().runningNestedMessageLoop(); | 260 return scriptDebugServer().runningNestedMessageLoop(); |
261 } | 261 } |
262 | 262 |
263 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type) | 263 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type) |
264 { | 264 { |
265 if (source == ConsoleAPIMessageSource && type == AssertMessageType && script
DebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptio
ns) | 265 if (source == ConsoleAPIMessageSource && type == AssertMessageType && script
DebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptio
ns) |
266 breakProgram(InspectorFrontend::Debugger::Reason::Assert, nullptr); | 266 breakProgram(InspectorFrontend::Debugger::Reason::Assert, nullptr); |
267 } | 267 } |
268 | 268 |
269 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type, MessageLevel, const String&, ScriptCallStack*, unsigned long) | 269 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type, MessageLevel, const String&, PassRefPtrWillBeRawPtr<ScriptCallStack>, u
nsigned long) |
270 { | 270 { |
271 addMessageToConsole(source, type); | 271 addMessageToConsole(source, type); |
272 } | 272 } |
273 | 273 |
274 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type, MessageLevel, const String&, ScriptState*, ScriptArguments*, unsigned l
ong) | 274 void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageTy
pe type, MessageLevel, const String&, ScriptState*, PassRefPtrWillBeRawPtr<Scrip
tArguments>, unsigned long) |
275 { | 275 { |
276 addMessageToConsole(source, type); | 276 addMessageToConsole(source, type); |
277 } | 277 } |
278 | 278 |
279 String InspectorDebuggerAgent::preprocessEventListener(LocalFrame* frame, const
String& source, const String& url, const String& functionName) | 279 String InspectorDebuggerAgent::preprocessEventListener(LocalFrame* frame, const
String& source, const String& url, const String& functionName) |
280 { | 280 { |
281 return scriptDebugServer().preprocessEventListener(frame, source, url, funct
ionName); | 281 return scriptDebugServer().preprocessEventListener(frame, source, url, funct
ionName); |
282 } | 282 } |
283 | 283 |
284 PassOwnPtr<ScriptSourceCode> InspectorDebuggerAgent::preprocess(LocalFrame* fram
e, const ScriptSourceCode& sourceCode) | 284 PassOwnPtr<ScriptSourceCode> InspectorDebuggerAgent::preprocess(LocalFrame* fram
e, const ScriptSourceCode& sourceCode) |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 ScriptsMap::iterator it = m_scripts.find(scriptIdString); | 469 ScriptsMap::iterator it = m_scripts.find(scriptIdString); |
470 if (it == m_scripts.end()) | 470 if (it == m_scripts.end()) |
471 return String(); | 471 return String(); |
472 return it->value.url; | 472 return it->value.url; |
473 } | 473 } |
474 | 474 |
475 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio
nPause() | 475 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipExceptio
nPause() |
476 { | 476 { |
477 // FIXME: Fast return: if (!m_cachedSkipStackRegExp && !has_any_anti_breakpo
int) return ScriptDebugListener::NoSkip; | 477 // FIXME: Fast return: if (!m_cachedSkipStackRegExp && !has_any_anti_breakpo
int) return ScriptDebugListener::NoSkip; |
478 | 478 |
479 RefPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCallFrameNoSco
pes(); | 479 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCa
llFrameNoScopes(); |
480 if (!topFrame) | 480 if (!topFrame) |
481 return ScriptDebugListener::NoSkip; | 481 return ScriptDebugListener::NoSkip; |
482 | 482 |
483 String topFrameScriptUrl = scriptURL(topFrame.get()); | 483 String topFrameScriptUrl = scriptURL(topFrame.get()); |
484 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS
tackRegExp->match(topFrameScriptUrl) != -1) | 484 if (m_cachedSkipStackRegExp && !topFrameScriptUrl.isEmpty() && m_cachedSkipS
tackRegExp->match(topFrameScriptUrl) != -1) |
485 return ScriptDebugListener::Continue; | 485 return ScriptDebugListener::Continue; |
486 | 486 |
487 // Match against breakpoints. | 487 // Match against breakpoints. |
488 if (topFrameScriptUrl.isEmpty()) | 488 if (topFrameScriptUrl.isEmpty()) |
489 return ScriptDebugListener::NoSkip; | 489 return ScriptDebugListener::NoSkip; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 } | 522 } |
523 | 523 |
524 return ScriptDebugListener::NoSkip; | 524 return ScriptDebugListener::NoSkip; |
525 } | 525 } |
526 | 526 |
527 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus
e() | 527 ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::shouldSkipStepPaus
e() |
528 { | 528 { |
529 if (!m_cachedSkipStackRegExp) | 529 if (!m_cachedSkipStackRegExp) |
530 return ScriptDebugListener::NoSkip; | 530 return ScriptDebugListener::NoSkip; |
531 | 531 |
532 RefPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCallFrameNoSco
pes(); | 532 RefPtrWillBeRawPtr<JavaScriptCallFrame> topFrame = scriptDebugServer().topCa
llFrameNoScopes(); |
533 String scriptUrl = scriptURL(topFrame.get()); | 533 String scriptUrl = scriptURL(topFrame.get()); |
534 if (scriptUrl.isEmpty() || m_cachedSkipStackRegExp->match(scriptUrl) == -1) | 534 if (scriptUrl.isEmpty() || m_cachedSkipStackRegExp->match(scriptUrl) == -1) |
535 return ScriptDebugListener::NoSkip; | 535 return ScriptDebugListener::NoSkip; |
536 | 536 |
537 if (m_skippedStepInCount == 0) { | 537 if (m_skippedStepInCount == 0) { |
538 m_minFrameCountForSkip = scriptDebugServer().frameCount(); | 538 m_minFrameCountForSkip = scriptDebugServer().frameCount(); |
539 m_skippedStepInCount = 1; | 539 m_skippedStepInCount = 1; |
540 return ScriptDebugListener::StepInto; | 540 return ScriptDebugListener::StepInto; |
541 } | 541 } |
542 | 542 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 InjectedScript injectedScript = injectedScriptForEval(errorString, execution
ContextId); | 894 InjectedScript injectedScript = injectedScriptForEval(errorString, execution
ContextId); |
895 if (injectedScript.isEmpty()) { | 895 if (injectedScript.isEmpty()) { |
896 *errorString = "Inspected frame has gone"; | 896 *errorString = "Inspected frame has gone"; |
897 return; | 897 return; |
898 } | 898 } |
899 | 899 |
900 String scriptIdValue; | 900 String scriptIdValue; |
901 String exceptionDetailsText; | 901 String exceptionDetailsText; |
902 int lineNumberValue = 0; | 902 int lineNumberValue = 0; |
903 int columnNumberValue = 0; | 903 int columnNumberValue = 0; |
904 RefPtr<ScriptCallStack> stackTraceValue; | 904 RefPtrWillBeRawPtr<ScriptCallStack> stackTraceValue; |
905 scriptDebugServer().compileScript(injectedScript.scriptState(), expression,
sourceURL, &scriptIdValue, &exceptionDetailsText, &lineNumberValue, &columnNumbe
rValue, &stackTraceValue); | 905 scriptDebugServer().compileScript(injectedScript.scriptState(), expression,
sourceURL, &scriptIdValue, &exceptionDetailsText, &lineNumberValue, &columnNumbe
rValue, &stackTraceValue); |
906 if (!scriptIdValue && !exceptionDetailsText) { | 906 if (!scriptIdValue && !exceptionDetailsText) { |
907 *errorString = "Script compilation failed"; | 907 *errorString = "Script compilation failed"; |
908 return; | 908 return; |
909 } | 909 } |
910 *scriptId = scriptIdValue; | 910 *scriptId = scriptIdValue; |
911 if (!scriptIdValue.isEmpty()) | 911 if (!scriptIdValue.isEmpty()) |
912 return; | 912 return; |
913 | 913 |
914 exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsText); | 914 exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsText); |
(...skipping 16 matching lines...) Expand all Loading... |
931 if (previousPauseOnExceptionsState != ScriptDebugServer::DontPauseOnExce
ptions) | 931 if (previousPauseOnExceptionsState != ScriptDebugServer::DontPauseOnExce
ptions) |
932 scriptDebugServer().setPauseOnExceptionsState(ScriptDebugServer::Don
tPauseOnExceptions); | 932 scriptDebugServer().setPauseOnExceptionsState(ScriptDebugServer::Don
tPauseOnExceptions); |
933 muteConsole(); | 933 muteConsole(); |
934 } | 934 } |
935 | 935 |
936 ScriptValue value; | 936 ScriptValue value; |
937 bool wasThrownValue; | 937 bool wasThrownValue; |
938 String exceptionDetailsText; | 938 String exceptionDetailsText; |
939 int lineNumberValue = 0; | 939 int lineNumberValue = 0; |
940 int columnNumberValue = 0; | 940 int columnNumberValue = 0; |
941 RefPtr<ScriptCallStack> stackTraceValue; | 941 RefPtrWillBeRawPtr<ScriptCallStack> stackTraceValue; |
942 scriptDebugServer().runScript(injectedScript.scriptState(), scriptId, &value
, &wasThrownValue, &exceptionDetailsText, &lineNumberValue, &columnNumberValue,
&stackTraceValue); | 942 scriptDebugServer().runScript(injectedScript.scriptState(), scriptId, &value
, &wasThrownValue, &exceptionDetailsText, &lineNumberValue, &columnNumberValue,
&stackTraceValue); |
943 if (value.isEmpty()) { | 943 if (value.isEmpty()) { |
944 *errorString = "Script execution failed"; | 944 *errorString = "Script execution failed"; |
945 return; | 945 return; |
946 } | 946 } |
947 result = injectedScript.wrapObject(value, objectGroup ? *objectGroup : ""); | 947 result = injectedScript.wrapObject(value, objectGroup ? *objectGroup : ""); |
948 if (wasThrownValue) { | 948 if (wasThrownValue) { |
949 exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsTe
xt); | 949 exceptionDetails = ExceptionDetails::create().setText(exceptionDetailsTe
xt); |
950 exceptionDetails->setLine(lineNumberValue); | 950 exceptionDetails->setLine(lineNumberValue); |
951 exceptionDetails->setColumn(columnNumberValue); | 951 exceptionDetails->setColumn(columnNumberValue); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 { | 1265 { |
1266 m_scripts.clear(); | 1266 m_scripts.clear(); |
1267 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1267 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1268 m_asyncCallStackTracker.clear(); | 1268 m_asyncCallStackTracker.clear(); |
1269 if (m_frontend) | 1269 if (m_frontend) |
1270 m_frontend->globalObjectCleared(); | 1270 m_frontend->globalObjectCleared(); |
1271 } | 1271 } |
1272 | 1272 |
1273 } // namespace WebCore | 1273 } // namespace WebCore |
1274 | 1274 |
OLD | NEW |