V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
tracing-cpu-profiler.h
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_PROFILER_TRACING_CPU_PROFILER_H_
6 #define V8_PROFILER_TRACING_CPU_PROFILER_H_
7 
8 #include "include/v8-platform.h"
9 #include "src/base/atomic-utils.h"
10 #include "src/base/macros.h"
11 #include "src/base/platform/mutex.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 class CpuProfiler;
17 class Isolate;
18 
21  public:
23  ~TracingCpuProfilerImpl() override;
24 
25  // v8::TracingController::TraceStateObserver
26  void OnTraceEnabled() final;
27  void OnTraceDisabled() final;
28 
29  private:
30  void StartProfiling();
31  void StopProfiling();
32 
33  Isolate* isolate_;
34  std::unique_ptr<CpuProfiler> profiler_;
35  bool profiling_enabled_;
36  base::Mutex mutex_;
37 
38  DISALLOW_COPY_AND_ASSIGN(TracingCpuProfilerImpl);
39 };
40 
41 } // namespace internal
42 } // namespace v8
43 
44 #endif // V8_PROFILER_TRACING_CPU_PROFILER_H_
Definition: libplatform.h:13