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) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 if (!m_pausedScriptState || !m_currentCallStack) | 830 if (!m_pausedScriptState || !m_currentCallStack) |
831 return Array<TypeBuilder::Debugger::CallFrame>::create(); | 831 return Array<TypeBuilder::Debugger::CallFrame>::create(); |
832 DartInjectedScript* injectedScript = m_injectedScriptManager->injectedScript
For(m_pausedScriptState.get()); | 832 DartInjectedScript* injectedScript = m_injectedScriptManager->injectedScript
For(m_pausedScriptState.get()); |
833 if (!injectedScript) { | 833 if (!injectedScript) { |
834 ASSERT_NOT_REACHED(); | 834 ASSERT_NOT_REACHED(); |
835 return Array<CallFrame>::create(); | 835 return Array<CallFrame>::create(); |
836 } | 836 } |
837 return injectedScript->wrapCallFrames(m_currentCallStack, 0); | 837 return injectedScript->wrapCallFrames(m_currentCallStack, 0); |
838 } | 838 } |
839 | 839 |
840 String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script, Compi
leResult compileResult) | 840 String DartInspectorDebuggerAgent::sourceMapURLForScript(const Script& script, C
ompileResult compileResult) |
841 { | 841 { |
842 bool hasSyntaxError = compileResult != CompileSuccess; | 842 bool hasSyntaxError = compileResult != CompileSuccess; |
843 if (!hasSyntaxError) | 843 if (!hasSyntaxError) |
844 return script.sourceMappingURL(); | 844 return script.sourceMappingURL; |
845 return ContentSearchUtils::findSourceMapURL(script.source(), ContentSearchUt
ils::JavaScriptMagicComment); | 845 return ContentSearchUtils::findSourceMapURL(script.source, ContentSearchUtil
s::JavaScriptMagicComment); |
846 } | 846 } |
847 | 847 |
848 // DartScriptDebugListener functions | 848 // DartScriptDebugListener functions |
849 | 849 |
850 void DartInspectorDebuggerAgent::didParseSource(const String& scriptId, const Sc
ript& parsedScript, CompileResult compileResult) | 850 void DartInspectorDebuggerAgent::didParseSource(const String& scriptId, const Sc
ript& parsedScript, CompileResult compileResult) |
851 { | 851 { |
852 Script script = parsedScript; | 852 Script script = parsedScript; |
853 const bool* isContentScript = script.isContentScript ? &script.isContentScri
pt : 0; | 853 const bool* isContentScript = script.isContentScript ? &script.isContentScri
pt : 0; |
854 | 854 |
855 const String* languageParam = script.language.isNull() ? 0 : &(script.langua
ge); | 855 const String* languageParam = script.language.isNull() ? 0 : &(script.langua
ge); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 ScriptBreakpoint breakpoint; | 898 ScriptBreakpoint breakpoint; |
899 breakpointObject->getNumber(DartDebuggerAgentState::lineNumber, &breakpo
int.lineNumber); | 899 breakpointObject->getNumber(DartDebuggerAgentState::lineNumber, &breakpo
int.lineNumber); |
900 breakpointObject->getNumber(DartDebuggerAgentState::columnNumber, &break
point.columnNumber); | 900 breakpointObject->getNumber(DartDebuggerAgentState::columnNumber, &break
point.columnNumber); |
901 breakpointObject->getString(DartDebuggerAgentState::condition, &breakpoi
nt.condition); | 901 breakpointObject->getString(DartDebuggerAgentState::condition, &breakpoi
nt.condition); |
902 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it-
>key, scriptId, breakpoint, UserBreakpointSource); | 902 RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it-
>key, scriptId, breakpoint, UserBreakpointSource); |
903 if (location) | 903 if (location) |
904 m_frontend->breakpointResolved(it->key, location); | 904 m_frontend->breakpointResolved(it->key, location); |
905 } | 905 } |
906 } | 906 } |
907 | 907 |
908 DartScriptDebugListener::SkipPauseRequest DartInspectorDebuggerAgent::didPause(D
artScriptState* scriptState, Dart_StackTrace callFrames, const ScriptValue& exce
ption, const Vector<String>& hitBreakpoints) | 908 DartScriptDebugListener::SkipPauseRequest DartInspectorDebuggerAgent::didPause(D
artScriptState* scriptState, Dart_StackTrace callFrames, Dart_Handle exception,
const Vector<String>& hitBreakpoints) |
909 { | 909 { |
910 DartScriptDebugListener::SkipPauseRequest result; | 910 DartScriptDebugListener::SkipPauseRequest result; |
911 if (!callFrames) | 911 if (!callFrames) |
912 result = DartScriptDebugListener::Continue; // Skip pauses inside V8 int
ernal scripts and on syntax errors. | 912 result = DartScriptDebugListener::Continue; // Skip pauses inside V8 int
ernal scripts and on syntax errors. |
913 else if (m_javaScriptPauseScheduled) | 913 else if (m_javaScriptPauseScheduled) |
914 result = DartScriptDebugListener::NoSkip; // Don't skip explicit pause r
equests from front-end. | 914 result = DartScriptDebugListener::NoSkip; // Don't skip explicit pause r
equests from front-end. |
915 else if (m_skipAllPauses) | 915 else if (m_skipAllPauses) |
916 result = DartScriptDebugListener::Continue; | 916 result = DartScriptDebugListener::Continue; |
917 else if (!hitBreakpoints.isEmpty()) | 917 else if (!hitBreakpoints.isEmpty()) |
918 result = DartScriptDebugListener::NoSkip; // Don't skip explicit breakpo
ints even if set in frameworks. | 918 result = DartScriptDebugListener::NoSkip; // Don't skip explicit breakpo
ints even if set in frameworks. |
919 else if (!exception.isEmpty()) | 919 else if (!exception) |
920 result = shouldSkipExceptionPause(); | 920 result = shouldSkipExceptionPause(); |
921 else if (m_debuggerStepScheduled || m_pausingOnNativeEvent) | 921 else if (m_debuggerStepScheduled || m_pausingOnNativeEvent) |
922 result = shouldSkipStepPause(); | 922 result = shouldSkipStepPause(); |
923 else | 923 else |
924 result = DartScriptDebugListener::NoSkip; | 924 result = DartScriptDebugListener::NoSkip; |
925 | 925 |
926 if (result != DartScriptDebugListener::NoSkip) | 926 if (result != DartScriptDebugListener::NoSkip) |
927 return result; | 927 return result; |
928 | 928 |
929 ASSERT(scriptState && !m_pausedScriptState); | 929 ASSERT(scriptState && !m_pausedScriptState); |
930 m_pausedScriptState = scriptState; | 930 m_pausedScriptState = scriptState; |
931 m_currentCallStack = callFrames; | 931 m_currentCallStack = callFrames; |
932 | 932 |
933 if (!exception.isEmpty()) { | 933 if (exception) { |
934 DartInjectedScript* injectedScript = m_injectedScriptManager->injectedSc
riptFor(scriptState); | 934 DartInjectedScript* injectedScript = m_injectedScriptManager->injectedSc
riptFor(scriptState); |
935 if (injectedScript) { | 935 if (injectedScript) { |
936 m_breakReason = InspectorFrontend::Debugger::Reason::Exception; | 936 m_breakReason = InspectorFrontend::Debugger::Reason::Exception; |
937 m_breakAuxData = injectedScript->wrapObject(exception, DartInspector
DebuggerAgent::backtraceObjectGroup)->openAccessors(); | 937 m_breakAuxData = injectedScript->wrapDartObject(exception, DartInspe
ctorDebuggerAgent::backtraceObjectGroup)->openAccessors(); |
938 // m_breakAuxData might be null after this. | 938 // m_breakAuxData might be null after this. |
939 } | 939 } |
940 } | 940 } |
941 | 941 |
942 RefPtr<Array<String> > hitBreakpointIds = Array<String>::create(); | 942 RefPtr<Array<String> > hitBreakpointIds = Array<String>::create(); |
943 | 943 |
944 for (Vector<String>::const_iterator i = hitBreakpoints.begin(); i != hitBrea
kpoints.end(); ++i) { | 944 for (Vector<String>::const_iterator i = hitBreakpoints.begin(); i != hitBrea
kpoints.end(); ++i) { |
945 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter
ator = m_serverBreakpoints.find(*i); | 945 DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIter
ator = m_serverBreakpoints.find(*i); |
946 if (breakpointIterator != m_serverBreakpoints.end()) { | 946 if (breakpointIterator != m_serverBreakpoints.end()) { |
947 const String& localId = breakpointIterator->value.first; | 947 const String& localId = breakpointIterator->value.first; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 m_breakpointIdToDebugServerBreakpointIds.clear(); | 1044 m_breakpointIdToDebugServerBreakpointIds.clear(); |
1045 } | 1045 } |
1046 | 1046 |
1047 DartScriptDebugServer& DartInspectorDebuggerAgent::scriptDebugServer() | 1047 DartScriptDebugServer& DartInspectorDebuggerAgent::scriptDebugServer() |
1048 { | 1048 { |
1049 return DartScriptDebugServer::shared(); | 1049 return DartScriptDebugServer::shared(); |
1050 } | 1050 } |
1051 | 1051 |
1052 } // namespace blink | 1052 } // namespace blink |
1053 | 1053 |
OLD | NEW |