OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR_BR IDGE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR_BR IDGE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR_BR IDGE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR_BR IDGE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/memory/weak_ptr.h" | |
Luis Héctor Chávez
2017/02/15 19:32:32
nit: remove since it will be unused.
xzhou
2017/02/16 18:34:50
Done.
| |
11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "chrome/browser/profiles/profile.h" | |
Luis Héctor Chávez
2017/02/15 19:32:32
nit: move to the .cc file and fwd-declare it here.
xzhou
2017/02/16 18:34:50
Done.
xzhou
2017/02/16 18:34:50
I changed to save AccountID per hidehiko's suggest
Yusuke Sato
2017/02/16 18:42:57
Your code seems fine as https://google.github.io/s
| |
12 #include "components/arc/arc_service.h" | 14 #include "components/arc/arc_service.h" |
13 #include "components/arc/common/boot_phase_monitor.mojom.h" | 15 #include "components/arc/common/boot_phase_monitor.mojom.h" |
14 #include "components/arc/instance_holder.h" | 16 #include "components/arc/instance_holder.h" |
17 #include "components/signin/core/account_id/account_id.h" | |
Luis Héctor Chávez
2017/02/15 19:32:32
nit: move it to the .cc since it's not used here.
xzhou
2017/02/16 18:34:50
Done.
| |
15 #include "mojo/public/cpp/bindings/binding.h" | 18 #include "mojo/public/cpp/bindings/binding.h" |
16 | 19 |
17 namespace arc { | 20 namespace arc { |
18 | 21 |
19 class ArcBridgeService; | 22 class ArcBridgeService; |
20 class ArcInstanceThrottle; | 23 class ArcInstanceThrottle; |
21 | 24 |
22 // Receives boot phase notifications from ARC. | 25 // Receives boot phase notifications from ARC. |
23 class ArcBootPhaseMonitorBridge | 26 class ArcBootPhaseMonitorBridge |
24 : public ArcService, | 27 : public ArcService, |
25 public InstanceHolder<mojom::BootPhaseMonitorInstance>::Observer, | 28 public InstanceHolder<mojom::BootPhaseMonitorInstance>::Observer, |
26 public mojom::BootPhaseMonitorHost { | 29 public mojom::BootPhaseMonitorHost { |
27 public: | 30 public: |
28 explicit ArcBootPhaseMonitorBridge(ArcBridgeService* bridge_service); | 31 explicit ArcBootPhaseMonitorBridge(ArcBridgeService* bridge_service, |
Yusuke Sato
2017/02/15 18:31:37
remove explicit
xzhou
2017/02/16 18:34:50
Done.
| |
32 Profile* profile); | |
29 ~ArcBootPhaseMonitorBridge() override; | 33 ~ArcBootPhaseMonitorBridge() override; |
30 | 34 |
31 // InstanceHolder<mojom::BootPhaseMonitorInstance>::Observer | 35 // InstanceHolder<mojom::BootPhaseMonitorInstance>::Observer |
32 void OnInstanceReady() override; | 36 void OnInstanceReady() override; |
33 void OnInstanceClosed() override; | 37 void OnInstanceClosed() override; |
34 | 38 |
35 // mojom::BootPhaseMonitorHost | 39 // mojom::BootPhaseMonitorHost |
36 void OnBootCompleted() override; | 40 void OnBootCompleted() override; |
41 void OnEmitArcBooted(bool success); | |
37 | 42 |
38 private: | 43 private: |
44 Profile* profile; | |
hidehiko
2017/02/15 18:48:09
s/profile/profile_/
Could you comment its lifetime
Luis Héctor Chávez
2017/02/15 19:02:11
Profile* const profile_;
(Chrome members have a t
xzhou
2017/02/16 18:34:50
Done.
xzhou
2017/02/16 18:34:50
Done.
xzhou
2017/02/16 18:34:50
Done.
xzhou
2017/02/16 18:34:50
Done.
| |
39 mojo::Binding<mojom::BootPhaseMonitorHost> binding_; | 45 mojo::Binding<mojom::BootPhaseMonitorHost> binding_; |
40 std::unique_ptr<ArcInstanceThrottle> throttle_; | 46 std::unique_ptr<ArcInstanceThrottle> throttle_; |
41 | 47 |
42 base::ThreadChecker thread_checker_; | 48 base::ThreadChecker thread_checker_; |
49 base::WeakPtrFactory<ArcBootPhaseMonitorBridge> weak_ptr_factory_; | |
Luis Héctor Chávez
2017/02/15 19:02:11
nit: remove
xzhou
2017/02/16 18:34:50
Done.
| |
43 | 50 |
44 DISALLOW_COPY_AND_ASSIGN(ArcBootPhaseMonitorBridge); | 51 DISALLOW_COPY_AND_ASSIGN(ArcBootPhaseMonitorBridge); |
45 }; | 52 }; |
46 | 53 |
47 } // namespace arc | 54 } // namespace arc |
48 | 55 |
49 #endif // CHROME_BROWSER_CHROMEOS_ARC_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR _BRIDGE_H_ | 56 #endif // CHROME_BROWSER_CHROMEOS_ARC_BOOT_PHASE_MONITOR_ARC_BOOT_PHASE_MONITOR _BRIDGE_H_ |
OLD | NEW |