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

Unified Diff: include/v8.h

Issue 11368053: Implement IsIndependent(Isolate*) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: A correct patch for IsIndependent(Isolate*) 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 | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index c4a54a46ed712f3d41dedce76f7d42dcc75a8502..652f49e3f27fdfb6f2f9350fee4a98d92fa18208 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -404,6 +404,7 @@ template <class T> class Persistent : public Handle<T> {
/** Returns true if this handle was previously marked as independent. */
inline bool IsIndependent() const;
+ inline bool IsIndependent(Isolate* isolate) const;
/** Checks if the handle holds the only reference to an object. */
inline bool IsNearDeath() const;
@@ -3494,6 +3495,8 @@ class V8EXPORT V8 {
static void ClearWeak(internal::Object** global_handle);
static void MarkIndependent(internal::Object** global_handle);
static bool IsGlobalIndependent(internal::Object** global_handle);
+ static bool IsGlobalIndependent(internal::Isolate* isolate,
+ internal::Object** global_handle);
static bool IsGlobalNearDeath(internal::Object** global_handle);
static bool IsGlobalWeak(internal::Object** global_handle);
static void SetWrapperClassId(internal::Object** global_handle,
@@ -4223,6 +4226,14 @@ bool Persistent<T>::IsIndependent() const {
template <class T>
+bool Persistent<T>::IsIndependent(Isolate* isolate) const {
+ if (this->IsEmpty()) return false;
+ return V8::IsGlobalIndependent(reinterpret_cast<internal::Isolate*>(isolate),
+ reinterpret_cast<internal::Object**>(**this));
+}
+
+
+template <class T>
bool Persistent<T>::IsNearDeath() const {
if (this->IsEmpty()) return false;
return V8::IsGlobalNearDeath(reinterpret_cast<internal::Object**>(**this));
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698