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

Unified Diff: device/wake_lock/wake_lock_service_impl.cc

Issue 2866243002: Fix nits after refactoring WakeLockServiceImpl. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/wake_lock/wake_lock_service_impl.cc
diff --git a/device/wake_lock/wake_lock_service_impl.cc b/device/wake_lock/wake_lock_service_impl.cc
index 6e1571806cb7d185afabe6c7f05e679defa165a7..038e5f04d075470a3eed597f728ecce03e798abc 100644
--- a/device/wake_lock/wake_lock_service_impl.cc
+++ b/device/wake_lock/wake_lock_service_impl.cc
@@ -63,10 +63,9 @@ void WakeLockServiceImpl::CancelWakeLock() {
return;
*binding_set_.dispatch_context() = false;
- if (num_lock_requests_ > 0) {
- num_lock_requests_--;
- UpdateWakeLock();
- }
+ DCHECK(num_lock_requests_ > 0);
blundell 2017/05/09 16:05:11 tiny nit: I would order this above line 65 from a
ke.he 2017/05/10 02:42:14 Done.
+ num_lock_requests_--;
+ UpdateWakeLock();
}
void WakeLockServiceImpl::HasWakeLockForTests(
@@ -112,8 +111,6 @@ void WakeLockServiceImpl::RemoveWakeLock() {
}
void WakeLockServiceImpl::OnConnectionError() {
- DCHECK(binding_set_.dispatch_context());
-
// If the error-happening client's wakelock is in outstanding status,
blundell 2017/05/09 16:05:11 tiny nit: "the error-happening client's wakelock i
ke.he 2017/05/10 02:42:14 Thanks:) Done.
// decrease the num_lock_requests and call UpdateWakeLock().
if (*binding_set_.dispatch_context() && num_lock_requests_ > 0) {
@@ -121,7 +118,6 @@ void WakeLockServiceImpl::OnConnectionError() {
UpdateWakeLock();
}
- // If |binding_set_| is empty, WakeLockServiceImpl should delele itself.
if (binding_set_.empty())
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698