| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 "src/inspector/v8-debugger.h" | 5 #include "src/inspector/v8-debugger.h" |
| 6 | 6 |
| 7 #include "src/inspector/debugger-script.h" | 7 #include "src/inspector/debugger-script.h" |
| 8 #include "src/inspector/protocol/Protocol.h" | 8 #include "src/inspector/protocol/Protocol.h" |
| 9 #include "src/inspector/script-breakpoint.h" | 9 #include "src/inspector/script-breakpoint.h" |
| 10 #include "src/inspector/string-util.h" | 10 #include "src/inspector/string-util.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 void V8Debugger::getCompiledScripts( | 119 void V8Debugger::getCompiledScripts( |
| 120 int contextGroupId, | 120 int contextGroupId, |
| 121 std::vector<std::unique_ptr<V8DebuggerScript>>& result) { | 121 std::vector<std::unique_ptr<V8DebuggerScript>>& result) { |
| 122 v8::HandleScope scope(m_isolate); | 122 v8::HandleScope scope(m_isolate); |
| 123 v8::PersistentValueVector<v8::DebugInterface::Script> scripts(m_isolate); | 123 v8::PersistentValueVector<v8::DebugInterface::Script> scripts(m_isolate); |
| 124 v8::DebugInterface::GetLoadedScripts(m_isolate, scripts); | 124 v8::DebugInterface::GetLoadedScripts(m_isolate, scripts); |
| 125 String16 contextPrefix = String16::fromInteger(contextGroupId) + ","; | 125 String16 contextPrefix = String16::fromInteger(contextGroupId) + ","; |
| 126 for (size_t i = 0; i < scripts.Size(); ++i) { | 126 for (size_t i = 0; i < scripts.Size(); ++i) { |
| 127 v8::Local<v8::DebugInterface::Script> script = scripts.Get(i); | 127 v8::Local<v8::DebugInterface::Script> script = scripts.Get(i); |
| 128 if (!script->WasCompiled()) continue; | 128 if (!script->WasCompiled()) continue; |
| 129 v8::ScriptOriginOptions origin = script->OriginOptions(); | |
| 130 if (origin.IsEmbedderDebugScript()) continue; | |
| 131 v8::Local<v8::String> v8ContextData; | 129 v8::Local<v8::String> v8ContextData; |
| 132 if (!script->ContextData().ToLocal(&v8ContextData)) continue; | 130 if (!script->ContextData().ToLocal(&v8ContextData)) continue; |
| 133 String16 contextData = toProtocolString(v8ContextData); | 131 String16 contextData = toProtocolString(v8ContextData); |
| 134 if (contextData.find(contextPrefix) != 0) continue; | 132 if (contextData.find(contextPrefix) != 0) continue; |
| 135 result.push_back( | 133 result.push_back( |
| 136 wrapUnique(new V8DebuggerScript(m_isolate, script, false))); | 134 wrapUnique(new V8DebuggerScript(m_isolate, script, false))); |
| 137 } | 135 } |
| 138 } | 136 } |
| 139 | 137 |
| 140 String16 V8Debugger::setBreakpoint(const ScriptBreakpoint& breakpoint, | 138 String16 V8Debugger::setBreakpoint(const ScriptBreakpoint& breakpoint, |
| (...skipping 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 981 |
| 984 size_t stackSize = | 982 size_t stackSize = |
| 985 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; | 983 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; |
| 986 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 984 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
| 987 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 985 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
| 988 | 986 |
| 989 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 987 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
| 990 } | 988 } |
| 991 | 989 |
| 992 } // namespace v8_inspector | 990 } // namespace v8_inspector |
| OLD | NEW |