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

Unified Diff: services/tracing/recorder.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/public/interfaces/tracing.mojom ('k') | services/tracing/recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/tracing/recorder.h
diff --git a/services/tracing/recorder.h b/services/tracing/recorder.h
new file mode 100644
index 0000000000000000000000000000000000000000..17626b58e3c70f633f25481f71adde76c345dc8f
--- /dev/null
+++ b/services/tracing/recorder.h
@@ -0,0 +1,42 @@
+// 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_RECORDER_H_
+#define SERVICES_TRACING_RECORDER_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "mojo/public/cpp/bindings/string.h"
+#include "services/tracing/data_sink.h"
+#include "services/tracing/public/interfaces/tracing.mojom.h"
+
+namespace tracing {
+
+class Recorder : public mojom::Recorder {
+ public:
+ Recorder(mojom::RecorderRequest request, DataSink* sink);
+ ~Recorder() override;
+
+ // TryRead attempts to read a single chunk from the Recorder pipe if one is
+ // available and passes it to the DataSink. Returns immediately if no
+ // chunk is available.
+ void TryRead();
+
+ // RecorderHandle returns the handle value of the Recorder binding which can
+ // be used to wait until chunks are available.
+ mojo::Handle RecorderHandle() const;
+
+ private:
+ // mojom::Recorder implementation.
+ void Record(const std::string& json) override;
+
+ DataSink* sink_;
+ mojo::Binding<mojom::Recorder> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(Recorder);
+};
+
+} // namespace tracing
+
+#endif // SERVICES_TRACING_RECORDER_H_
« no previous file with comments | « services/tracing/public/interfaces/tracing.mojom ('k') | services/tracing/recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698