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

Side by Side Diff: components/arc/power/arc_power_bridge.cc

Issue 1635603002: Make use of CreateInterfacePtrAndBind() where appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks 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 unified diff | Download patch
« no previous file with comments | « components/arc/ime/arc_ime_ipc_host_impl.cc ('k') | components/arc/video/arc_video_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 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 #include "components/arc/power/arc_power_bridge.h" 5 #include "components/arc/power/arc_power_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 17 matching lines...) Expand all
28 ReleaseAllDisplayWakeLocks(); 28 ReleaseAllDisplayWakeLocks();
29 } 29 }
30 30
31 void ArcPowerBridge::OnPowerInstanceReady() { 31 void ArcPowerBridge::OnPowerInstanceReady() {
32 PowerInstance* power_instance = arc_bridge_service()->power_instance(); 32 PowerInstance* power_instance = arc_bridge_service()->power_instance();
33 if (!power_instance) { 33 if (!power_instance) {
34 LOG(ERROR) << "OnPowerInstanceReady called, but no power instance found"; 34 LOG(ERROR) << "OnPowerInstanceReady called, but no power instance found";
35 return; 35 return;
36 } 36 }
37 37
38 PowerHostPtr host; 38 power_instance->Init(binding_.CreateInterfacePtrAndBind());
39 binding_.Bind(mojo::GetProxy(&host));
40 power_instance->Init(std::move(host));
41 } 39 }
42 40
43 void ArcPowerBridge::OnAcquireDisplayWakeLock( 41 void ArcPowerBridge::OnAcquireDisplayWakeLock(
44 DisplayWakeLockType type) { 42 DisplayWakeLockType type) {
45 if (!chromeos::PowerPolicyController::IsInitialized()) { 43 if (!chromeos::PowerPolicyController::IsInitialized()) {
46 LOG(WARNING) << "PowerPolicyController is not available"; 44 LOG(WARNING) << "PowerPolicyController is not available";
47 return; 45 return;
48 } 46 }
49 chromeos::PowerPolicyController* controller = 47 chromeos::PowerPolicyController* controller =
50 chromeos::PowerPolicyController::Get(); 48 chromeos::PowerPolicyController::Get();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 chromeos::PowerPolicyController* controller = 95 chromeos::PowerPolicyController* controller =
98 chromeos::PowerPolicyController::Get(); 96 chromeos::PowerPolicyController::Get();
99 97
100 for (const auto& it : wake_locks_) { 98 for (const auto& it : wake_locks_) {
101 controller->RemoveWakeLock(it.second); 99 controller->RemoveWakeLock(it.second);
102 } 100 }
103 wake_locks_.clear(); 101 wake_locks_.clear();
104 } 102 }
105 103
106 } // namespace arc 104 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/ime/arc_ime_ipc_host_impl.cc ('k') | components/arc/video/arc_video_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698