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

Side by Side Diff: chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.h

Issue 2400163003: arc: enable Android tracing in verified-boot mode (Closed)
Patch Set: rebase to tot Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/files/scoped_file.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
13 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
14 #include "components/arc/arc_service.h" 15 #include "components/arc/arc_service.h"
15 #include "components/arc/common/tracing.mojom.h" 16 #include "components/arc/common/tracing.mojom.h"
16 #include "components/arc/instance_holder.h" 17 #include "components/arc/instance_holder.h"
17 #include "content/browser/tracing/arc_tracing_agent.h" 18 #include "content/browser/tracing/arc_tracing_agent.h"
18 19
19 namespace arc { 20 namespace arc {
20 21
21 class ArcBridgeService; 22 class ArcBridgeService;
22 23
23 // This class provides the interface to trigger tracing in the container. 24 // This class provides the interface to trigger tracing in the container.
24 class ArcTracingBridge 25 class ArcTracingBridge
25 : public ArcService, 26 : public ArcService,
26 public content::ArcTracingAgent::Delegate, 27 public content::ArcTracingAgent::Delegate,
27 public InstanceHolder<mojom::TracingInstance>::Observer { 28 public InstanceHolder<mojom::TracingInstance>::Observer {
28 public: 29 public:
29 explicit ArcTracingBridge(ArcBridgeService* bridge_service); 30 explicit ArcTracingBridge(ArcBridgeService* bridge_service);
30 ~ArcTracingBridge() override; 31 ~ArcTracingBridge() override;
31 32
32 // InstanceHolder<mojom::TracingInstance>::Observer overrides: 33 // InstanceHolder<mojom::TracingInstance>::Observer overrides:
33 void OnInstanceReady() override; 34 void OnInstanceReady() override;
34 35
35 // content::ArcTracingAgent::Delegate overrides: 36 // content::ArcTracingAgent::Delegate overrides:
36 void StartTracing(const base::trace_event::TraceConfig& trace_config, 37 void StartTracing(const base::trace_event::TraceConfig& trace_config,
38 base::ScopedFD write_fd,
37 const StartTracingCallback& callback) override; 39 const StartTracingCallback& callback) override;
38 void StopTracing(const StopTracingCallback& callback) override; 40 void StopTracing(const StopTracingCallback& callback) override;
39 41
40 private: 42 private:
41 struct Category; 43 struct Category;
42 44
43 // Callback for QueryAvailableCategories. 45 // Callback for QueryAvailableCategories.
44 void OnCategoriesReady(const std::vector<std::string>& categories); 46 void OnCategoriesReady(const std::vector<std::string>& categories);
45 47
46 // List of available categories. 48 // List of available categories.
47 std::vector<Category> categories_; 49 std::vector<Category> categories_;
48 50
49 // NOTE: Weak pointers must be invalidated before all other member variables 51 // NOTE: Weak pointers must be invalidated before all other member variables
50 // so it must be the last member. 52 // so it must be the last member.
51 base::WeakPtrFactory<ArcTracingBridge> weak_ptr_factory_; 53 base::WeakPtrFactory<ArcTracingBridge> weak_ptr_factory_;
52 54
53 DISALLOW_COPY_AND_ASSIGN(ArcTracingBridge); 55 DISALLOW_COPY_AND_ASSIGN(ArcTracingBridge);
54 }; 56 };
55 57
56 } // namespace arc 58 } // namespace arc
57 59
58 #endif // CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_ 60 #endif // CHROME_BROWSER_CHROMEOS_ARC_TRACING_ARC_TRACING_BRIDGE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698