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

Side by Side Diff: src/inspector/v8-debugger.cc

Issue 2840923002: Revert of [inspector] always include user scripts in the snapshot. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « src/debug/debug-interface.h ('k') | src/inspector/v8-debugger-script.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/inspected-context.h" 8 #include "src/inspector/inspected-context.h"
9 #include "src/inspector/protocol/Protocol.h" 9 #include "src/inspector/protocol/Protocol.h"
10 #include "src/inspector/script-breakpoint.h" 10 #include "src/inspector/script-breakpoint.h"
(...skipping 11 matching lines...) Expand all
22 namespace { 22 namespace {
23 23
24 static const int kMaxAsyncTaskStacks = 128 * 1024; 24 static const int kMaxAsyncTaskStacks = 128 * 1024;
25 25
26 inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) { 26 inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) {
27 return value ? v8::True(isolate) : v8::False(isolate); 27 return value ? v8::True(isolate) : v8::False(isolate);
28 } 28 }
29 29
30 V8DebuggerAgentImpl* agentForScript(V8InspectorImpl* inspector, 30 V8DebuggerAgentImpl* agentForScript(V8InspectorImpl* inspector,
31 v8::Local<v8::debug::Script> script) { 31 v8::Local<v8::debug::Script> script) {
32 int contextId; 32 v8::Local<v8::Value> contextData;
33 if (!script->ContextId().To(&contextId)) return nullptr; 33 if (!script->ContextData().ToLocal(&contextData) || !contextData->IsInt32()) {
34 return nullptr;
35 }
36 int contextId = static_cast<int>(contextData.As<v8::Int32>()->Value());
34 int contextGroupId = inspector->contextGroupId(contextId); 37 int contextGroupId = inspector->contextGroupId(contextId);
35 if (!contextGroupId) return nullptr; 38 if (!contextGroupId) return nullptr;
36 return inspector->enabledDebuggerAgentForGroup(contextGroupId); 39 return inspector->enabledDebuggerAgentForGroup(contextGroupId);
37 } 40 }
38 41
39 v8::MaybeLocal<v8::Array> collectionsEntries(v8::Local<v8::Context> context, 42 v8::MaybeLocal<v8::Array> collectionsEntries(v8::Local<v8::Context> context,
40 v8::Local<v8::Value> value) { 43 v8::Local<v8::Value> value) {
41 v8::Isolate* isolate = context->GetIsolate(); 44 v8::Isolate* isolate = context->GetIsolate();
42 v8::Local<v8::Array> entries; 45 v8::Local<v8::Array> entries;
43 bool isKeyValue = false; 46 bool isKeyValue = false;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 212
210 void V8Debugger::getCompiledScripts( 213 void V8Debugger::getCompiledScripts(
211 int contextGroupId, 214 int contextGroupId,
212 std::vector<std::unique_ptr<V8DebuggerScript>>& result) { 215 std::vector<std::unique_ptr<V8DebuggerScript>>& result) {
213 v8::HandleScope scope(m_isolate); 216 v8::HandleScope scope(m_isolate);
214 v8::PersistentValueVector<v8::debug::Script> scripts(m_isolate); 217 v8::PersistentValueVector<v8::debug::Script> scripts(m_isolate);
215 v8::debug::GetLoadedScripts(m_isolate, scripts); 218 v8::debug::GetLoadedScripts(m_isolate, scripts);
216 for (size_t i = 0; i < scripts.Size(); ++i) { 219 for (size_t i = 0; i < scripts.Size(); ++i) {
217 v8::Local<v8::debug::Script> script = scripts.Get(i); 220 v8::Local<v8::debug::Script> script = scripts.Get(i);
218 if (!script->WasCompiled()) continue; 221 if (!script->WasCompiled()) continue;
219 if (script->IsEmbedded()) { 222 v8::Local<v8::Value> contextData;
220 result.push_back(V8DebuggerScript::Create(m_isolate, script, false)); 223 if (!script->ContextData().ToLocal(&contextData) || !contextData->IsInt32())
221 continue; 224 continue;
222 } 225 int contextId = static_cast<int>(contextData.As<v8::Int32>()->Value());
223 int contextId;
224 if (!script->ContextId().To(&contextId)) continue;
225 if (m_inspector->contextGroupId(contextId) != contextGroupId) continue; 226 if (m_inspector->contextGroupId(contextId) != contextGroupId) continue;
226 result.push_back(V8DebuggerScript::Create(m_isolate, script, false)); 227 result.push_back(V8DebuggerScript::Create(m_isolate, script, false));
227 } 228 }
228 } 229 }
229 230
230 String16 V8Debugger::setBreakpoint(const ScriptBreakpoint& breakpoint, 231 String16 V8Debugger::setBreakpoint(const ScriptBreakpoint& breakpoint,
231 int* actualLineNumber, 232 int* actualLineNumber,
232 int* actualColumnNumber) { 233 int* actualColumnNumber) {
233 v8::HandleScope scope(m_isolate); 234 v8::HandleScope scope(m_isolate);
234 v8::Local<v8::Context> context = debuggerContext(); 235 v8::Local<v8::Context> context = debuggerContext();
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 fprintf(stdout, "Async stacks count: %d\n", m_asyncStacksCount); 1077 fprintf(stdout, "Async stacks count: %d\n", m_asyncStacksCount);
1077 fprintf(stdout, "Scheduled async tasks: %zu\n", m_asyncTaskStacks.size()); 1078 fprintf(stdout, "Scheduled async tasks: %zu\n", m_asyncTaskStacks.size());
1078 fprintf(stdout, "Created async tasks: %zu\n", 1079 fprintf(stdout, "Created async tasks: %zu\n",
1079 m_asyncTaskCreationStacks.size()); 1080 m_asyncTaskCreationStacks.size());
1080 fprintf(stdout, "Async tasks with parent: %zu\n", m_parentTask.size()); 1081 fprintf(stdout, "Async tasks with parent: %zu\n", m_parentTask.size());
1081 fprintf(stdout, "Recurring async tasks: %zu\n", m_recurringTasks.size()); 1082 fprintf(stdout, "Recurring async tasks: %zu\n", m_recurringTasks.size());
1082 fprintf(stdout, "\n"); 1083 fprintf(stdout, "\n");
1083 } 1084 }
1084 1085
1085 } // namespace v8_inspector 1086 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/debug/debug-interface.h ('k') | src/inspector/v8-debugger-script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698