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

Unified 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 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 4505c26bef23c9bb50893903b9852b68996560db..5cd56b4a4105cf1cfcebb5841348fc9a63aa7e9d 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -29,8 +29,11 @@
V8DebuggerAgentImpl* agentForScript(V8InspectorImpl* inspector,
v8::Local<v8::debug::Script> script) {
- int contextId;
- if (!script->ContextId().To(&contextId)) return nullptr;
+ 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 contextGroupId = inspector->contextGroupId(contextId);
if (!contextGroupId) return nullptr;
return inspector->enabledDebuggerAgentForGroup(contextGroupId);
@@ -216,12 +219,10 @@
for (size_t i = 0; i < scripts.Size(); ++i) {
v8::Local<v8::debug::Script> script = scripts.Get(i);
if (!script->WasCompiled()) continue;
- if (script->IsEmbedded()) {
- result.push_back(V8DebuggerScript::Create(m_isolate, script, false));
+ v8::Local<v8::Value> contextData;
+ if (!script->ContextData().ToLocal(&contextData) || !contextData->IsInt32())
continue;
- }
- int contextId;
- if (!script->ContextId().To(&contextId)) continue;
+ int contextId = static_cast<int>(contextData.As<v8::Int32>()->Value());
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