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

Side by Side Diff: include/v8-platform.h

Issue 2436273002: [Tracing] Implement TracingCategoryObserver. (Closed)
Patch Set: fix compilation error Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | src/d8.cc » ('j') | src/flag-definitions.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_V8_PLATFORM_H_ 5 #ifndef V8_V8_PLATFORM_H_
6 #define V8_V8_PLATFORM_H_ 6 #define V8_V8_PLATFORM_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 #include <memory> 10 #include <memory>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, 200 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag,
201 const char* name, uint64_t handle) {} 201 const char* name, uint64_t handle) {}
202 202
203 class TraceStateObserver { 203 class TraceStateObserver {
204 public: 204 public:
205 virtual ~TraceStateObserver() = default; 205 virtual ~TraceStateObserver() = default;
206 virtual void OnTraceEnabled() = 0; 206 virtual void OnTraceEnabled() = 0;
207 virtual void OnTraceDisabled() = 0; 207 virtual void OnTraceDisabled() = 0;
208 }; 208 };
209 209
210 class TracingFlag {
211 public:
212 enum Mode {
213 ENABLED_BY_NATIVE = 1 << 0,
214 ENABLED_BY_TRACING = 1 << 1,
215 };
216 static std::unique_ptr<TracingFlag> Create();
217 virtual ~TracingFlag() = default;
218
219 protected:
220 TracingFlag() = default;
221 };
222
210 /** Adds tracing state change observer. */ 223 /** Adds tracing state change observer. */
211 virtual void AddTraceStateObserver(TraceStateObserver*) {} 224 virtual void AddTraceStateObserver(TraceStateObserver*) {}
212 225
213 /** Removes tracing state change observer. */ 226 /** Removes tracing state change observer. */
214 virtual void RemoveTraceStateObserver(TraceStateObserver*) {} 227 virtual void RemoveTraceStateObserver(TraceStateObserver*) {}
215 }; 228 };
216 229
217 } // namespace v8 230 } // namespace v8
218 231
219 #endif // V8_V8_PLATFORM_H_ 232 #endif // V8_V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/d8.cc » ('j') | src/flag-definitions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698