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

Unified Diff: test/cctest/test-heap-profiler.cc

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 | « test/cctest/test-heap.cc ('k') | test/cctest/test-lockers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 9b53879b2dc7037000bcea0be49c33b6294fc3e1..254cd1e490bbe28e5eac66bf0358edb23eb7d4c3 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -29,9 +29,6 @@
#include <ctype.h>
-// TODO(dcarney): remove
-#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
-
#include "v8.h"
#include "cctest.h"
@@ -1137,14 +1134,11 @@ TEST(HeapSnapshotRetainedObjectInfo) {
1, TestRetainedObjectInfo::WrapperInfoCallback);
heap_profiler->SetWrapperClassInfoProvider(
2, TestRetainedObjectInfo::WrapperInfoCallback);
- v8::Persistent<v8::String> p_AAA =
- v8::Persistent<v8::String>::New(isolate, v8_str("AAA"));
+ v8::Persistent<v8::String> p_AAA(isolate, v8_str("AAA"));
p_AAA.SetWrapperClassId(isolate, 1);
- v8::Persistent<v8::String> p_BBB =
- v8::Persistent<v8::String>::New(isolate, v8_str("BBB"));
+ v8::Persistent<v8::String> p_BBB(isolate, v8_str("BBB"));
p_BBB.SetWrapperClassId(isolate, 1);
- v8::Persistent<v8::String> p_CCC =
- v8::Persistent<v8::String>::New(isolate, v8_str("CCC"));
+ v8::Persistent<v8::String> p_CCC(isolate, v8_str("CCC"));
p_CCC.SetWrapperClassId(isolate, 2);
CHECK_EQ(0, TestRetainedObjectInfo::instances.length());
const v8::HeapSnapshot* snapshot =
@@ -1196,8 +1190,7 @@ class GraphWithImplicitRefs {
instance_ = this;
isolate_ = (*env)->GetIsolate();
for (int i = 0; i < kObjectsCount; i++) {
- objects_[i] =
- v8::Persistent<v8::Object>::New(isolate_, v8::Object::New());
+ objects_[i].Reset(isolate_, v8::Object::New());
}
(*env)->Global()->Set(v8_str("root_object"),
v8::Local<v8::Value>::New(isolate_, objects_[0]));
@@ -1213,15 +1206,15 @@ class GraphWithImplicitRefs {
private:
void AddImplicitReferences() {
// 0 -> 1
- isolate_->SetObjectGroupId(v8::Persistent<v8::Object>::Cast(objects_[0]),
+ isolate_->SetObjectGroupId(objects_[0],
v8::UniqueId(1));
isolate_->SetReferenceFromGroup(
- v8::UniqueId(1), v8::Persistent<v8::Object>::Cast(objects_[1]));
+ v8::UniqueId(1), objects_[1]);
// Adding two more references: 1 -> 2, 1 -> 3
- isolate_->SetReference(v8::Persistent<v8::Object>::Cast(objects_[1]),
- v8::Persistent<v8::Object>::Cast(objects_[2]));
- isolate_->SetReference(v8::Persistent<v8::Object>::Cast(objects_[1]),
- v8::Persistent<v8::Object>::Cast(objects_[3]));
+ isolate_->SetReference(objects_[1].As<v8::Object>(),
+ objects_[2]);
+ isolate_->SetReference(objects_[1].As<v8::Object>(),
+ objects_[3]);
}
v8::Persistent<v8::Value> objects_[kObjectsCount];
@@ -1611,8 +1604,7 @@ TEST(WeakGlobalHandle) {
CHECK(!HasWeakGlobalHandle());
- v8::Persistent<v8::Object> handle =
- v8::Persistent<v8::Object>::New(env->GetIsolate(), v8::Object::New());
+ v8::Persistent<v8::Object> handle(env->GetIsolate(), v8::Object::New());
handle.MakeWeak<v8::Value, void>(env->GetIsolate(),
NULL,
PersistentHandleCallback);
« no previous file with comments | « test/cctest/test-heap.cc ('k') | test/cctest/test-lockers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698