OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 MOJO_COMMON_TRACING_CONTROLLER_IMPL_H_ |
| 6 #define MOJO_COMMON_TRACING_CONTROLLER_IMPL_H_ |
| 7 |
| 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "mojo/public/cpp/bindings/interface_request.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 11 #include "services/tracing/tracing.mojom.h" |
| 12 |
| 13 namespace mojo { |
| 14 |
| 15 class TraceControllerImpl : public tracing::TraceController, |
| 16 public ErrorHandler { |
| 17 public: |
| 18 TraceControllerImpl(); |
| 19 |
| 20 ~TraceControllerImpl() override; |
| 21 |
| 22 // This binds this TraceControllerImpl instance to the lifetime of the pipe. |
| 23 void Bind(InterfaceRequest<tracing::TraceController> request); |
| 24 |
| 25 // This does not bind the lifetime of this instance. |
| 26 void Bind(ScopedMessagePipeHandle client_handle); |
| 27 |
| 28 private: |
| 29 // tracing::TraceController implementation: |
| 30 void StartTracing(const String& categories, |
| 31 tracing::TraceDataCollectorPtr collector) override; |
| 32 void StopTracing() override; |
| 33 |
| 34 void SendChunk(const scoped_refptr<base::RefCountedString>& events_str, |
| 35 bool has_more_events); |
| 36 |
| 37 // ErrorHandler implementation: |
| 38 void OnConnectionError() override; |
| 39 |
| 40 tracing::TraceDataCollectorPtr collector_; |
| 41 Binding<tracing::TraceController> binding_; |
| 42 bool delete_on_error_; |
| 43 }; |
| 44 |
| 45 } // namespace mojo |
| 46 |
| 47 #endif // MOJO_COMMON_TRACING_CONTROLLER_IMPL_H_ |
OLD | NEW |