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

Unified Diff: test/cctest/test-profile-generator.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-parsing.cc ('k') | test/cctest/test-random.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-profile-generator.cc
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
index 70b34e3d7c276688c27a49755d1081899f5ec499..a18422a748a160a3a56b2885b434aafa3f2800f6 100644
--- a/test/cctest/test-profile-generator.cc
+++ b/test/cctest/test-profile-generator.cc
@@ -855,6 +855,7 @@ v8::Handle<v8::Value> ProfilerExtension::StopProfiling(
static ProfilerExtension kProfilerExtension;
v8::DeclareExtension kProfilerExtensionDeclaration(&kProfilerExtension);
+static v8::Persistent<v8::Context> env;
static const ProfileNode* PickChild(const ProfileNode* parent,
const char* name) {
@@ -871,12 +872,14 @@ TEST(RecordStackTraceAtStartProfiling) {
// don't appear in the stack trace.
i::FLAG_use_inlining = false;
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope scope(isolate);
- const char* extensions[] = { "v8/profiler" };
- v8::ExtensionConfiguration config(1, extensions);
- v8::Local<v8::Context> context = v8::Context::New(isolate);
- context->Enter();
+ if (env.IsEmpty()) {
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
+ const char* extensions[] = { "v8/profiler" };
+ v8::ExtensionConfiguration config(1, extensions);
+ env = v8::Context::New(&config);
+ }
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
+ (*env)->Enter();
CpuProfiler* profiler = i::Isolate::Current()->cpu_profiler();
CHECK_EQ(0, profiler->GetProfilesCount());
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/cctest/test-random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698