OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_ |
| 6 #define SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/ref_counted_memory.h" |
| 11 #include "mojo/public/cpp/bindings/binding.h" |
| 12 #include "services/resource_coordinator/public/cpp/resource_coordinator_export.h
" |
| 13 #include "services/resource_coordinator/public/interfaces/tracing/tracing.mojom.
h" |
| 14 #include "services/service_manager/public/cpp/connector.h" |
| 15 |
| 16 namespace resource_coordinator { |
| 17 namespace tracing { |
| 18 |
| 19 class SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_EXPORT ChromeAgent |
| 20 : public mojom::Agent { |
| 21 public: |
| 22 static void InitializeIfNeeded(mojom::AgentSetPtr agent_set); |
| 23 |
| 24 private: |
| 25 explicit ChromeAgent(mojom::AgentSetPtr agent_set); |
| 26 ~ChromeAgent() override; |
| 27 |
| 28 static void BindAgentSetRequest(service_manager::Connector* connector, |
| 29 const std::string& name, |
| 30 mojom::AgentSetRequest request); |
| 31 |
| 32 // mojom::Agent |
| 33 void StartTracing(const std::string& config, |
| 34 mojom::RecorderPtr recorder, |
| 35 bool report_categories_only, |
| 36 const StartTracingCallback& callback) override; |
| 37 void StopAndFlush() override; |
| 38 void RequestClockSyncMarker( |
| 39 const std::string& sync_id, |
| 40 const RequestClockSyncMarkerCallback& callback) override; |
| 41 void RequestBufferStatus( |
| 42 const RequestBufferStatusCallback& callback) override; |
| 43 |
| 44 void SendChunk(const scoped_refptr<base::RefCountedString>& events_str, |
| 45 bool has_more_events); |
| 46 |
| 47 mojom::AgentSetPtr agent_set_; |
| 48 mojo::Binding<mojom::Agent> binding_; |
| 49 mojom::RecorderPtr recorder_; |
| 50 bool report_categories_only_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ChromeAgent); |
| 53 }; |
| 54 |
| 55 } // namespace tracing |
| 56 } // namespace resource_coordinator |
| 57 #endif // SERVICES_RESOURCE_COORDINATOR_PUBLIC_CPP_TRACING_CHROME_AGENT_H_ |
OLD | NEW |