Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1401)

Side by Side Diff: chromeos/trace/arc_tracing_agent.h

Issue 2699833003: arc: enable Android tracing from chrome://tracing in dev mode (Closed)
Patch Set: Fix according to comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_TRACING_AGENT_H_
6 #define CHROMEOS_TRACE_ARC_TRACING_AGENT_H_
7
8 #include "base/callback_forward.h"
9 #include "base/macros.h"
10 #include "base/trace_event/trace_event.h"
11 #include "base/trace_event/tracing_agent.h"
12 #include "chromeos/chromeos_export.h"
13
14 namespace chromeos {
15
16 // A wrapper for controlling tracing in ARC container.
17 // The overriden Stop/StartAgentTracing functions are implemented by the
18 // Delegate object to interact with ARC bridge. All the functions are expected
19 // to be called on the browser's UI thread.
20 class CHROMEOS_EXPORT ArcTracingAgent : public base::trace_event::TracingAgent {
21 public:
22 class Delegate {
23 public:
24 // Callback for StartTracing, takes one boolean argument to indicate
25 // success or fail.
Daniel Erat 2017/03/08 15:41:14 nit: s/fail/failure/
Earl Ou 2017/03/09 06:08:42 Done.
26 using StartTracingCallback = base::Callback<void(bool)>;
27 // Callback for StopTracing, takes one boolean argument to indicate
28 // success or fail.
Daniel Erat 2017/03/08 15:41:14 nit: s/fail/failure/
Earl Ou 2017/03/09 06:08:42 Done.
29 using StopTracingCallback = base::Callback<void(bool)>;
30
31 virtual ~Delegate();
32
33 // Starts tracing in ARC container.
34 virtual void StartTracing(
35 const base::trace_event::TraceConfig& trace_config,
36 const StartTracingCallback& callback) = 0;
37
38 // Stops tracing in ARC container.
39 virtual void StopTracing(const StopTracingCallback& callback) = 0;
40 };
41
42 ArcTracingAgent();
43 ~ArcTracingAgent() override;
44
45 static ArcTracingAgent* GetInstance();
46
47 // Sets Delegate instance, which should implement the communication
48 // using ARC bridge. If set to nullptr, calling of Start/StopAgentTracing
49 // does nothing. Note that this class doesn't have the ownership of
50 // |delegate| as it should be managed by |ArcServiceLauncher|
Daniel Erat 2017/03/08 15:41:14 nit: i'd just say "Ownership of |delegate| remains
Earl Ou 2017/03/09 06:08:42 Done.
51 virtual void SetDelegate(Delegate* delegate) = 0;
52
53 private:
54 DISALLOW_COPY_AND_ASSIGN(ArcTracingAgent);
55 };
56
57 } // namespace chromeos
58
59 #endif // CHROMEOS_TRACE_ARC_TRACING_AGENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698