Chromium Code Reviews| 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 CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ | |
| 6 #define CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ | |
| 7 | |
| 8 #include "base/callback_forward.h" | |
| 9 #include "base/trace_event/trace_event.h" | |
| 10 #include "base/trace_event/tracing_agent.h" | |
| 11 #include "chromeos/chromeos_export.h" | |
| 12 | |
| 13 namespace chromeos { | |
| 14 | |
| 15 // A wrapper for controlling tracing in ARC container. | |
| 16 // The overrided Stop/StartAgentTracing functions is implemented by the | |
|
Luis Héctor Chávez
2017/02/27 20:47:18
nit: s/overrided/overridden/, s/is implemented/are
Earl Ou
2017/03/02 07:57:59
Done.
| |
| 17 // Delegate object to interact with ARC bridge. All the functions are expected | |
| 18 // to be called on the brower's UI thread. | |
| 19 class CHROMEOS_EXPORT ArcTraceAgent : public base::trace_event::TracingAgent { | |
| 20 public: | |
| 21 class Delegate { | |
| 22 public: | |
| 23 using StartTracingCallback = base::Callback<void(bool)>; | |
| 24 using StopTracingCallback = base::Callback<void(bool)>; | |
| 25 | |
| 26 virtual ~Delegate(); | |
| 27 | |
| 28 virtual void StartTracing( | |
| 29 const base::trace_event::TraceConfig& trace_config, | |
| 30 const StartTracingCallback& callback) = 0; | |
| 31 | |
| 32 virtual void StopTracing(const StopTracingCallback& callback) = 0; | |
| 33 }; | |
| 34 | |
| 35 virtual ~ArcTraceAgent(); | |
| 36 | |
| 37 static ArcTraceAgent* GetInstance(); | |
| 38 | |
| 39 // Sets Delegate instance, which should implement the communication | |
| 40 // using ARC bridge. If set to nullptr, calling of Start/StopAgentTracing | |
| 41 // does nothing. | |
| 42 virtual void SetDelegate(Delegate* delegate) = 0; | |
| 43 }; | |
| 44 | |
| 45 } // namespace chromeos | |
| 46 | |
| 47 #endif // CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ | |
| OLD | NEW |