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

Unified Diff: mojo/common/tracing_impl.h

Issue 769963004: Add tracing service and make the shell+sky_viewer+services talk to it (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « mojo/common/tracing.mojom ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/tracing_impl.h
diff --git a/mojo/common/tracing_impl.h b/mojo/common/tracing_impl.h
index b1f2d5247a16c3252962d753120a7eba2e0535ae..ffc617b56d1131437fc6e2542e48a3664a722d72 100644
--- a/mojo/common/tracing_impl.h
+++ b/mojo/common/tracing_impl.h
@@ -7,24 +7,40 @@
#include "base/basictypes.h"
#include "base/files/file_path.h"
-#include "mojo/common/tracing.mojom.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/ref_counted_memory.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "services/tracing/tracing.mojom.h"
namespace mojo {
-class TracingImpl : public Tracing {
+class ApplicationImpl;
+
+class TracingImpl : public tracing::TraceController {
public:
- TracingImpl(InterfaceRequest<Tracing> request,
- base::FilePath::StringType base_name);
+ // This constructs a TracingImpl and connects to the tracing service. The
+ // lifetime of the TracingImpl is bound to the connection to the tracing
+ // service.
+ static void Create(ApplicationImpl* app);
+
+ // This constructs a TracingImpl around a tracing::TraceDataCollectorPtr
+ // already bound to the service.
+ static void Create(tracing::TraceDataCollectorPtr ptr);
+
virtual ~TracingImpl();
private:
- // Overridden from Tracing:
- void Start() override;
- void Stop() override;
+ explicit TracingImpl(ApplicationImpl* app);
+ explicit TracingImpl(tracing::TraceDataCollectorPtr ptr);
+
+ // Overridden from tracing::TraceController:
+ void StartTracing(const String& categories) override;
+ void StopTracing() override;
+
+ void SendChunk(const scoped_refptr<base::RefCountedString>& events_str,
+ bool has_more_events);
- base::FilePath::StringType base_name_;
- StrongBinding<Tracing> binding_;
+ StrongBinding<tracing::TraceController> binding_;
DISALLOW_COPY_AND_ASSIGN(TracingImpl);
};
« no previous file with comments | « mojo/common/tracing.mojom ('k') | mojo/common/tracing_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698