Skip to content

Commit 8c5e2d7

Browse files
a1phCommit Bot
authored andcommitted
[cpu-profiler] Deprecate Isolate::GetCpuProfiler and CpuProfiler::CollectSample functions.
BUG=v8:7070 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: I92d7c61afa88e0a52c8eed0c2a44a4e49847e83b Reviewed-on: https://chromium-review.googlesource.com/767618 Reviewed-by: Yang Guo <[email protected]> Reviewed-by: Adam Klein <[email protected]> Commit-Queue: Alexei Filippov <[email protected]> Cr-Commit-Position: refs/heads/master@{#49514}
1 parent 44c52f7 commit 8c5e2d7

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

include/v8-profiler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ class V8_EXPORT CpuProfiler {
329329
* Recording the forced sample does not contribute to the aggregated
330330
* profile statistics.
331331
*/
332-
void CollectSample();
332+
V8_DEPRECATED("Use static CollectSample(Isolate*) instead.",
333+
void CollectSample());
333334

334335
/**
335336
* Tells the profiler whether the embedder is idle.

include/v8.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7312,8 +7312,8 @@ class V8_EXPORT Isolate {
73127312
* is initialized. It is the embedder's responsibility to stop all CPU
73137313
* profiling activities if it has started any.
73147314
*/
7315-
V8_DEPRECATE_SOON("CpuProfiler should be created with CpuProfiler::New call.",
7316-
CpuProfiler* GetCpuProfiler());
7315+
V8_DEPRECATED("CpuProfiler should be created with CpuProfiler::New call.",
7316+
CpuProfiler* GetCpuProfiler());
73177317

73187318
/** Returns true if this isolate has a current context. */
73197319
bool InContext();

test/cctest/profiler-extension.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void ProfilerExtension::StopProfiling(
7474

7575
void ProfilerExtension::CollectSample(
7676
const v8::FunctionCallbackInfo<v8::Value>& args) {
77-
profiler_->CollectSample();
77+
v8::CpuProfiler::CollectSample(args.GetIsolate());
7878
}
7979

8080
} // namespace internal

test/cctest/test-cpu-profiler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ static const char* js_force_collect_sample_source =
14731473
"}";
14741474

14751475
static void CallCollectSample(const v8::FunctionCallbackInfo<v8::Value>& info) {
1476-
i::ProfilerExtension::profiler()->CollectSample();
1476+
v8::CpuProfiler::CollectSample(info.GetIsolate());
14771477
}
14781478

14791479
TEST(CollectSampleAPI) {

0 commit comments

Comments
 (0)