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

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

Issue 15038002: Revert "deprecate Context::New which returns Persistent" (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 | « 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 069ba2d5b19adc61c78f81c0b5761e905ffb343c..1de24ce88d4b62857859757698590d06133bf312 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1661,15 +1661,9 @@ static int NumberOfGlobalObjects() {
// optimized code.
TEST(LeakNativeContextViaMap) {
i::FLAG_allow_natives_syntax = true;
- 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));
- }
+ v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
+ v8::Persistent<v8::Context> ctx1 = v8::Context::New();
+ v8::Persistent<v8::Context> ctx2 = v8::Context::New();
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1705,15 +1699,9 @@ TEST(LeakNativeContextViaMap) {
// optimized code.
TEST(LeakNativeContextViaFunction) {
i::FLAG_allow_natives_syntax = true;
- 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));
- }
+ v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
+ v8::Persistent<v8::Context> ctx1 = v8::Context::New();
+ v8::Persistent<v8::Context> ctx2 = v8::Context::New();
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1747,15 +1735,9 @@ TEST(LeakNativeContextViaFunction) {
TEST(LeakNativeContextViaMapKeyed) {
i::FLAG_allow_natives_syntax = true;
- 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));
- }
+ v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
+ v8::Persistent<v8::Context> ctx1 = v8::Context::New();
+ v8::Persistent<v8::Context> ctx2 = v8::Context::New();
ctx1->Enter();
HEAP->CollectAllAvailableGarbage();
@@ -1789,15 +1771,9 @@ TEST(LeakNativeContextViaMapKeyed) {
TEST(LeakNativeContextViaMapProto) {
i::FLAG_allow_natives_syntax = true;
- 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));
- }
+ v8::HandleScope outer_scope(v8::Isolate::GetCurrent());
+ v8::Persistent<v8::Context> ctx1 = v8::Context::New();
+ v8::Persistent<v8::Context> ctx2 = v8::Context::New();
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