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> | |
|
Luis Héctor Chávez
2017/02/16 16:45:10
unused?
Earl Ou
2017/02/17 02:12:59
Removed
| |
| 9 | |
| 10 #include "base/callback.h" | |
|
Luis Héctor Chávez
2017/02/16 16:45:11
Maybe "base/callback_forward.h"?
Earl Ou
2017/02/17 02:12:59
Done.
| |
| 11 #include "base/files/scoped_file.h" | |
|
Luis Héctor Chávez
2017/02/16 16:45:11
unused
Earl Ou
2017/02/17 02:12:59
Done.
| |
| 12 #include "base/trace_event/trace_event.h" | |
| 13 #include "base/trace_event/tracing_agent.h" | |
| 14 #include "chromeos/chromeos_export.h" | |
| 15 | |
| 16 namespace chromeos { | |
| 17 | |
| 18 // A wrapper for controlling tracing in ARC container. | |
| 19 class CHROMEOS_EXPORT ArcTraceAgent : public base::trace_event::TracingAgent { | |
|
Luis Héctor Chávez
2017/02/16 16:45:11
Maybe add a comment about how this class should on
Earl Ou
2017/02/17 02:12:59
Done.
| |
| 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() = default; | |
|
Luis Héctor Chávez
2017/02/16 16:45:11
nit: please move the declarations to the .cc file
Earl Ou
2017/02/17 02:12:59
Done.
| |
| 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() = default; | |
| 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 |