OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |