Index: services/tracing/public/cpp/provider.h |
diff --git a/services/tracing/public/cpp/trace_provider_impl.h b/services/tracing/public/cpp/provider.h |
similarity index 54% |
rename from services/tracing/public/cpp/trace_provider_impl.h |
rename to services/tracing/public/cpp/provider.h |
index 975781b4a2e52adc17bb9fd4e526ba03d0a79652..28b29055f3c974618153c3775a8395b33f4732b8 100644 |
--- a/services/tracing/public/cpp/trace_provider_impl.h |
+++ b/services/tracing/public/cpp/provider.h |
@@ -2,9 +2,10 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef SERVICES_TRACING_PUBLIC_CPP_TRACE_PROVIDER_IMPL_H_ |
-#define SERVICES_TRACING_PUBLIC_CPP_TRACE_PROVIDER_IMPL_H_ |
+#ifndef SERVICES_TRACING_PUBLIC_CPP_PROVIDER_H_ |
+#define SERVICES_TRACING_PUBLIC_CPP_PROVIDER_H_ |
+#include "base/command_line.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted_memory.h" |
#include "base/memory/weak_ptr.h" |
@@ -12,23 +13,25 @@ |
#include "mojo/public/cpp/bindings/interface_request.h" |
#include "services/tracing/public/interfaces/tracing.mojom.h" |
-namespace mojo { |
+namespace shell { |
+class Connector; |
+} |
-class TraceProviderImpl : public tracing::TraceProvider { |
+namespace tracing { |
+ |
+class Provider : public mojom::Provider { |
public: |
- TraceProviderImpl(); |
- ~TraceProviderImpl() override; |
+ Provider(); |
+ ~Provider() override; |
- void Bind(InterfaceRequest<tracing::TraceProvider> request); |
+ void Initialize(shell::Connector* connector, const std::string& url); |
- // Enable tracing without waiting for an inbound connection. It will stop if |
- // no TraceRecorder is sent within a set time. |
- void ForceEnableTracing(); |
+ void Bind(mojom::ProviderRequest request); |
private: |
- // tracing::TraceProvider implementation: |
- void StartTracing(const String& categories, |
- tracing::TraceRecorderPtr recorder) override; |
+ // mojom::Provider implementation: |
+ void StartTracing(const std::string& categories, |
+ mojom::RecorderPtr recorder) override; |
void StopTracing() override; |
void SendChunk(const scoped_refptr<base::RefCountedString>& events_str, |
@@ -38,14 +41,18 @@ class TraceProviderImpl : public tracing::TraceProvider { |
// Stop the collection of traces if no external connection asked for them yet. |
void StopIfForced(); |
- Binding<tracing::TraceProvider> binding_; |
+ // Enable tracing without waiting for an inbound connection. It will stop if |
+ // no TraceRecorder is sent within a set time. |
+ void ForceEnableTracing(); |
+ |
+ mojo::Binding<mojom::Provider> binding_; |
bool tracing_forced_; |
- tracing::TraceRecorderPtr recorder_; |
+ mojom::RecorderPtr recorder_; |
- base::WeakPtrFactory<TraceProviderImpl> weak_factory_; |
- DISALLOW_COPY_AND_ASSIGN(TraceProviderImpl); |
+ base::WeakPtrFactory<Provider> weak_factory_; |
+ DISALLOW_COPY_AND_ASSIGN(Provider); |
}; |
-} // namespace mojo |
+} // namespace tracing |
-#endif // SERVICES_TRACING_PUBLIC_CPP_TRACE_PROVIDER_IMPL_H_ |
+#endif // SERVICES_TRACING_PUBLIC_CPP_PROVIDER_H_ |