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

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

Issue 2117343006: Introduce v8::CpuProfiler::New and v8::CpuProfiler::Dispose API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove ProfilerExtension::Scope Created 4 years, 5 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/profiler-extension.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/profiler-extension.cc
diff --git a/test/cctest/profiler-extension.cc b/test/cctest/profiler-extension.cc
index 024cc9c635a3d1b97d9c474a004b866e8598507b..df5cec79ce6497b5d45302276be4b011a06901c7 100644
--- a/test/cctest/profiler-extension.cc
+++ b/test/cctest/profiler-extension.cc
@@ -33,7 +33,8 @@
namespace v8 {
namespace internal {
-v8::CpuProfile* ProfilerExtension::last_profile = NULL;
+v8::CpuProfiler* ProfilerExtension::profiler_ = nullptr;
+v8::CpuProfile* ProfilerExtension::last_profile = nullptr;
const char* ProfilerExtension::kSource =
"native function startProfiling();"
"native function stopProfiling();"
@@ -58,24 +59,22 @@ v8::Local<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
void ProfilerExtension::StartProfiling(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- last_profile = NULL;
- v8::CpuProfiler* cpu_profiler = args.GetIsolate()->GetCpuProfiler();
- cpu_profiler->StartProfiling((args.Length() > 0)
- ? args[0].As<v8::String>()
- : v8::String::Empty(args.GetIsolate()));
+ last_profile = nullptr;
+ profiler_->StartProfiling(args.Length() > 0
+ ? args[0].As<v8::String>()
+ : v8::String::Empty(args.GetIsolate()));
}
void ProfilerExtension::StopProfiling(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- v8::CpuProfiler* cpu_profiler = args.GetIsolate()->GetCpuProfiler();
- last_profile = cpu_profiler->StopProfiling((args.Length() > 0)
- ? args[0].As<v8::String>()
- : v8::String::Empty(args.GetIsolate()));
+ last_profile = profiler_->StopProfiling(
+ args.Length() > 0 ? args[0].As<v8::String>()
+ : v8::String::Empty(args.GetIsolate()));
}
void ProfilerExtension::CollectSample(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- args.GetIsolate()->GetCpuProfiler()->CollectSample();
+ profiler_->CollectSample();
}
} // namespace internal
« no previous file with comments | « test/cctest/profiler-extension.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698