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

Unified Diff: components/arc/power/arc_power_bridge.cc

Issue 1596663002: arc-bridge: Introduce the ArcService class (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Moved race avoidance boilerplate to ArcBridgeService Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/power/arc_power_bridge.cc
diff --git a/components/arc/power/arc_power_bridge.cc b/components/arc/power/arc_power_bridge.cc
index b918147ab1ed5f3a973e44762c2fe8856e00be78..8cd34041b4df808937ca8158b1b738d7d907c37b 100644
--- a/components/arc/power/arc_power_bridge.cc
+++ b/components/arc/power/arc_power_bridge.cc
@@ -13,15 +13,13 @@
namespace arc {
-ArcPowerBridge::ArcPowerBridge(ArcBridgeService* arc_bridge_service)
- : arc_bridge_service_(arc_bridge_service), binding_(this) {
- arc_bridge_service->AddObserver(this);
- if (arc_bridge_service->power_instance())
- OnPowerInstanceReady();
+ArcPowerBridge::ArcPowerBridge(ArcBridgeService* bridge_service)
+ : ArcService(bridge_service), binding_(this) {
+ arc_bridge_service()->AddObserver(this);
}
ArcPowerBridge::~ArcPowerBridge() {
- arc_bridge_service_->RemoveObserver(this);
+ arc_bridge_service()->RemoveObserver(this);
ReleaseAllDisplayWakeLocks();
}
@@ -31,7 +29,7 @@ void ArcPowerBridge::OnStateChanged(ArcBridgeService::State state) {
}
void ArcPowerBridge::OnPowerInstanceReady() {
- PowerInstance* power_instance = arc_bridge_service_->power_instance();
+ PowerInstance* power_instance = arc_bridge_service()->power_instance();
if (!power_instance) {
LOG(ERROR) << "OnPowerInstanceReady called, but no power instance found";
return;

Powered by Google App Engine
This is Rietveld 408576698