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

Unified Diff: include/v8.h

Issue 15964004: remove most V8_ALLOW_ACCESS_TO_* defines from test classes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comment addressed Created 7 years, 7 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 | « no previous file | test/cctest/cctest.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 993dfb91fb481d596bd03159c3f08e94e336feba..98de454a34258503eeb58358a07ef0184c72c6a5 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -563,6 +563,7 @@ template <class T> class Persistent // NOLINT
#endif
+#ifdef V8_USE_UNSAFE_HANDLES
template <class S> V8_INLINE(static Persistent<T> Cast(Persistent<S> that)) {
#ifdef V8_ENABLE_CHECKS
// If we're going to perform the type check then we have to check
@@ -576,6 +577,22 @@ template <class T> class Persistent // NOLINT
return Persistent<S>::Cast(*this);
}
+#else
+ template <class S>
+ V8_INLINE(static Persistent<T>& Cast(Persistent<S>& that)) { // NOLINT
+#ifdef V8_ENABLE_CHECKS
+ // If we're going to perform the type check then we have to check
+ // that the handle isn't empty before doing the checked cast.
+ if (!that.IsEmpty()) T::Cast(*that);
+#endif
+ return reinterpret_cast<Persistent<T>&>(that);
+ }
+
+ template <class S> V8_INLINE(Persistent<S>& As()) { // NOLINT
+ return Persistent<S>::Cast(*this);
+ }
+#endif
+
V8_DEPRECATED(static Persistent<T> New(Handle<T> that));
/**
« no previous file with comments | « no previous file | test/cctest/cctest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698