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

Unified Diff: test/cctest/test-api.cc

Issue 15974006: Transforming PersistentHandleVisitor to not need to copy Persistent handles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . 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 | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index e52dde37c994fea3d04b3444bb5cc8a6cf8d0836..0e10194020bd7ccc7019618dafd3b80ee4bc320b 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -17785,12 +17785,19 @@ class Visitor42 : public v8::PersistentHandleVisitor {
explicit Visitor42(v8::Persistent<v8::Object> object)
: counter_(0), object_(object) { }
+#ifdef V8_USE_OLD_STYLE_PERSISTENT_HANDLE_VISITORS
virtual void VisitPersistentHandle(Persistent<Value> value,
uint16_t class_id) {
+ VisitPersistentHandle(&value, class_id);
+ }
+#endif
+
+ virtual void VisitPersistentHandle(Persistent<Value>* value,
+ uint16_t class_id) {
if (class_id == 42) {
- CHECK(value->IsObject());
+ CHECK((*value)->IsObject());
v8::Persistent<v8::Object> visited =
- v8::Persistent<v8::Object>::Cast(value);
+ v8::Persistent<v8::Object>::Cast(*value);
CHECK_EQ(42, visited.WrapperClassId(v8::Isolate::GetCurrent()));
CHECK_EQ(Handle<Value>(*object_), Handle<Value>(*visited));
++counter_;
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698