| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/InjectedScript.h" | 9 #include "platform/v8_inspector/InjectedScript.h" |
| 10 #include "platform/v8_inspector/InspectedContext.h" | 10 #include "platform/v8_inspector/InspectedContext.h" |
| 11 #include "platform/v8_inspector/JavaScriptCallFrame.h" | 11 #include "platform/v8_inspector/JavaScriptCallFrame.h" |
| 12 #include "platform/v8_inspector/RemoteObjectId.h" | 12 #include "platform/v8_inspector/RemoteObjectId.h" |
| 13 #include "platform/v8_inspector/ScriptBreakpoint.h" | 13 #include "platform/v8_inspector/ScriptBreakpoint.h" |
| 14 #include "platform/v8_inspector/V8InspectorSessionImpl.h" | 14 #include "platform/v8_inspector/V8InspectorSessionImpl.h" |
| 15 #include "platform/v8_inspector/V8Regex.h" | 15 #include "platform/v8_inspector/V8Regex.h" |
| 16 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" | 16 #include "platform/v8_inspector/V8RuntimeAgentImpl.h" |
| 17 #include "platform/v8_inspector/V8StackTraceImpl.h" | 17 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 18 #include "platform/v8_inspector/V8StringUtil.h" | 18 #include "platform/v8_inspector/V8StringUtil.h" |
| 19 #include "platform/v8_inspector/public/V8ContentSearchUtil.h" | |
| 20 #include "platform/v8_inspector/public/V8Debugger.h" | 19 #include "platform/v8_inspector/public/V8Debugger.h" |
| 21 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 20 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
| 22 | 21 |
| 23 #include <algorithm> | 22 #include <algorithm> |
| 24 | 23 |
| 25 using blink::protocol::Array; | 24 using blink::protocol::Array; |
| 26 using blink::protocol::Maybe; | 25 using blink::protocol::Maybe; |
| 27 using blink::protocol::Debugger::BreakpointId; | 26 using blink::protocol::Debugger::BreakpointId; |
| 28 using blink::protocol::Debugger::CallFrame; | 27 using blink::protocol::Debugger::CallFrame; |
| 29 using blink::protocol::Runtime::ExceptionDetails; | 28 using blink::protocol::Runtime::ExceptionDetails; |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); | 986 V8StackTraceImpl* stackTrace = m_debugger->currentAsyncCallChain(); |
| 988 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu
llptr; | 987 return stackTrace ? stackTrace->buildInspectorObjectForTail(m_debugger) : nu
llptr; |
| 989 } | 988 } |
| 990 | 989 |
| 991 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip
t, bool success) | 990 void V8DebuggerAgentImpl::didParseSource(std::unique_ptr<V8DebuggerScript> scrip
t, bool success) |
| 992 { | 991 { |
| 993 v8::HandleScope handles(m_isolate); | 992 v8::HandleScope handles(m_isolate); |
| 994 String16 scriptSource = toProtocolString(script->source(m_isolate)); | 993 String16 scriptSource = toProtocolString(script->source(m_isolate)); |
| 995 bool isDeprecatedSourceURL = false; | 994 bool isDeprecatedSourceURL = false; |
| 996 if (!success) | 995 if (!success) |
| 997 script->setSourceURL(V8ContentSearchUtil::findSourceURL(scriptSource, fa
lse, &isDeprecatedSourceURL)); | 996 script->setSourceURL(findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL)); |
| 998 else if (script->hasSourceURL()) | 997 else if (script->hasSourceURL()) |
| 999 V8ContentSearchUtil::findSourceURL(scriptSource, false, &isDeprecatedSou
rceURL); | 998 findSourceURL(scriptSource, false, &isDeprecatedSourceURL); |
| 1000 | 999 |
| 1001 bool isDeprecatedSourceMappingURL = false; | 1000 bool isDeprecatedSourceMappingURL = false; |
| 1002 if (!success) | 1001 if (!success) |
| 1003 script->setSourceMappingURL(V8ContentSearchUtil::findSourceMapURL(script
Source, false, &isDeprecatedSourceMappingURL)); | 1002 script->setSourceMappingURL(findSourceMapURL(scriptSource, false, &isDep
recatedSourceMappingURL)); |
| 1004 else if (!script->sourceMappingURL().isEmpty()) | 1003 else if (!script->sourceMappingURL().isEmpty()) |
| 1005 V8ContentSearchUtil::findSourceMapURL(scriptSource, false, &isDeprecated
SourceMappingURL); | 1004 findSourceMapURL(scriptSource, false, &isDeprecatedSourceMappingURL); |
| 1006 | 1005 |
| 1007 bool isContentScript = script->isContentScript(); | 1006 bool isContentScript = script->isContentScript(); |
| 1008 bool isInternalScript = script->isInternalScript(); | 1007 bool isInternalScript = script->isInternalScript(); |
| 1009 bool isLiveEdit = script->isLiveEdit(); | 1008 bool isLiveEdit = script->isLiveEdit(); |
| 1010 bool hasSourceURL = script->hasSourceURL(); | 1009 bool hasSourceURL = script->hasSourceURL(); |
| 1011 String16 scriptId = script->scriptId(); | 1010 String16 scriptId = script->scriptId(); |
| 1012 String16 scriptURL = script->sourceURL(); | 1011 String16 scriptURL = script->sourceURL(); |
| 1013 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; | 1012 bool deprecatedCommentWasUsed = isDeprecatedSourceURL || isDeprecatedSourceM
appingURL; |
| 1014 | 1013 |
| 1015 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); | 1014 const Maybe<String16>& sourceMapURLParam = script->sourceMappingURL(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 { | 1188 { |
| 1190 if (!enabled()) | 1189 if (!enabled()) |
| 1191 return; | 1190 return; |
| 1192 m_scheduledDebuggerStep = NoStep; | 1191 m_scheduledDebuggerStep = NoStep; |
| 1193 m_scripts.clear(); | 1192 m_scripts.clear(); |
| 1194 m_blackboxedPositions.clear(); | 1193 m_blackboxedPositions.clear(); |
| 1195 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1194 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1196 } | 1195 } |
| 1197 | 1196 |
| 1198 } // namespace blink | 1197 } // namespace blink |
| OLD | NEW |