New issue
Advanced search Search tips

Issue 647247 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocked on:
issue 689391

Blocking:
issue 612328
issue 729686



Sign in to add a comment

Content Modularization Project: Power Monitor

Project Member Reported by blundell@chromium.org, Sep 15 2016

Issue description

Tracking bug for the power monitor part of the Content Modularization Project. The end goal should be to have a self-contained power monitor service. As part of getting rid (or greatly reducing) content/, this code should move out of content/ to device/power_monitor.

Start by looking at power_monitor_messages.h and where that file is used.
 
Cc: leon....@intel.com
I developed a design doc for this:

https://docs.google.com/document/d/1w95Cwmxn-xVmICf1Q7YQvJy4eoInpmMntsLycB5qq5k/ and got LGTM from {jam, bajones} on it.

Han Leon, is this a project that you would be interested in tackling after decoupling time zone monitoring?

Comment 2 by leon....@intel.com, Sep 20 2016

Cc: -leon....@intel.com
Owner: leon....@intel.com
Yeah, I'm glad to do this. Thanks for the design. Will start after time zone monitoring.
bajones@: What are good ways to test this feature? Is it possible to test on Linux desktop, or does it have to be on Android or on a laptop to meaningfully test?
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 27 2016

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

commit 19b5e6a89dcadde523d674878434e7948f387e0d
Author: ke.he <ke.he@intel.com>
Date: Thu Oct 27 08:47:09 2016

Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process

Mojoify PoweMonitorMessageBroadcaster is the first step of "Decoupling Power
Monitor from //Content".

PowerMonitorMessageBroadcaster sends messages to both RenderProcess and other
ChildProcess. This CL Mojoifies the messages PowerMonitorMsg_PowerStateChange,
PowerMonitorMsg_Suspend, and PowerMonitorMsg_Resume. To do so we introduce the
PowerMonitorClient Mojo interface and change the PowerMonitorBroadcastSource to
implement the interface.

To avoid configure PowerMonitorClientPtr separately in {child,render}_process_
host_impl.cc, we add the PowerMonitor mojo interface, and add the
BrowserChildProcessHost::ConnectionFilterImpl so it can register the mojo
interface implementation in BrowserChildProcessHostImpl side.

Unit tests for PowerMonitorMessageBroadcaster and PowerMonitorBroadcastSource
are changed accordingly.

Followup will decouple PowerMonitorMessageBroadcaster and
PowerMonitorBroadcastSource from //Content.

BUG= 647247 

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

[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/AUTHORS
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/DEPS
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/browser_child_process_host_impl.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/browser_child_process_host_impl.h
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/power_monitor_message_broadcaster.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/power_monitor_message_broadcaster.h
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/power_monitor_message_broadcaster_unittest.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/browser/renderer_host/render_process_host_impl.h
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/child/DEPS
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/child/child_thread_impl.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/child/power_monitor_broadcast_source.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/child/power_monitor_broadcast_source.h
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/child/power_monitor_broadcast_source_unittest.cc
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/common/BUILD.gn
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/common/content_message_generator.h
[delete] https://crrev.com/a22f28c26d5d28ec271c47d2968a000e75cd5222/content/common/power_monitor_messages.h
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/public/app/mojo/content_browser_manifest.json
[modify] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/content/test/BUILD.gn
[add] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/device/power_monitor/public/interfaces/BUILD.gn
[add] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/device/power_monitor/public/interfaces/OWNERS
[add] https://crrev.com/19b5e6a89dcadde523d674878434e7948f387e0d/device/power_monitor/public/interfaces/power_monitor.mojom

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 7 2016

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

commit bf45805b20e15b30b0cecad0b9056136fb6d2849
Author: ke.he <ke.he@intel.com>
Date: Mon Nov 07 07:41:14 2016

Decouple PowerUsageMonitor{Impl} from //content/browser

PowerUsageMonitor is currently only used by Chrome and has significant //content
dependencies, to decouple it we just move it to //chrome/browser at the current
time.
The power_usage_monitor.h is deleted as there is no need to export the
StartPowerUsageMonitor interface from chrome any more. We add the
PowerUsageMonitor as a member into the ChromeBrowserMain.
Unittest are also changed accordingly.

BUG= 647247 

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

[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/BUILD.gn
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/DEPS
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/chrome_browser_main.cc
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/chrome_browser_main.h
[rename] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/power_usage_monitor/power_usage_monitor.cc
[rename] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/power_usage_monitor/power_usage_monitor.h
[rename] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/browser/power_usage_monitor/power_usage_monitor_unittest.cc
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/chrome/test/BUILD.gn
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/content/browser/BUILD.gn
[delete] https://crrev.com/1fd7aa22fbb7519afbc3f21a7d2ca0bcd2403d2f/content/public/browser/power_usage_monitor.h
[modify] https://crrev.com/bf45805b20e15b30b0cecad0b9056136fb6d2849/content/test/BUILD.gn

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 11 2016

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

commit bef9909734ebaa1fd830652cc11c68528fb3d06e
Author: ke.he <ke.he@intel.com>
Date: Fri Nov 11 07:47:02 2016

Decouple Power Monitor from //content.

Move power monitor implmentations from //content into //device/power_monitor
Unittests are also moved from content_unittests target to device_unittests.

BUG= 647247 

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

[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/browser/BUILD.gn
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/browser/browser_child_process_host_impl.cc
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/browser/browser_child_process_host_impl.h
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/child/BUILD.gn
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/child/child_thread_impl.cc
[delete] https://crrev.com/1137d16544665bb926542a25c986f0750433caa3/content/child/power_monitor_broadcast_source.h
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/content/test/BUILD.gn
[modify] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/BUILD.gn
[add] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/BUILD.gn
[add] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/OWNERS
[add] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/power_monitor_export.h
[rename] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/power_monitor_message_broadcaster.cc
[rename] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/power_monitor_message_broadcaster.h
[rename] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/power_monitor_message_broadcaster_unittest.cc
[add] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/public/cpp/BUILD.gn
[rename] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/public/cpp/power_monitor_broadcast_source.cc
[add] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/public/cpp/power_monitor_broadcast_source.h
[rename] https://crrev.com/bef9909734ebaa1fd830652cc11c68528fb3d06e/device/power_monitor/public/cpp/power_monitor_broadcast_source_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Dec 12 2016

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

commit 7256d7f270a7b3a7a64636bb9e9cbcf0a5fcd484
Author: ke.he <ke.he@intel.com>
Date: Mon Dec 12 13:27:00 2016

Remove unnecessary "export" in PowerMonitorBroadcastSource

No need to export PowerMonitorBroadcastSource.

BUG =  647247 

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

[modify] https://crrev.com/7256d7f270a7b3a7a64636bb9e9cbcf0a5fcd484/device/power_monitor/public/cpp/BUILD.gn
[modify] https://crrev.com/7256d7f270a7b3a7a64636bb9e9cbcf0a5fcd484/device/power_monitor/public/cpp/power_monitor_broadcast_source.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jan 10 2017

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

commit 918f72f14f7840b8e40c2b0ca5f95817f691ebd6
Author: leon.han <leon.han@intel.com>
Date: Tue Jan 10 10:43:13 2017

[Device Service] Move PowerMonitor into the Device Service

This CL
  - configures Device Service to be singleton service.
  - lets content::ServiceManagerContext initiate a connection to Device,
    Service to create the singleton instance which will serve all clients.
  - moves PowerMonitor to being hosted by the Device Service.

BUG= 647247 

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

[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/BUILD.gn
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/DEPS
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/browser_child_process_host_impl.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/browser_context.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/browser/service_manager/service_manager_context.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/child/BUILD.gn
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/child/DEPS
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/child/child_thread_impl.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/public/app/mojo/content_browser_manifest.json
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/public/app/mojo/content_gpu_manifest.json
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/public/app/mojo/content_plugin_manifest.json
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/public/app/mojo/content_renderer_manifest.json
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/content/public/app/mojo/content_utility_manifest.json
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/services/device/BUILD.gn
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/services/device/device_service.cc
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/services/device/device_service.h
[modify] https://crrev.com/918f72f14f7840b8e40c2b0ca5f95817f691ebd6/services/device/manifest.json

Labels: DeviceService
Blockedon: 689391

Comment 11 by leon....@intel.com, Feb 14 2017

Status: Fixed (was: Available)
r427965 "Mojoify PoweMonitorMessageBroadcaster IPC from browser to child process" likely is the cause of new  issue 696197  "Renderer process no longer adapts to notebook ac->battery change" (on Windows)?

Comment 13 by kbr@chromium.org, Jun 15 2017

Blocking: 729686
Components: Internals>Services>Device
Labels: Type-Task
Migrating S13N meta bugs to Type=Task, so that they can be distinguished from technical work.

Sign in to add a comment