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

Unified Diff: device/wake_lock/wake_lock_service_impl.cc

Issue 2874013002: Add GetWakeLockWithoutContext() in WakeLockContextProvider mojo interface. (Closed)
Patch Set: Add GetWakeLockWithoutContext in WakeLockContextProvider mojo interface. 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 | « device/wake_lock/wake_lock_service_context.cc ('k') | services/device/device_service.h » ('j') | 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 f5ca821d762bfd2f23240bc8aa5a54a9a4024acd..0be02edd61c70ae33a8c02240e552a8748df403c 100644
--- a/device/wake_lock/wake_lock_service_impl.cc
+++ b/device/wake_lock/wake_lock_service_impl.cc
@@ -133,6 +133,12 @@ void WakeLockServiceImpl::CreateWakeLock() {
return;
#if defined(OS_ANDROID)
+ if (context_id_ == WakeLockServiceContext::WakeLockInvalidContextId) {
+ LOG(ERROR) << "Client must pass a valid context_id when requests wake lock "
+ "on Android.";
+ return;
+ }
+
gfx::NativeView native_view = native_view_getter_.Run(context_id_);
if (native_view)
wake_lock_.get()->InitDisplaySleepBlocker(native_view);
« no previous file with comments | « device/wake_lock/wake_lock_service_context.cc ('k') | services/device/device_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698