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

Unified Diff: src/api.cc

Issue 2473273005: Revert of [debugger] simplify fetching scripts for inspector. (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | test/inspector/debugger/script-on-after-compile.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b421e06e7d478734307b28d5c140c51f6ed6fd15..ad41d819b7f094ddda7834f5ca57377ae8184f03 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8946,18 +8946,13 @@
PersistentValueVector<DebugInterface::Script>& scripts) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
ENTER_V8(isolate);
- {
- i::DisallowHeapAllocation no_gc;
- i::Script::Iterator iterator(isolate);
- i::Script* script;
- while ((script = iterator.Next())) {
- if (script->type() != i::Script::TYPE_NORMAL) continue;
- if (script->HasValidSource()) {
- i::HandleScope handle_scope(isolate);
- i::Handle<i::Script> script_handle(script, isolate);
- scripts.Append(ToApiHandle<Script>(script_handle));
- }
- }
+ i::HandleScope handle_scope(isolate);
+ i::Handle<i::FixedArray> instances = isolate->debug()->GetLoadedScripts();
+ for (int i = 0; i < instances->length(); i++) {
+ i::Handle<i::Script> script =
+ i::Handle<i::Script>(i::Script::cast(instances->get(i)));
+ if (script->type() != i::Script::TYPE_NORMAL) continue;
+ scripts.Append(ToApiHandle<Script>(script));
}
}
« no previous file with comments | « no previous file | test/inspector/debugger/script-on-after-compile.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698