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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2867303003: Generalize the API of WakeLockContext mojo interface. (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
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 6cee92c3e57c1e88a42edff7fcc9c039c79da5c0..aa6b5cb4b0e462289f875d29c496ca3e4baf2714 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -126,6 +126,7 @@
#include "content/public/common/web_preferences.h"
#include "device/geolocation/geolocation_service_context.h"
#include "device/nfc/nfc.mojom.h"
+#include "device/power_save_blocker/power_save_blocker.h"
#include "net/base/url_util.h"
#include "net/http/http_cache.h"
#include "net/http/http_transaction_factory.h"
@@ -2637,7 +2638,11 @@ device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() {
if (!wake_lock_context) {
return nullptr;
}
- wake_lock_context->GetWakeLock(mojo::MakeRequest(&renderer_wake_lock_));
+ wake_lock_context->GetWakeLock(
+ device::PowerSaveBlocker::PowerSaveBlockerType::
+ kPowerSaveBlockPreventDisplaySleep,
+ device::PowerSaveBlocker::Reason::kReasonOther, "Wake Lock API",
+ mojo::MakeRequest(&renderer_wake_lock_));
}
return renderer_wake_lock_.get();
}

Powered by Google App Engine
This is Rietveld 408576698