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

Unified Diff: src/inspector/v8-debugger.cc

Issue 2836623002: [inspector] always include user scripts in the snapshot. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 5cd56b4a4105cf1cfcebb5841348fc9a63aa7e9d..4505c26bef23c9bb50893903b9852b68996560db 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -29,11 +29,8 @@ inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) {
V8DebuggerAgentImpl* agentForScript(V8InspectorImpl* inspector,
v8::Local<v8::debug::Script> script) {
- v8::Local<v8::Value> contextData;
- if (!script->ContextData().ToLocal(&contextData) || !contextData->IsInt32()) {
- return nullptr;
- }
- int contextId = static_cast<int>(contextData.As<v8::Int32>()->Value());
+ int contextId;
+ if (!script->ContextId().To(&contextId)) return nullptr;
int contextGroupId = inspector->contextGroupId(contextId);
if (!contextGroupId) return nullptr;
return inspector->enabledDebuggerAgentForGroup(contextGroupId);
@@ -219,10 +216,12 @@ void V8Debugger::getCompiledScripts(
for (size_t i = 0; i < scripts.Size(); ++i) {
v8::Local<v8::debug::Script> script = scripts.Get(i);
if (!script->WasCompiled()) continue;
- v8::Local<v8::Value> contextData;
- if (!script->ContextData().ToLocal(&contextData) || !contextData->IsInt32())
+ if (script->IsEmbedded()) {
+ result.push_back(V8DebuggerScript::Create(m_isolate, script, false));
continue;
- int contextId = static_cast<int>(contextData.As<v8::Int32>()->Value());
+ }
+ int contextId;
+ if (!script->ContextId().To(&contextId)) continue;
if (m_inspector->contextGroupId(contextId) != contextGroupId) continue;
result.push_back(V8DebuggerScript::Create(m_isolate, script, false));
}
« 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