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

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

Issue 24356002: move CopyablePersistentTraits to v8.h (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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') | 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 0f790f5a4eda64cbccadb260279e7f95924d1a98..a6157b00f4f22fd688ee4bfe3ab9d622293af3dd 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -12676,17 +12676,6 @@ TEST(DontLeakGlobalObjects) {
}
}
-template<class T>
-struct CopyablePersistentTraits {
- typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
- static const bool kResetInDestructor = true;
- template<class S, class M>
- static V8_INLINE void Copy(const Persistent<S, M>& source,
- CopyablePersistent* dest) {
- // do nothing, just allow copy
- }
-};
-
TEST(CopyablePersistent) {
LocalContext context;
@@ -12694,19 +12683,20 @@ TEST(CopyablePersistent) {
i::GlobalHandles* globals =
reinterpret_cast<i::Isolate*>(isolate)->global_handles();
int initial_handles = globals->global_handles_count();
+ typedef v8::Persistent<v8::Object, v8::CopyablePersistentTraits<v8::Object> >
+ CopyableObject;
{
- v8::Persistent<v8::Object, CopyablePersistentTraits<v8::Object> > handle1;
+ CopyableObject handle1;
{
v8::HandleScope scope(isolate);
handle1.Reset(isolate, v8::Object::New());
}
CHECK_EQ(initial_handles + 1, globals->global_handles_count());
- v8::Persistent<v8::Object, CopyablePersistentTraits<v8::Object> > handle2;
+ CopyableObject handle2;
handle2 = handle1;
CHECK(handle1 == handle2);
CHECK_EQ(initial_handles + 2, globals->global_handles_count());
- v8::Persistent<v8::Object, CopyablePersistentTraits<v8::Object> >
- handle3(handle2);
+ CopyableObject handle3(handle2);
CHECK(handle1 == handle3);
CHECK_EQ(initial_handles + 3, globals->global_handles_count());
}
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698