New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 903831 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 10
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocking:
issue 257511
issue 903793



Sign in to add a comment

WakeLock: implement Blink mojo service to access views information

Project Member Reported by mlamouri@chromium.org, Nov 9

Issue description

The //services/device WakeLock requires to pass a context id that is related to the view/window. Blink doesn't have this information so the current usage in Blink ignores this information which makes the API useless on Android.

I discovered this while working on another project requiring using WakeLock from Blink (bug 903793).

The fix is to create a Blink service linked to a frame such that Blink will be able to have its WakeLock creation use the appropriate context_id without knowing.
 
Cc: tsteiner@google.com
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/54c31f5d8c3dbe963162d750c0b09d9669027ef7

commit 54c31f5d8c3dbe963162d750c0b09d9669027ef7
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Sun Dec 09 02:52:54 2018

WakeLock: add Blink service to be able to use WakeLock with context.

The WakeLock service requires a context ID that can only be known
in the context of a RenderFrameHost which means that Blink can only
use the reduced version of the service that has no context id. The
new Blink service is a wrapper around the //services/device-level
interface and exist at a Frame level. It will allow Blink to connect
to the WakeLock service with the right context without having to get
the context ID from the //content layer.

This is following the same pattern as the Geolocation service.

Bug:  903831 
Change-Id: I17b268e404d7509ee3cc2c6503041a5216861a67
Reviewed-on: https://chromium-review.googlesource.com/c/1359921
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614988}
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/browser/BUILD.gn
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/browser/frame_host/render_frame_host_impl.cc
[add] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/browser/wake_lock/wake_lock_service_impl.cc
[add] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/browser/wake_lock/wake_lock_service_impl.h
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/public/android/BUILD.gn
[add] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/public/android/javatests/src/org/chromium/content/browser/WakeLockTest.java
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/public/app/mojo/content_browser_manifest.json
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/content/public/app/mojo/content_renderer_manifest.json
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/public/mojom/BUILD.gn
[add] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/public/mojom/wake_lock/OWNERS
[add] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/public/mojom/wake_lock/wake_lock.mojom
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/renderer/modules/wake_lock/DEPS
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/renderer/modules/wake_lock/wake_lock.cc
[modify] https://crrev.com/54c31f5d8c3dbe963162d750c0b09d9669027ef7/third_party/blink/renderer/modules/wake_lock/wake_lock.h

Status: Fixed (was: Started)
Thanks, Mounir! I appreciate following the approach taken by geolocation.

Sign in to add a comment