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

Unified Diff: src/api.cc

Issue 11360082: Pass Isolate to MakeWeak(), IsWeak(), and AddObjectGroup(). (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 8 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 | « 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 be7d73f50906edcf0343d326e592520b71195285..e729217c5ab7d7362d7c9eb52f52cc32bb32efcd 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -630,7 +630,16 @@ void V8::MakeWeak(i::Object** object, void* parameters,
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "MakeWeak");
isolate->global_handles()->MakeWeak(object, parameters,
- callback);
+ callback);
+}
+
+
+void V8::MakeWeak(i::Isolate* isolate, i::Object** object,
+ void* parameters, WeakReferenceCallback callback) {
+ ASSERT(isolate == i::Isolate::Current());
+ LOG_API(isolate, "MakeWeak");
+ isolate->global_handles()->MakeWeak(object, parameters,
+ callback);
}
@@ -672,6 +681,14 @@ bool V8::IsGlobalWeak(i::Object** obj) {
}
+bool V8::IsGlobalWeak(i::Isolate* isolate, i::Object** obj) {
+ ASSERT(isolate == i::Isolate::Current());
+ LOG_API(isolate, "IsGlobalWeak");
+ if (!isolate->IsInitialized()) return false;
+ return i::GlobalHandles::IsWeak(obj);
+}
+
+
void V8::DisposeGlobal(i::Object** obj) {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "DisposeGlobal");
@@ -5351,6 +5368,7 @@ void V8::SetFailedAccessCheckCallbackFunction(
isolate->SetFailedAccessCheckCallback(callback);
}
+
void V8::AddObjectGroup(Persistent<Value>* objects,
size_t length,
RetainedObjectInfo* info) {
@@ -5362,6 +5380,19 @@ void V8::AddObjectGroup(Persistent<Value>* objects,
}
+void V8::AddObjectGroup(Isolate* exportedIsolate,
+ Persistent<Value>* objects,
+ size_t length,
+ RetainedObjectInfo* info) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exportedIsolate);
+ ASSERT(isolate == i::Isolate::Current());
+ if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return;
+ STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
+ isolate->global_handles()->AddObjectGroup(
+ reinterpret_cast<i::Object***>(objects), length, info);
+}
+
+
void V8::AddImplicitReferences(Persistent<Object> parent,
Persistent<Value>* children,
size_t length) {
« 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