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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp

Issue 2112673003: [DevTools] Move suspended generator location to internal properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 5 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
Index: third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
index 539b805460edb5778c5b3c96aab8200055e4ada3..e945af47d5880b2adbcb0ab8c3f6454edfd5ac2e 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8DebuggerImpl.cpp
@@ -668,17 +668,14 @@ v8::MaybeLocal<v8::Array> V8DebuggerImpl::internalProperties(v8::Local<v8::Conte
properties->Set(properties->Length(), entries);
}
}
- return properties;
-}
-
-v8::Local<v8::Value> V8DebuggerImpl::generatorObjectDetails(v8::Local<v8::Object>& object)
-{
- if (!enabled()) {
- NOTREACHED();
- return v8::Local<v8::Value>::New(m_isolate, v8::Undefined(m_isolate));
+ if (value->IsGeneratorObject()) {
+ v8::Local<v8::Value> location = generatorObjectLocation(v8::Local<v8::Object>::Cast(value));
+ if (location->IsObject()) {
+ properties->Set(properties->Length(), v8InternalizedString("[[GeneratorLocation]]"));
+ properties->Set(properties->Length(), location);
+ }
}
- v8::Local<v8::Value> argv[] = { object };
- return callDebuggerMethod("getGeneratorObjectDetails", 1, argv).ToLocalChecked();
+ return properties;
}
v8::Local<v8::Value> V8DebuggerImpl::collectionEntries(v8::Local<v8::Context> context, v8::Local<v8::Object> object)
@@ -704,6 +701,22 @@ v8::Local<v8::Value> V8DebuggerImpl::collectionEntries(v8::Local<v8::Context> co
return entries;
}
+v8::Local<v8::Value> V8DebuggerImpl::generatorObjectLocation(v8::Local<v8::Object> object)
+{
+ if (!enabled()) {
+ NOTREACHED();
+ return v8::Null(m_isolate);
+ }
+ v8::Local<v8::Value> argv[] = { object };
+ v8::Local<v8::Value> location = callDebuggerMethod("getGeneratorObjectLocation", 1, argv).ToLocalChecked();
+ if (!location->IsObject())
+ return v8::Null(m_isolate);
+ v8::Local<v8::Context> context = m_debuggerContext.Get(m_isolate);
+ if (!location.As<v8::Object>()->SetPrivate(context, V8InjectedScriptHost::internalLocationPrivate(m_isolate), v8::True(m_isolate)).FromMaybe(false))
+ return v8::Null(m_isolate);
+ return location;
+}
+
bool V8DebuggerImpl::isPaused()
{
return !m_pausedContext.IsEmpty();

Powered by Google App Engine
This is Rietveld 408576698