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

Issue 689410 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug


Sign in to add a comment

Convert browser process clients of PowerSaveBlocker to use WakeLock Mojo service

Project Member Reported by blundell@chromium.org, Feb 7 2017

Issue description

Wake Lock is a Mojo interface that wraps PowerSaveBlocker. As part of the creation of standalone Device Service, all browser-side clients of PowerSaveBlocker should be converted to be clients of the Wake Lock Mojo interface instead. The usage pattern is essentially identical, so the conversions should be relatively straightforward.
 
Status: Available (was: Untriaged)
Blockedon: 689413
Blockedon: 689415
Blockedon: 689416
Blockedon: 689420
Blockedon: 689421
Blockedon: 689423
Blocking: 689429

Comment 9 by ke...@intel.com, Feb 28 2017

Cc: blundell@chromium.org
WakeLock always set type as "device::PowerSaveBlocker::kPowerSaveBlockPreventDisplaySleep" when creating PowerSaveBlocker, while in component/drive/drive_uploader.cc for example, it set type as "device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension".
So I guess we need to make some change in the interface of Wakelock.mojom to let its user pass the type?
Yes, that is correct....WakeLock needs to be generalized to support the use cases of all the browser process clients.

Comment 11 by dougt@chromium.org, Apr 11 2017

Components: Blink>WakeLock
Project Member

Comment 12 by bugdroid1@chromium.org, May 9 2017

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

commit 98b761e7e4ffdfa7344bd3de7e3203d2bec235f0
Author: ke.he <ke.he@intel.com>
Date: Tue May 09 05:59:17 2017

Move ownership of PowerSaveBlocker from WakeLockServiceContext to WakeLockServiceImpl

This is the first step of "Allowing WakeLock to Serve Browser Process Clients"
Design doc by blundell@chromium.org:
https://docs.google.com/document/d/1AEmiwtEj1nfTCmqSneht0xad2k3huxZQsIRHvVz0S8c

In this CL:

1) Move ownership of PowerSaveBlocker from WakeLockServiceContext to
   WakeLockServiceImpl.
2) Refactor WakeLockServiceImpl, one WakeLockServiceImpl supports managing
   multiple client bindings.
3) Make WebContentsImpl coalesce multiple client requests into one
   WakeLockServiceImpl.

The concrete motivation for this move is to make it trivial to implement a
generalization of the GetWakeLock() API that passes in the parameters for the
PowerSaveBlocker (needed by browser process clients). That interface extension
would be complex to implement in the current architecture, which is multiplexing
one PowerSaveBlocker for multiple WakeLockServiceImpl instances.

BUG= 689410 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://codereview.chromium.org/2843353003
Cr-Commit-Position: refs/heads/master@{#470241}

[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/frame_host/render_frame_host_delegate.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/frame_host/render_frame_host_delegate.h
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/frame_host/render_frame_host_impl.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/wake_lock/wake_lock_browsertest.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/browser/web_contents/web_contents_impl.h
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/public/browser/BUILD.gn
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/public/browser/DEPS
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/content/public/browser/web_contents.h
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/DEPS
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/public/interfaces/wake_lock_context.mojom
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/public/interfaces/wake_lock_service.mojom
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/wake_lock_context_provider.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/wake_lock_service_context.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/wake_lock_service_context.h
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/wake_lock_service_impl.cc
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/device/wake_lock/wake_lock_service_impl.h
[modify] https://crrev.com/98b761e7e4ffdfa7344bd3de7e3203d2bec235f0/third_party/WebKit/Source/web/tests/ScreenWakeLockTest.cpp

Project Member

Comment 13 by bugdroid1@chromium.org, May 10 2017

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

commit fcd5fefabd15ceeddbfe313e6482fe000dddaf37
Author: ke.he <ke.he@intel.com>
Date: Wed May 10 12:47:46 2017

Fix nits after refactoring WakeLockServiceImpl.

BUG= 689410 

Review-Url: https://codereview.chromium.org/2866243002
Cr-Commit-Position: refs/heads/master@{#470542}

[modify] https://crrev.com/fcd5fefabd15ceeddbfe313e6482fe000dddaf37/device/wake_lock/wake_lock_service_impl.cc

Project Member

Comment 14 by bugdroid1@chromium.org, May 11 2017

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

commit f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4
Author: ke.he <ke.he@intel.com>
Date: Thu May 11 04:09:10 2017

Generalize the API of WakeLockContext mojo interface.

Generalize the API of WakeLockContext mojo interface, so client can pass
type, reason and description as they want to create the WakeLockService.

BUG= 689410 

Review-Url: https://codereview.chromium.org/2867303003
Cr-Commit-Position: refs/heads/master@{#470801}

[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/content/browser/wake_lock/wake_lock_context_host.cc
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/power_save_blocker/BUILD.gn
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/public/interfaces/wake_lock_context.mojom
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/public/interfaces/wake_lock_context_provider.mojom
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_context_provider.cc
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_context_provider.h
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_service_context.cc
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_service_context.h
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_service_impl.cc
[modify] https://crrev.com/f435c1e84c2fb1cdfe7b68739cfd05ff8c49dee4/device/wake_lock/wake_lock_service_impl.h

Project Member

Comment 15 by bugdroid1@chromium.org, May 14 2017

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

commit 2d8b867dfc360643d87634931521e9c5a39594fc
Author: ke.he <ke.he@intel.com>
Date: Sun May 14 12:09:42 2017

Add GetWakeLockWithoutContext() in WakeLockContextProvider mojo interface.

1) Add GetWakeLockWithoutContext in WakeLockContextProvider.
2) Rename WakeLockContextProvider to WakeLockProvider as it provides both WakeLockService and WakeLockContext.
3) Convert download_request_core to be client of wakelock.

BUG= 689410 
TBR=jam@chromium.org, for mechanical changes in //content/browser/wake_lock/wake_lock_context_host{.h|.cc}

Review-Url: https://codereview.chromium.org/2874013002
Cr-Commit-Position: refs/heads/master@{#471629}

[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/content/browser/download/download_request_core.cc
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/content/browser/download/download_request_core.h
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/content/browser/wake_lock/wake_lock_context_host.cc
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/content/browser/wake_lock/wake_lock_context_host.h
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/BUILD.gn
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/public/interfaces/BUILD.gn
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/public/interfaces/README.md
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/public/interfaces/wake_lock_context.mojom
[delete] https://crrev.com/064e1830e9ed3d48d6342b26fcfd4335d6e09bfb/device/wake_lock/public/interfaces/wake_lock_context_provider.mojom
[add] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/public/interfaces/wake_lock_provider.mojom
[delete] https://crrev.com/064e1830e9ed3d48d6342b26fcfd4335d6e09bfb/device/wake_lock/wake_lock_context_provider.cc
[delete] https://crrev.com/064e1830e9ed3d48d6342b26fcfd4335d6e09bfb/device/wake_lock/wake_lock_context_provider.h
[add] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/wake_lock_provider.cc
[add] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/wake_lock_provider.h
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/wake_lock_service_context.cc
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/wake_lock_service_context.h
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/device/wake_lock/wake_lock_service_impl.cc
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/services/device/device_service.cc
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/services/device/device_service.h
[modify] https://crrev.com/2d8b867dfc360643d87634931521e9c5a39594fc/services/device/manifest.json

Project Member

Comment 16 by bugdroid1@chromium.org, May 18 2017

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

commit a58f2e80c253a8586f789c6bfc77432015e47e40
Author: ke.he <ke.he@intel.com>
Date: Thu May 18 04:16:56 2017

Remove unnecessary powersaveblocker in download_browsertests.cc

BUG= 689410 

Review-Url: https://codereview.chromium.org/2889533002
Cr-Commit-Position: refs/heads/master@{#472657}

[modify] https://crrev.com/a58f2e80c253a8586f789c6bfc77432015e47e40/content/browser/download/download_browsertest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, May 18 2017

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

commit bfff87457dc144fb7cc3d3a34d6c21c43369f867
Author: ke.he <ke.he@intel.com>
Date: Thu May 18 23:30:24 2017

Convert clients of PowerSaveBlocker to be clients of WakeLock mojo service.

Wake Lock is a Mojo interface that wraps PowerSaveBlocker, As part of the
creation of standalone Device Service, all browser-side clients of
PowerSaveBlocker should be converted to be clients of WakeLock mojo interface
instead.

This CL converts clients of PowerSaveBlocker in //content/browser/media/

BUG= 689410 

Review-Url: https://codereview.chromium.org/2881143003
Cr-Commit-Position: refs/heads/master@{#472967}

[modify] https://crrev.com/bfff87457dc144fb7cc3d3a34d6c21c43369f867/content/browser/media/capture/aura_window_capture_machine.cc
[modify] https://crrev.com/bfff87457dc144fb7cc3d3a34d6c21c43369f867/content/browser/media/capture/aura_window_capture_machine.h
[modify] https://crrev.com/bfff87457dc144fb7cc3d3a34d6c21c43369f867/content/browser/media/capture/desktop_capture_device.cc

Project Member

Comment 18 by bugdroid1@chromium.org, May 19 2017

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

commit 2334c53d452d01b8ce2f5b40b94eca119c424234
Author: ke.he <ke.he@intel.com>
Date: Fri May 19 02:17:21 2017

Use wakelock mojo interface instead of PowerSaveBlocker in renderer_host.

Wake Lock is a Mojo interface that wraps PowerSaveBlocker, As part of the
creation of standalone Device Service, all browser-side clients of
PowerSaveBlocker should be converted to be clients of WakeLock mojo interface
instead.

This CL converts clients of PowerSaveBlocker in //content/browser/renderer_host/

BUG= 689410 

Review-Url: https://codereview.chromium.org/2893773003
Cr-Commit-Position: refs/heads/master@{#473034}

[modify] https://crrev.com/2334c53d452d01b8ce2f5b40b94eca119c424234/content/browser/renderer_host/render_widget_host_impl.cc
[modify] https://crrev.com/2334c53d452d01b8ce2f5b40b94eca119c424234/content/browser/renderer_host/render_widget_host_impl.h

Project Member

Comment 19 by bugdroid1@chromium.org, May 19 2017

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

commit 91eabe25b470e6b042b78a333f4bbc62900d2916
Author: ke.he <ke.he@intel.com>
Date: Fri May 19 04:02:11 2017

Convert PowerSaveBlockResourceThrottle to be client of WakeLock mojo service.

Wake Lock is a Mojo interface that wraps PowerSaveBlocker. As part of the
creation of standalone Device Service, all browser-side clients of
PowerSaveBlocker should be converted to be clients of the Wake Lock Mojo
interface instead.

BUG= 689410 
TBR=jam@chromium.org, for mechanical changes to //content/browser/BUILD.gn

Review-Url: https://codereview.chromium.org/2893873002
Cr-Commit-Position: refs/heads/master@{#473076}

[modify] https://crrev.com/91eabe25b470e6b042b78a333f4bbc62900d2916/content/browser/BUILD.gn
[modify] https://crrev.com/91eabe25b470e6b042b78a333f4bbc62900d2916/content/browser/loader/DEPS
[delete] https://crrev.com/de85aa9a225e731e84cc0837767c5c88bfead6c1/content/browser/loader/power_save_block_resource_throttle.cc
[delete] https://crrev.com/de85aa9a225e731e84cc0837767c5c88bfead6c1/content/browser/loader/power_save_block_resource_throttle.h
[modify] https://crrev.com/91eabe25b470e6b042b78a333f4bbc62900d2916/content/browser/loader/resource_dispatcher_host_impl.cc
[add] https://crrev.com/91eabe25b470e6b042b78a333f4bbc62900d2916/content/browser/loader/wake_lock_resource_throttle.cc
[add] https://crrev.com/91eabe25b470e6b042b78a333f4bbc62900d2916/content/browser/loader/wake_lock_resource_throttle.h

Comment 20 by ke...@intel.com, May 19 2017

Oh, The landed CLs from comment 16 to comment 19 should be  issue689413 . I mistakenly used the wrong BUG ID, sorry :(

Comment 21 by leon....@intel.com, May 19 2017

Owner: ke...@intel.com
Status: Started (was: Available)
Project Member

Comment 22 by bugdroid1@chromium.org, Jun 6 2017

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

commit 4d8a87f26e4b1027bd9281e4006506ab0f983732
Author: ke.he <ke.he@intel.com>
Date: Tue Jun 06 05:32:32 2017

Add service unittest for WakeLockServiceImpl.

To avoid let service unittest depend on "xvfb", we use the
FakeWakeLockServiceImpl which doesn't create the real
PowerSaveBlocker instance during testing.

BUG= 689410 

Review-Url: https://codereview.chromium.org/2883903002
Cr-Commit-Position: refs/heads/master@{#477200}

[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/BUILD.gn
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_provider.cc
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_provider.h
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_service_impl.cc
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_service_impl.h
[add] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_service_impl_for_testing.cc
[add] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/device/wake_lock/wake_lock_service_impl_for_testing.h
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/services/device/BUILD.gn
[modify] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/services/device/unittest_manifest.json
[add] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/services/device/wake_lock/OWNERS
[add] https://crrev.com/4d8a87f26e4b1027bd9281e4006506ab0f983732/services/device/wake_lock/wake_lock_service_impl_unittest.cc

Comment 23 by ke...@intel.com, Jun 8 2017

Blockedon: 730952

Comment 24 by ke...@intel.com, Jul 7 2017

Status: Fixed (was: Started)
Components: Internals>Services>Device

Sign in to add a comment