Chromium Code Reviews| Index: chromeos/trace/arc_trace_agent.h |
| diff --git a/chromeos/trace/arc_trace_agent.h b/chromeos/trace/arc_trace_agent.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..36c4be37ec4548123f9bf643e5c88e5b688d4d91 |
| --- /dev/null |
| +++ b/chromeos/trace/arc_trace_agent.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ |
| +#define CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ |
| + |
| +#include "base/callback_forward.h" |
| +#include "base/trace_event/trace_event.h" |
| +#include "base/trace_event/tracing_agent.h" |
| +#include "chromeos/chromeos_export.h" |
| + |
| +namespace chromeos { |
| + |
| +// A wrapper for controlling tracing in ARC container. |
| +// 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.
|
| +// Delegate object to interact with ARC bridge. All the functions are expected |
| +// to be called on the brower's UI thread. |
| +class CHROMEOS_EXPORT ArcTraceAgent : public base::trace_event::TracingAgent { |
| + public: |
| + class Delegate { |
| + public: |
| + using StartTracingCallback = base::Callback<void(bool)>; |
| + using StopTracingCallback = base::Callback<void(bool)>; |
| + |
| + virtual ~Delegate(); |
| + |
| + virtual void StartTracing( |
| + const base::trace_event::TraceConfig& trace_config, |
| + const StartTracingCallback& callback) = 0; |
| + |
| + virtual void StopTracing(const StopTracingCallback& callback) = 0; |
| + }; |
| + |
| + virtual ~ArcTraceAgent(); |
| + |
| + static ArcTraceAgent* GetInstance(); |
| + |
| + // Sets Delegate instance, which should implement the communication |
| + // using ARC bridge. If set to nullptr, calling of Start/StopAgentTracing |
| + // does nothing. |
| + virtual void SetDelegate(Delegate* delegate) = 0; |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROMEOS_TRACE_ARC_TRACE_AGENT_H_ |