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

Unified Diff: services/resource_coordinator/public/cpp/tracing/chrome_agent.h

Issue 2833873003: WIP: The tracing service prototype
Patch Set: sync Created 3 years, 7 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
Index: services/resource_coordinator/public/cpp/tracing/chrome_agent.h
diff --git a/services/resource_coordinator/public/cpp/tracing/chrome_agent.h b/services/resource_coordinator/public/cpp/tracing/chrome_agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..d58041e3a14d7a71dd693739d943634c69d1452e
--- /dev/null
+++ b/services/resource_coordinator/public/cpp/tracing/chrome_agent.h
@@ -0,0 +1,57 @@
+// Copyright 2017 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_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_
+#define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/ref_counted_memory.h"
+#include "mojo/public/cpp/bindings/binding.h"
+#include "services/resource_coordinator/public/cpp/resource_coordinator_export.h"
+#include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom.h"
+#include "services/service_manager/public/cpp/connector.h"
+
+namespace resource_coordinator {
+namespace tracing {
+
+class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT ChromeAgent
+ : public mojom::Agent {
+ public:
+ static void InitializeIfNeeded(mojom::AgentSetPtr agent_set);
+
+ private:
+ explicit ChromeAgent(mojom::AgentSetPtr agent_set);
+ ~ChromeAgent() override;
+
+ static void BindAgentSetRequest(service_manager::Connector* connector,
+ const std::string& name,
+ mojom::AgentSetRequest request);
+
+ // mojom::Agent
+ void StartTracing(const std::string& config,
+ mojom::RecorderPtr recorder,
+ bool report_categories_only,
+ const StartTracingCallback& callback) override;
+ void StopAndFlush() override;
+ void RequestClockSyncMarker(
+ const std::string& sync_id,
+ const RequestClockSyncMarkerCallback& callback) override;
+ void RequestBufferStatus(
+ const RequestBufferStatusCallback& callback) override;
+
+ void SendChunk(const scoped_refptr<base::RefCountedString>& events_str,
+ bool has_more_events);
+
+ mojom::AgentSetPtr agent_set_;
+ mojo::Binding<mojom::Agent> binding_;
+ mojom::RecorderPtr recorder_;
+ bool report_categories_only_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeAgent);
+};
+
+} // namespace tracing
+} // namespace resource_coordinator
+#endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_
« no previous file with comments | « services/resource_coordinator/public/cpp/BUILD.gn ('k') | services/resource_coordinator/public/cpp/tracing/chrome_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698