Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(477)

Issue 270153004: Introduce ActiveScriptController; track active extension scripts (Closed)

Created:
6 years, 7 months ago by Devlin
Modified:
6 years, 7 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org
Visibility:
Public.

Description

Introduce ActiveScriptController, track active extension scripts. ActiveScriptController tracks all running active scripts (content scripts and scripts injected via tabs.executeScript), and, if the flag is enabled, ensures an ExtensionAction is displayed in the location bar. Next step: Require permission before executing scripts. TBR=sky@chromium.org (mechanical, no-impact changes to c/b/ui) BUG=362353 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=269681

Patch Set 1 : #

Patch Set 2 : UMA #

Total comments: 45

Patch Set 3 : Kalman's #

Total comments: 42

Patch Set 4 : #

Total comments: 16

Patch Set 5 : #

Total comments: 7

Patch Set 6 : nits + non-preventable metric #

Patch Set 7 : Check tab helper in script executor #

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+777 lines, -178 lines) Patch
A chrome/browser/extensions/active_script_controller.h View 1 2 3 4 5 1 chunk +88 lines, -0 lines 0 comments Download
A chrome/browser/extensions/active_script_controller.cc View 1 2 3 4 5 1 chunk +131 lines, -0 lines 0 comments Download
A chrome/browser/extensions/active_script_controller_browsertest.cc View 1 2 3 4 5 1 chunk +141 lines, -0 lines 0 comments Download
M chrome/browser/extensions/activity_log/uma_policy.h View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/extensions/activity_log/uma_policy.cc View 1 2 3 4 5 6 7 5 chunks +37 lines, -15 lines 0 comments Download
M chrome/browser/extensions/activity_log/uma_policy_unittest.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/extensions/api/extension_action/extension_action_api.cc View 1 2 3 4 5 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/extensions/location_bar_controller.h View 1 2 3 1 chunk +62 lines, -15 lines 0 comments Download
A chrome/browser/extensions/location_bar_controller.cc View 1 2 3 4 1 chunk +88 lines, -0 lines 0 comments Download
M chrome/browser/extensions/page_action_controller.h View 1 2 3 1 chunk +17 lines, -20 lines 0 comments Download
M chrome/browser/extensions/page_action_controller.cc View 1 2 3 4 2 chunks +45 lines, -88 lines 0 comments Download
M chrome/browser/extensions/script_executor.cc View 1 2 3 4 5 6 2 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/extensions/tab_helper.cc View 1 2 3 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/views/location_bar/page_action_image_view.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 7 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A + chrome/test/data/extensions/active_script/content_scripts_all_hosts/content_script.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/extensions/active_script/content_scripts_all_hosts/manifest.json View 1 chunk +12 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/active_script/content_scripts_explicit_hosts/content_script.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/extensions/active_script/content_scripts_explicit_hosts/manifest.json View 1 chunk +12 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/active_script/inject_scripts_all_hosts/background.js View 1 1 chunk +4 lines, -4 lines 0 comments Download
A chrome/test/data/extensions/active_script/inject_scripts_all_hosts/manifest.json View 1 chunk +12 lines, -0 lines 0 comments Download
M extensions/common/extension_messages.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/common/feature_switch.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/feature_switch.cc View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M extensions/common/permissions/permissions_data.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/common/permissions/permissions_data.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M extensions/common/switches.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/switches.cc View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M extensions/renderer/user_script_slave.cc View 1 2 4 5 4 chunks +17 lines, -7 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 3 chunks +42 lines, -8 lines 0 comments Download

Messages

Total messages: 35 (0 generated)
Devlin
6 years, 7 months ago (2014-05-07 20:09:35 UTC) #1
not at google - send to devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc#newcode36 chrome/browser/extensions/active_script_controller.cc:36: enabled_(FeatureSwitch::active_script_enforcement()->IsEnabled()) { if it's not enabled then just don't ...
6 years, 7 months ago (2014-05-07 22:49:02 UTC) #2
not at google - send to devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc#newcode88 chrome/browser/extensions/active_script_controller.cc:88: extensions_executing_scripts_.clear(); also need to make sure not to clear ...
6 years, 7 months ago (2014-05-07 23:27:51 UTC) #3
not at google - send to devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/location_bar_controller.h File chrome/browser/extensions/location_bar_controller.h (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/location_bar_controller.h#newcode43 chrome/browser/extensions/location_bar_controller.h:43: virtual ~LocationBarController(); no longer virtual
6 years, 7 months ago (2014-05-07 23:30:37 UTC) #4
Devlin
Per offline discussion: - Keep LocationBarController[Provider] object model/ownership graph. - Move lots of the logic ...
6 years, 7 months ago (2014-05-08 00:02:54 UTC) #5
Devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/active_script_controller.cc#newcode36 chrome/browser/extensions/active_script_controller.cc:36: enabled_(FeatureSwitch::active_script_enforcement()->IsEnabled()) { On 2014/05/07 22:49:02, kalman wrote: > if ...
6 years, 7 months ago (2014-05-08 18:15:46 UTC) #6
not at google - send to devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/activity_log/uma_policy.h File chrome/browser/extensions/activity_log/uma_policy.h (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/activity_log/uma_policy.h#newcode104 chrome/browser/extensions/activity_log/uma_policy.h:104: content::WebContents* web_contents); On 2014/05/08 18:15:46, D Cronin wrote: > ...
6 years, 7 months ago (2014-05-08 20:47:08 UTC) #7
Devlin
https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/activity_log/uma_policy.h File chrome/browser/extensions/activity_log/uma_policy.h (right): https://codereview.chromium.org/270153004/diff/40001/chrome/browser/extensions/activity_log/uma_policy.h#newcode104 chrome/browser/extensions/activity_log/uma_policy.h:104: content::WebContents* web_contents); On 2014/05/08 20:47:09, kalman wrote: > On ...
6 years, 7 months ago (2014-05-08 23:00:59 UTC) #8
not at google - send to devlin
lgtm https://codereview.chromium.org/270153004/diff/70001/extensions/common/permissions/permissions_data.h File extensions/common/permissions/permissions_data.h (right): https://codereview.chromium.org/270153004/diff/70001/extensions/common/permissions/permissions_data.h#newcode181 extensions/common/permissions/permissions_data.h:181: // |extension| is running a script. On 2014/05/08 ...
6 years, 7 months ago (2014-05-08 23:33:19 UTC) #9
Devlin
https://codereview.chromium.org/270153004/diff/90001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/90001/chrome/browser/extensions/active_script_controller.cc#newcode36 chrome/browser/extensions/active_script_controller.cc:36: web_contents_(web_contents), On 2014/05/08 23:33:19, kalman wrote: > WebContentsObserver has ...
6 years, 7 months ago (2014-05-09 00:15:32 UTC) #10
Devlin
+jschuh@ - extension_messages.h +isherman@ - histograms.xml
6 years, 7 months ago (2014-05-09 00:17:06 UTC) #11
not at google - send to devlin
https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc#newcode127 chrome/browser/extensions/active_script_controller.cc:127: } easier: size_t num_preventable_ad_injectors = STLSetIntersection( ad_injectors_, extensions_executing_scripts_).size(); https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc#newcode131 ...
6 years, 7 months ago (2014-05-09 00:22:58 UTC) #12
Ilya Sherman
histograms.xml LGTM https://codereview.chromium.org/270153004/diff/110001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/270153004/diff/110001/tools/metrics/histograms/histograms.xml#newcode5735 tools/metrics/histograms/histograms.xml:5735: + ActivityLog metrics, ExtensionActivity.Ad*. Please document when ...
6 years, 7 months ago (2014-05-09 21:47:17 UTC) #13
jschuh
ipc security lgtm (notes: extension id tracking string, validated by receiving process)
6 years, 7 months ago (2014-05-09 22:04:49 UTC) #14
Ilya Sherman
https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc#newcode131 chrome/browser/extensions/active_script_controller.cc:131: num_preventable_ad_injectors); On 2014/05/09 00:22:59, kalman wrote: > maybe it ...
6 years, 7 months ago (2014-05-09 22:08:43 UTC) #15
Devlin
https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc File chrome/browser/extensions/active_script_controller.cc (right): https://codereview.chromium.org/270153004/diff/110001/chrome/browser/extensions/active_script_controller.cc#newcode127 chrome/browser/extensions/active_script_controller.cc:127: } On 2014/05/09 00:22:59, kalman wrote: > easier: > ...
6 years, 7 months ago (2014-05-09 22:23:28 UTC) #16
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 7 months ago (2014-05-09 22:23:37 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/270153004/130001
6 years, 7 months ago (2014-05-09 22:25:09 UTC) #18
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 7 months ago (2014-05-10 01:05:56 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/270153004/150001
6 years, 7 months ago (2014-05-10 01:08:43 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-10 02:45:32 UTC) #21
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-10 02:52:28 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/66973)
6 years, 7 months ago (2014-05-10 02:52:28 UTC) #23
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 7 months ago (2014-05-10 03:24:04 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/270153004/150001
6 years, 7 months ago (2014-05-10 03:25:08 UTC) #25
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-10 04:34:47 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-10 04:41:37 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/66991)
6 years, 7 months ago (2014-05-10 04:41:37 UTC) #28
not at google - send to devlin
The CQ bit was checked by kalman@chromium.org
6 years, 7 months ago (2014-05-10 14:14:49 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/270153004/150001
6 years, 7 months ago (2014-05-10 14:15:29 UTC) #30
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-10 17:57:39 UTC) #31
Devlin
The CQ bit was unchecked by rdevlin.cronin@chromium.org
6 years, 7 months ago (2014-05-10 18:25:27 UTC) #32
Devlin
The CQ bit was checked by rdevlin.cronin@chromium.org
6 years, 7 months ago (2014-05-10 18:58:00 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rdevlin.cronin@chromium.org/270153004/160001
6 years, 7 months ago (2014-05-10 18:58:57 UTC) #34
commit-bot: I haz the power
6 years, 7 months ago (2014-05-11 01:40:05 UTC) #35
Message was sent while issue was closed.
Change committed as 269681

Powered by Google App Engine
This is Rietveld 408576698