| 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 919d333fd105979beff2e770c0b3535e76e4ca82..05982d6aea295220055ba3ef665ce9e68c841399 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -2600,12 +2600,31 @@ WebContentsImpl::GetGeolocationServiceContext() {
|
| return geolocation_service_context_.get();
|
| }
|
|
|
| -device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockServiceContext() {
|
| +device::mojom::WakeLockContext* WebContentsImpl::GetWakeLockContext() {
|
| if (!wake_lock_context_host_)
|
| wake_lock_context_host_.reset(new WakeLockContextHost(this));
|
| return wake_lock_context_host_->GetWakeLockContext();
|
| }
|
|
|
| +void WebContentsImpl::ConnectToBlinkWakeLock(
|
| + device::mojom::WakeLockServiceRequest request) {
|
| + // WebContents creates a long-lived connection to one WakeLockServiceImpl.
|
| + // All the frames' requests are added into the BindingSet of
|
| + // WakeLockServiceImpl via this connection.
|
| + if (!blink_wake_lock_) {
|
| + device::mojom::WakeLockContext* wake_lock_context = GetWakeLockContext();
|
| + if (!wake_lock_context) {
|
| + return;
|
| + }
|
| + wake_lock_context->GetWakeLock(
|
| + device::PowerSaveBlocker::PowerSaveBlockerType::
|
| + kPowerSaveBlockPreventDisplaySleep,
|
| + device::PowerSaveBlocker::Reason::kReasonOther, "Wake Lock API",
|
| + mojo::MakeRequest(&blink_wake_lock_));
|
| + }
|
| + blink_wake_lock_->AddClient(std::move(request));
|
| +}
|
| +
|
| void WebContentsImpl::OnShowValidationMessage(
|
| RenderViewHostImpl* source,
|
| const gfx::Rect& anchor_in_root_view,
|
|
|