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

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

Issue 14793004: deprecate Context::New which returns Persistent (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: use Reset instead of operator= 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-hashing.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.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 1de24ce88d4b62857859757698590d06133bf312..069ba2d5b19adc61c78f81c0b5761e905ffb343c 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1661,9 +1661,15 @@ static int NumberOfGlobalObjects() {
// optimized code.
TEST(LeakNativeContextViaMap) {
i::FLAG_allow_natives_syntax = true;
- v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
- v8::Persistent<v8::Context> ctx1 = v8::Context::New();
- v8::Persistent<v8::Context> ctx2 = v8::Context::New();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope outer_scope(isolate);
+ v8::Persistent<v8::Context> ctx1;
+ v8::Persistent<v8::Context> ctx2;
+ {
+ v8::HandleScope scope(isolate);
+ ctx1.Reset(isolate, v8::Context::New(isolate));
+ ctx2.Reset(isolate, v8::Context::New(isolate));
+ }
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1699,9 +1705,15 @@ TEST(LeakNativeContextViaMap) {
// optimized code.
TEST(LeakNativeContextViaFunction) {
i::FLAG_allow_natives_syntax = true;
- v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
- v8::Persistent<v8::Context> ctx1 = v8::Context::New();
- v8::Persistent<v8::Context> ctx2 = v8::Context::New();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope outer_scope(isolate);
+ v8::Persistent<v8::Context> ctx1;
+ v8::Persistent<v8::Context> ctx2;
+ {
+ v8::HandleScope scope(isolate);
+ ctx1.Reset(isolate, v8::Context::New(isolate));
+ ctx2.Reset(isolate, v8::Context::New(isolate));
+ }
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1735,9 +1747,15 @@ TEST(LeakNativeContextViaFunction) {
TEST(LeakNativeContextViaMapKeyed) {
i::FLAG_allow_natives_syntax = true;
- v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
- v8::Persistent<v8::Context> ctx1 = v8::Context::New();
- v8::Persistent<v8::Context> ctx2 = v8::Context::New();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope outer_scope(isolate);
+ v8::Persistent<v8::Context> ctx1;
+ v8::Persistent<v8::Context> ctx2;
+ {
+ v8::HandleScope scope(isolate);
+ ctx1.Reset(isolate, v8::Context::New(isolate));
+ ctx2.Reset(isolate, v8::Context::New(isolate));
+ }
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1771,9 +1789,15 @@ TEST(LeakNativeContextViaMapKeyed) {
TEST(LeakNativeContextViaMapProto) {
i::FLAG_allow_natives_syntax = true;
- v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
- v8::Persistent<v8::Context> ctx1 = v8::Context::New();
- v8::Persistent<v8::Context> ctx2 = v8::Context::New();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
+ v8::HandleScope outer_scope(isolate);
+ v8::Persistent<v8::Context> ctx1;
+ v8::Persistent<v8::Context> ctx2;
+ {
+ v8::HandleScope scope(isolate);
+ ctx1.Reset(isolate, v8::Context::New(isolate));
+ ctx2.Reset(isolate, v8::Context::New(isolate));
+ }
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
« no previous file with comments | « test/cctest/test-hashing.cc ('k') | test/cctest/test-lockers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698