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

Unified Diff: src/api.cc

Issue 13426002: Pass an isolate to GetCurrent() (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Added a test Created 7 years, 9 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.h ('k') | test/cctest/test-api.cc » ('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 f1fe6eaabed1fdabfc6e29fd2f2cb7aabe560e52..3292be8f21c6f02dfa4b135dbdf3346263f2f7d2 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5012,6 +5012,16 @@ v8::Local<v8::Context> Context::GetCurrent() {
}
+v8::Local<v8::Context> Context::GetCurrent(Isolate* exported_isolate) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
+ ASSERT(isolate == i::Isolate::Current());
+ i::Handle<i::Object> current = isolate->native_context();
+ if (current.is_null()) return Local<Context>();
+ i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
+ return Utils::ToLocal(context);
+}
+
+
v8::Local<v8::Context> Context::GetCalling() {
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate, "v8::Context::GetCalling()")) {
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698