New issue
Advanced search Search tips

Issue 671407 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature



Sign in to add a comment

Add a way to list extensions currently using chrome.power API

Project Member Reported by derat@chromium.org, Dec 5 2016

Issue description

We sometimes see apps or extensions hold on to requests created via the chrome.power API for longer than they intend, resulting in the system not suspending or keeping its display on. For example, see  http://crbug.com/569981 , where the Chrome OS video player hangs onto its request after a playing video is closed.

To debug these situations, it'd be handy to be able to see which extensions are currently holding locks. When Chrome passes an updated power management policy to powerd on Chrome OS, it attaches a human-readable "reason" string, which powerd logs. Right now, it just includes "extension" in the list if chrome.power is being used, but maybe we could also list the IDs of all extensions using the API.

I'm not sure if there are PII concerns around logging extension IDs in powerd's log file. It's readable by any user on the system, so one user could look at it to see which extensions another user has installed.

Alternately, we could also display this somewhere within Chrome. It could be included at chrome://system, for instance. It'd be handy to also include it in feedback reports if possible.
 

Comment 1 by derat@chromium.org, Mar 18 2017

Status: Started (was: Assigned)

Comment 2 by derat@chromium.org, Mar 18 2017

Labels: -OS-Linux OS-All
Cc: afakhry@chromium.org yitingc@chromium.org battre@chromium.org
I saw your CL and it looks good, but sending new data with feedback reports must be reviewed first to make sure there are no privacy concerns. Adding some people here to give their thoughts.

Can you please provide them with example data that will be sent?

Comment 4 by derat@chromium.org, Mar 18 2017

Sure. It iterates over all profiles, and for all extensions currently using the chrome.power API[1] to keep the screen on or the system awake, it records output like the following:

  bijihlabcfdnabacffofojgmehjdielb: display,
  [some other ID]: system

This is likely to include IDs of extensions like the built-in Chrome OS video player or the Keep Awake extension[2].

We already log the names of all of the primary profile's enabled extensions, so this will generally be a subset of that information. (I'm not sure why we don't log the IDs instead, or include information from all profiles instead of just the primary one.)

The change is at https://codereview.chromium.org/2757083002/.

1. https://developer.chrome.com/apps/power
2. http://go/keepawake
Components: Privacy
Is this in user feedback report? If not, where is this data added?
If in user feedback report, can user preview it?

Comment 7 by derat@chromium.org, Mar 20 2017

Yes, it's included in feedback reports. The user can preview it by clicking the "system and app information" link (the same as all other feedback information, I believe).
Screenshot 2017-03-20 at 08.39.09.png
233 KB View Download
Screenshot 2017-03-20 at 08.39.34.png
213 KB View Download
This is fine for now. There is another request to review all the current data we are collecting to know if there is any data that hasn't been useful and can be trimmed.
Project Member

Comment 9 by bugdroid1@chromium.org, Mar 23 2017

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

commit 98f6a110bb8ea49b542a02f6c1d8776f80634fca
Author: derat <derat@chromium.org>
Date: Thu Mar 23 20:41:46 2017

feedback: List extensions using the chrome.power API.

Make chrome://system include a new "chrome.power extensions"
entry listing the IDs and levels ("display" or "system") of
extensions that are using the chrome.power API to override
power management.

BUG= 671407 

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

[modify] https://crrev.com/98f6a110bb8ea49b542a02f6c1d8776f80634fca/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
[modify] https://crrev.com/98f6a110bb8ea49b542a02f6c1d8776f80634fca/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h
[modify] https://crrev.com/98f6a110bb8ea49b542a02f6c1d8776f80634fca/extensions/browser/api/power/power_api.h

Comment 10 by derat@chromium.org, Mar 23 2017

Status: Fixed (was: Started)

Sign in to add a comment