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 <string> | |
| 9 | |
| 10 #include "base/callback.h" | |
| 11 #include "base/trace_event/trace_event.h" | |
| 12 #include "base/trace_event/tracing_agent.h" | |
| 13 #include "chromeos/chromeos_export.h" | |
| 14 | |
| 15 namespace chromeos { | |
| 16 | |
| 17 // A wrapper for controlling tracing in ARC container. | |
| 18 class CHROMEOS_EXPORT ArcTraceAgent : public base::trace_event::TracingAgent { | |
| 19 public: | |
| 20 class Delegate { | |
| 21 public: | |
| 22 typedef base::Callback<void(bool)> StartTracingCallback; | |
|
Luis Héctor Chávez
2017/01/18 17:31:32
Is there any reason you're using typedef instead o
Earl Ou
2017/01/25 03:50:59
Done. Changed to using.
| |
| 23 typedef base::Callback<void(const std::string&)> StopTracingCallback; | |
| 24 | |
| 25 ~Delegate() = default; | |
|
Yusuke Sato
2017/01/19 23:06:19
virtual
Earl Ou
2017/01/25 03:50:59
Done.
| |
| 26 | |
| 27 virtual void StartTracing( | |
| 28 const base::trace_event::TraceConfig& trace_config, | |
| 29 const StartTracingCallback& callback) = 0; | |
| 30 | |
| 31 virtual void StopTracing(const StopTracingCallback& callback) = 0; | |
| 32 }; | |
| 33 | |
| 34 virtual ~ArcTraceAgent() = default; | |
| 35 | |
| 36 static ArcTraceAgent* GetInstance(); | |
| 37 | |
| 38 // Sets Delegate instance, which should implement the communication | |
| 39 // using ARC bridge. If set to nullptr, calling of Start/StopAgentTracing | |
| 40 // does nothing. | |
| 41 virtual void SetDelegate(Delegate* delegate) = 0; | |
| 42 }; | |
| 43 | |
| 44 } // namespace chromeos | |
| 45 | |
| 46 #endif // CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ | |
| OLD | NEW |