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

Unified Diff: services/tracing/tracing_app.h

Issue 1055703002: Gather trace data by waiting on handles with a fixed timeout (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: review feedback Created 5 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
« no previous file with comments | « services/tracing/tracing.mojom ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/tracing/tracing_app.h
diff --git a/services/tracing/tracing_app.h b/services/tracing/tracing_app.h
new file mode 100644
index 0000000000000000000000000000000000000000..076a8316dbc2132ff725bb1e0e67a0e1170bbc6f
--- /dev/null
+++ b/services/tracing/tracing_app.h
@@ -0,0 +1,57 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// 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_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/scoped_vector.h"
+#include "mojo/common/weak_binding_set.h"
+#include "mojo/common/weak_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 "services/tracing/collector_impl.h"
+#include "services/tracing/trace_data_sink.h"
+#include "services/tracing/tracing.mojom.h"
+
+namespace tracing {
+
+class TracingApp : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<TraceCoordinator>,
+ public TraceCoordinator {
+ public:
+ TracingApp();
+ ~TracingApp() override;
+
+ private:
+ // mojo::ApplicationDelegate implementation.
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override;
+
+ // mojo::InterfaceFactory<TraceCoordinator> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<TraceCoordinator> request) override;
+
+ // tracing::TraceCoordinator implementation.
+ void Start(mojo::ScopedDataPipeProducerHandle stream,
+ const mojo::String& categories) override;
+ void StopAndFlush() override;
+
+ void AllDataCollected();
+
+ scoped_ptr<TraceDataSink> sink_;
+ ScopedVector<CollectorImpl> collector_impls_;
+ mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_;
+ mojo::Binding<TraceCoordinator> coordinator_binding_;
+ bool tracing_active_;
+ mojo::String tracing_categories_;
+
+ DISALLOW_COPY_AND_ASSIGN(TracingApp);
+};
+
+} // namespace tracing
+
+#endif // SERVICES_TRACING_TRACING_APP_H_
« no previous file with comments | « services/tracing/tracing.mojom ('k') | services/tracing/tracing_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698