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

Unified Diff: src/api.cc

Issue 2040853003: Add a convenience method to get the debugged context (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « include/v8-debug.h ('k') | src/debug/debug.h » ('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 d6336f2846be74c571a5b694d35529236c76af7c..baa83960ec16c10987683751772fb839a2987c96 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8124,6 +8124,14 @@ Local<Context> Debug::GetDebugContext() {
return GetDebugContext(reinterpret_cast<Isolate*>(i::Isolate::Current()));
}
+MaybeLocal<Context> Debug::GetDebuggedContext(Isolate* isolate) {
+ i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
+ ENTER_V8(i_isolate);
+ if (!i_isolate->debug()->in_debug_scope()) return MaybeLocal<Context>();
+ i::Handle<i::Object> calling = i_isolate->GetCallingNativeContext();
+ if (calling.is_null()) return MaybeLocal<Context>();
+ return Utils::ToLocal(i::Handle<i::Context>::cast(calling));
+}
void Debug::SetLiveEditEnabled(Isolate* isolate, bool enable) {
i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
« no previous file with comments | « include/v8-debug.h ('k') | src/debug/debug.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698