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

Side by Side Diff: components/arc/arc_bridge_service.h

Issue 2596273002: Move ArcSessionRunner from ArcBridgeService to ArcSessionManager. (Closed)
Patch Set: Created 3 years, 12 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 30 matching lines...) Expand all
41 class PowerInstance; 41 class PowerInstance;
42 class PrintInstance; 42 class PrintInstance;
43 class ProcessInstance; 43 class ProcessInstance;
44 class StorageManagerInstance; 44 class StorageManagerInstance;
45 class TtsInstance; 45 class TtsInstance;
46 class VideoInstance; 46 class VideoInstance;
47 class WallpaperInstance; 47 class WallpaperInstance;
48 48
49 } // namespace mojom 49 } // namespace mojom
50 50
51 class ArcSessionObserver;
52 class ArcSessionRunner;
53
54 // The Chrome-side service that handles ARC instances and ARC bridge creation. 51 // The Chrome-side service that handles ARC instances and ARC bridge creation.
Luis Héctor Chávez 2016/12/22 18:29:56 Not anymore :)
hidehiko 2016/12/22 19:04:12 Oops. Updated.
55 // This service handles the lifetime of ARC instances and sets up the 52 // This service handles the lifetime of ARC instances and sets up the
56 // communication channel (the ARC bridge) used to send and receive messages. 53 // communication channel (the ARC bridge) used to send and receive messages.
57 class ArcBridgeService { 54 class ArcBridgeService {
58 public: 55 public:
59 ArcBridgeService(); 56 ArcBridgeService();
60 virtual ~ArcBridgeService(); 57 virtual ~ArcBridgeService();
Luis Héctor Chávez 2016/12/22 18:29:56 This class does not have any subclasses anymore. C
hidehiko 2016/12/22 19:04:12 Good catch! Fixed.
61 58
62 // Return true if ARC has been enabled through a commandline 59 // Return true if ARC has been enabled through a commandline
63 // switch. 60 // switch.
64 static bool GetEnabled(const base::CommandLine* command_line); 61 static bool GetEnabled(const base::CommandLine* command_line);
65 62
66 // Return true if ARC is available on the current board. 63 // Return true if ARC is available on the current board.
67 static bool GetAvailable(const base::CommandLine* command_line); 64 static bool GetAvailable(const base::CommandLine* command_line);
68 65
69 // Initializes the ArcSessionRunner with the given instance.
70 // This must be called before following proxy methods.
71 void InitializeArcSessionRunner(
72 std::unique_ptr<ArcSessionRunner> arc_session_runner);
73
74 // Proxies the method to ArcSessionRunner. See details in the
75 // ArcSessionRunner's comment.
76 // TODO(hidehiko): Move the ownership from ArcBridgeService to
77 // ArcSessionManager, and remove these methods.
78 void AddObserver(ArcSessionObserver* observer);
79 void RemoveObserver(ArcSessionObserver* observer);
80 void RequestStart();
81 void RequestStop();
82 void OnShutdown();
83 bool ready() const;
84 bool stopped() const;
85
86 InstanceHolder<mojom::AppInstance>* app() { return &app_; } 66 InstanceHolder<mojom::AppInstance>* app() { return &app_; }
87 InstanceHolder<mojom::AudioInstance>* audio() { return &audio_; } 67 InstanceHolder<mojom::AudioInstance>* audio() { return &audio_; }
88 InstanceHolder<mojom::AuthInstance>* auth() { return &auth_; } 68 InstanceHolder<mojom::AuthInstance>* auth() { return &auth_; }
89 InstanceHolder<mojom::BluetoothInstance>* bluetooth() { return &bluetooth_; } 69 InstanceHolder<mojom::BluetoothInstance>* bluetooth() { return &bluetooth_; }
90 InstanceHolder<mojom::BootPhaseMonitorInstance>* boot_phase_monitor() { 70 InstanceHolder<mojom::BootPhaseMonitorInstance>* boot_phase_monitor() {
91 return &boot_phase_monitor_; 71 return &boot_phase_monitor_;
92 } 72 }
93 InstanceHolder<mojom::ClipboardInstance>* clipboard() { return &clipboard_; } 73 InstanceHolder<mojom::ClipboardInstance>* clipboard() { return &clipboard_; }
94 InstanceHolder<mojom::CrashCollectorInstance>* crash_collector() { 74 InstanceHolder<mojom::CrashCollectorInstance>* crash_collector() {
95 return &crash_collector_; 75 return &crash_collector_;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; 124 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_;
145 InstanceHolder<mojom::PolicyInstance> policy_; 125 InstanceHolder<mojom::PolicyInstance> policy_;
146 InstanceHolder<mojom::PowerInstance> power_; 126 InstanceHolder<mojom::PowerInstance> power_;
147 InstanceHolder<mojom::PrintInstance> print_; 127 InstanceHolder<mojom::PrintInstance> print_;
148 InstanceHolder<mojom::ProcessInstance> process_; 128 InstanceHolder<mojom::ProcessInstance> process_;
149 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; 129 InstanceHolder<mojom::StorageManagerInstance> storage_manager_;
150 InstanceHolder<mojom::TtsInstance> tts_; 130 InstanceHolder<mojom::TtsInstance> tts_;
151 InstanceHolder<mojom::VideoInstance> video_; 131 InstanceHolder<mojom::VideoInstance> video_;
152 InstanceHolder<mojom::WallpaperInstance> wallpaper_; 132 InstanceHolder<mojom::WallpaperInstance> wallpaper_;
153 133
154 std::unique_ptr<ArcSessionRunner> arc_session_runner_;
155
156 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); 134 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService);
157 }; 135 };
158 136
159 } // namespace arc 137 } // namespace arc
160 138
161 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ 139 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698