| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ | 5 #ifndef APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ |
| 6 #define APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ | 6 #define APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "mojo/data_pipe_utils/data_pipe_drainer.h" | 12 #include "mojo/data_pipe_utils/data_pipe_drainer.h" |
| 13 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 13 #include "mojo/services/tracing/interfaces/tracing.mojom.h" |
| 14 | 14 |
| 15 // Connects to trace collector in tracing.mojo to get traces and returns the | 15 // Connects to trace collector in tracing.mojo to get traces and returns the |
| 16 // results as a single string to the receiver. | 16 // results as a single string to the receiver. |
| 17 class TraceCollectorClient : public mojo::common::DataPipeDrainer::Client { | 17 class TraceCollectorClient : public mojo::common::DataPipeDrainer::Client { |
| 18 public: | 18 public: |
| 19 class Receiver { | 19 class Receiver { |
| 20 public: | 20 public: |
| 21 // |trace_data| will be a JSON list of the collected trace events. | 21 // |trace_data| will be a JSON list of the collected trace events. |
| 22 virtual void OnTraceCollected(std::string trace_data) = 0; | 22 virtual void OnTraceCollected(std::string trace_data) = 0; |
| 23 | 23 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 Receiver* receiver_; | 40 Receiver* receiver_; |
| 41 tracing::TraceCollectorPtr collector_; | 41 tracing::TraceCollectorPtr collector_; |
| 42 scoped_ptr<mojo::common::DataPipeDrainer> drainer_; | 42 scoped_ptr<mojo::common::DataPipeDrainer> drainer_; |
| 43 std::string trace_data_; | 43 std::string trace_data_; |
| 44 bool currently_tracing_; | 44 bool currently_tracing_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(TraceCollectorClient); | 46 DISALLOW_COPY_AND_ASSIGN(TraceCollectorClient); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 #endif // APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ | 49 #endif // APPS_BENCHMARK_TRACE_COORDINATOR_CLIENT_H_ |
| OLD | NEW |