Chromium Code Reviews| 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); |
| } |