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

Unified Diff: services/tracing/tracing_app.h

Issue 1932843002: Add TraceProviderRegistry and implementation in tracing service/application. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 8 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
Index: services/tracing/tracing_app.h
diff --git a/services/tracing/tracing_app.h b/services/tracing/tracing_app.h
index 19c88c21180ad5e34fa07a9f610efa927a352b49..3131c559418b19a8ed6761eed0f75a7f65b9ac86 100644
--- a/services/tracing/tracing_app.h
+++ b/services/tracing/tracing_app.h
@@ -8,10 +8,12 @@
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
+#include "mojo/common/binding_set.h"
#include "mojo/common/interface_ptr_set.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h"
#include "mojo/services/tracing/interfaces/tracing.mojom.h"
#include "services/tracing/trace_data_sink.h"
#include "services/tracing/trace_recorder_impl.h"
@@ -20,7 +22,9 @@ namespace tracing {
class TracingApp : public mojo::ApplicationDelegate,
public mojo::InterfaceFactory<TraceCollector>,
- public TraceCollector {
+ public mojo::InterfaceFactory<TraceProviderRegistry>,
+ public TraceCollector,
+ public TraceProviderRegistry {
public:
TracingApp();
~TracingApp() override;
@@ -34,17 +38,26 @@ class TracingApp : public mojo::ApplicationDelegate,
void Create(mojo::ApplicationConnection* connection,
mojo::InterfaceRequest<TraceCollector> request) override;
- // tracing::TraceCollector implementation.
+ // mojo::InterfaceFactory<TraceProviderRegistry> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<TraceProviderRegistry> request) override;
+
+ // TraceCollector implementation.
void Start(mojo::ScopedDataPipeProducerHandle stream,
const mojo::String& categories) override;
void StopAndFlush() override;
+ // TraceProviderRegistry implementation.
+ void RegisterTraceProvider(
+ mojo::InterfaceHandle<TraceProvider> trace_provider) override;
+
void AllDataCollected();
scoped_ptr<TraceDataSink> sink_;
ScopedVector<TraceRecorderImpl> recorder_impls_;
mojo::InterfacePtrSet<TraceProvider> provider_ptrs_;
mojo::Binding<TraceCollector> collector_binding_;
+ mojo::BindingSet<TraceProviderRegistry> provider_registry_bindings_;
bool tracing_active_;
mojo::String tracing_categories_;

Powered by Google App Engine
This is Rietveld 408576698