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

Unified Diff: services/tracing/service.h

Issue 2208783002: Make Tracing Service not use outgoing InterfaceProvider, update conventions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 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 | « services/tracing/recorder.cc ('k') | services/tracing/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/tracing/service.h
diff --git a/services/tracing/tracing_app.h b/services/tracing/service.h
similarity index 52%
rename from services/tracing/tracing_app.h
rename to services/tracing/service.h
index dfeece7857dab6d4652daaa4cffe139da3f6b982..4c8f39c96d16c7d02411f443cc8a96446318e38e 100644
--- a/services/tracing/tracing_app.h
+++ b/services/tracing/service.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef SERVICES_TRACING_TRACING_APP_H_
-#define SERVICES_TRACING_TRACING_APP_H_
+#ifndef SERVICES_TRACING_SERVICE_H_
+#define SERVICES_TRACING_SERVICE_H_
#include <stdint.h>
@@ -16,42 +16,51 @@
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/shell/public/cpp/interface_factory.h"
#include "services/shell/public/cpp/service.h"
+#include "services/tracing/data_sink.h"
#include "services/tracing/public/interfaces/tracing.mojom.h"
-#include "services/tracing/trace_data_sink.h"
-#include "services/tracing/trace_recorder_impl.h"
+#include "services/tracing/recorder.h"
namespace tracing {
-class TracingApp
+class Service
: public shell::Service,
- public shell::InterfaceFactory<TraceCollector>,
- public TraceCollector,
- public shell::InterfaceFactory<StartupPerformanceDataCollector>,
- public StartupPerformanceDataCollector {
+ public shell::InterfaceFactory<mojom::Factory>,
+ public shell::InterfaceFactory<mojom::Collector>,
+ public shell::InterfaceFactory<mojom::StartupPerformanceDataCollector>,
+ public mojom::Factory,
+ public mojom::Collector,
+ public mojom::StartupPerformanceDataCollector {
public:
- TracingApp();
- ~TracingApp() override;
+ Service();
+ ~Service() override;
private:
// shell::Service implementation.
bool OnConnect(shell::Connection* connection) override;
bool OnStop() override;
- // shell::InterfaceFactory<TraceCollector> implementation.
+ // shell::InterfaceFactory<mojom::Factory>:
void Create(const shell::Identity& remote_identity,
- mojo::InterfaceRequest<TraceCollector> request) override;
+ mojom::FactoryRequest request) override;
- // shell::InterfaceFactory<StartupPerformanceDataCollector> implementation.
+ // shell::InterfaceFactory<mojom::Collector>:
+ void Create(const shell::Identity& remote_identity,
+ mojom::CollectorRequest request) override;
+
+ // shell::InterfaceFactory<mojom::StartupPerformanceDataCollector>:
void Create(
const shell::Identity& remote_identity,
- mojo::InterfaceRequest<StartupPerformanceDataCollector> request) override;
+ mojom::StartupPerformanceDataCollectorRequest request) override;
+
+ // mojom::Factory:
+ void CreateRecorder(mojom::ProviderPtr provider) override;
- // tracing::TraceCollector implementation.
+ // mojom::Collector:
void Start(mojo::ScopedDataPipeProducerHandle stream,
- const mojo::String& categories) override;
+ const std::string& categories) override;
void StopAndFlush() override;
- // StartupPerformanceDataCollector implementation.
+ // mojom::StartupPerformanceDataCollector:
void SetShellProcessCreationTime(int64_t time) override;
void SetShellMainEntryPointTime(int64_t time) override;
void SetBrowserMessageLoopStartTicks(int64_t ticks) override;
@@ -64,19 +73,20 @@ class TracingApp
void AllDataCollected();
- std::unique_ptr<TraceDataSink> sink_;
- ScopedVector<TraceRecorderImpl> recorder_impls_;
- mojo::InterfacePtrSet<TraceProvider> provider_ptrs_;
- mojo::Binding<TraceCollector> collector_binding_;
- mojo::BindingSet<StartupPerformanceDataCollector>
+ mojo::BindingSet<mojom::Factory> bindings_;
+ std::unique_ptr<DataSink> sink_;
+ ScopedVector<Recorder> recorder_impls_;
+ mojo::InterfacePtrSet<mojom::Provider> provider_ptrs_;
+ mojo::Binding<mojom::Collector> collector_binding_;
+ mojo::BindingSet<mojom::StartupPerformanceDataCollector>
startup_performance_data_collector_bindings_;
- StartupPerformanceTimes startup_performance_times_;
+ mojom::StartupPerformanceTimes startup_performance_times_;
bool tracing_active_;
mojo::String tracing_categories_;
- DISALLOW_COPY_AND_ASSIGN(TracingApp);
+ DISALLOW_COPY_AND_ASSIGN(Service);
};
} // namespace tracing
-#endif // SERVICES_TRACING_TRACING_APP_H_
+#endif // SERVICES_TRACING_SERVICE_H_
« no previous file with comments | « services/tracing/recorder.cc ('k') | services/tracing/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698