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

Unified Diff: include/libplatform/v8-tracing.h

Issue 2369073003: [tracing] Implement Add/RemoveTraceStateObserver for default platform. (Closed)
Patch Set: addressing comments. Created 4 years, 3 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 | « no previous file | src/libplatform/default-platform.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/libplatform/v8-tracing.h
diff --git a/include/libplatform/v8-tracing.h b/include/libplatform/v8-tracing.h
index 7646ea5489664300ec7ad64ea1dbce6451c15424..ce724d3aa5d3de9fca0984a007713d8597a8dd25 100644
--- a/include/libplatform/v8-tracing.h
+++ b/include/libplatform/v8-tracing.h
@@ -7,9 +7,17 @@
#include <fstream>
#include <memory>
+#include <unordered_set>
#include <vector>
+#include "include/v8-platform.h"
+
namespace v8 {
+
+namespace base {
+class Mutex;
+} // namespace base
+
namespace platform {
namespace tracing {
@@ -217,7 +225,8 @@ class TracingController {
ENABLED_FOR_ETW_EXPORT = 1 << 3
};
- TracingController() {}
+ TracingController();
+ ~TracingController();
void Initialize(TraceBuffer* trace_buffer);
const uint8_t* GetCategoryGroupEnabled(const char* category_group);
static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag);
@@ -232,6 +241,9 @@ class TracingController {
void StartTracing(TraceConfig* trace_config);
void StopTracing();
+ void AddTraceStateObserver(Platform::TraceStateObserver* observer);
+ void RemoveTraceStateObserver(Platform::TraceStateObserver* observer);
+
private:
const uint8_t* GetCategoryGroupEnabledInternal(const char* category_group);
void UpdateCategoryGroupEnabledFlag(size_t category_index);
@@ -239,6 +251,8 @@ class TracingController {
std::unique_ptr<TraceBuffer> trace_buffer_;
std::unique_ptr<TraceConfig> trace_config_;
+ std::unique_ptr<base::Mutex> mutex_;
+ std::unordered_set<Platform::TraceStateObserver*> observers_;
Mode mode_ = DISABLED;
// Disallow copy and assign
« no previous file with comments | « no previous file | src/libplatform/default-platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698