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

Issue 2077723002: [Extensions] Short-circuit activity logging if not enabled (Closed)

Created:
4 years, 6 months ago by Devlin
Modified:
4 years, 6 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, felt, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extensions] Short-circuit activity logging if not enabled In order to log activity events in extensions, we need to copy all the arguments that were passed to the method or event. In some cases (such as messaging), this can be an extreme amount of work. Additionally, this can require passing objects from the IO to UI thread. In an extreme case, we would also create copies of arguments sent via the activityLog API itself - meaning that for any given API call, we created two extra copies of all arguments (one for the activity log itself, and another for the record of the activityLog event dispatch). In some cases, this activity logging resulted in more work than the API call itself. Instead, store state around which profiles have an actively-recording ActivityLog and which extensions are whitelisted in a thread-safe manner so that we can short-circuit the logging in most cases, and avoid creating excessive copies for the 99% case. BUG=620359 Committed: https://crrev.com/a84983c58d89dbb83fc97eb24ad70f5780375dd9 Cr-Commit-Position: refs/heads/master@{#401162}

Patch Set 1 : webrequest #

Total comments: 2

Patch Set 2 : Antony's #

Patch Set 3 : Add Test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+508 lines, -301 lines) Patch
M chrome/browser/extensions/activity_log/activity_log.h View 6 chunks +20 lines, -14 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log.cc View 13 chunks +255 lines, -34 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log_browsertest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/activity_log/activity_log_unittest.cc View 1 2 5 chunks +38 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.h View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.h View 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/web_request/chrome_extension_web_request_event_router_delegate.cc View 2 chunks +1 line, -30 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/chrome_extensions_browser_client.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/renderer_host/chrome_extension_message_filter.h View 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/chrome_extension_message_filter.cc View 7 chunks +28 lines, -12 lines 0 comments Download
M extensions/browser/api/extensions_api_client.h View 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api/extensions_api_client.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.h View 1 chunk +0 lines, -8 lines 0 comments Download
M extensions/browser/api/web_request/web_request_api.cc View 5 chunks +10 lines, -39 lines 0 comments Download
M extensions/browser/api/web_request/web_request_event_router_delegate.h View 1 chunk +2 lines, -34 lines 0 comments Download
D extensions/browser/api/web_request/web_request_event_router_delegate.cc View 1 chunk +0 lines, -20 lines 0 comments Download
M extensions/browser/api_activity_monitor.h View 1 1 chunk +53 lines, -19 lines 0 comments Download
A extensions/browser/api_activity_monitor.cc View 1 1 chunk +74 lines, -0 lines 0 comments Download
M extensions/browser/event_router.cc View 2 chunks +4 lines, -17 lines 0 comments Download
M extensions/browser/extension_function_dispatcher.cc View 3 chunks +5 lines, -26 lines 0 comments Download
M extensions/browser/extensions_browser_client.h View 2 chunks +0 lines, -6 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.h View 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/browser/test_extensions_browser_client.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M extensions/extensions.gypi View 1 chunk +1 line, -1 line 0 comments Download
M extensions/shell/browser/shell_extensions_browser_client.h View 1 chunk +0 lines, -2 lines 0 comments Download
M extensions/shell/browser/shell_extensions_browser_client.cc View 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 18 (8 generated)
Devlin
Adrienne and Antony, mind taking a look?
4 years, 6 months ago (2016-06-17 20:14:25 UTC) #5
asargent_no_longer_on_chrome
lgtm https://codereview.chromium.org/2077723002/diff/40001/extensions/browser/api_activity_monitor.h File extensions/browser/api_activity_monitor.h (right): https://codereview.chromium.org/2077723002/diff/40001/extensions/browser/api_activity_monitor.h#newcode59 extensions/browser/api_activity_monitor.h:59: // Called when an extension uses the web ...
4 years, 6 months ago (2016-06-20 22:13:11 UTC) #6
Devlin
felt@, friendly ping? https://codereview.chromium.org/2077723002/diff/40001/extensions/browser/api_activity_monitor.h File extensions/browser/api_activity_monitor.h (right): https://codereview.chromium.org/2077723002/diff/40001/extensions/browser/api_activity_monitor.h#newcode59 extensions/browser/api_activity_monitor.h:59: // Called when an extension uses ...
4 years, 6 months ago (2016-06-21 17:07:52 UTC) #7
felt
lgtm, although I have to admit that it's been almost 4 years since I looked ...
4 years, 6 months ago (2016-06-21 17:21:49 UTC) #8
felt
did this CL drop the runtime flag check when calculating ShouldLog?
4 years, 6 months ago (2016-06-21 17:22:54 UTC) #9
Devlin
On 2016/06/21 17:21:49, felt wrote: > lgtm, although I have to admit that it's been ...
4 years, 6 months ago (2016-06-21 19:26:47 UTC) #10
Devlin
On 2016/06/21 19:26:47, Devlin wrote: > On 2016/06/21 17:21:49, felt wrote: > > lgtm, although ...
4 years, 6 months ago (2016-06-22 00:34:00 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2077723002/80001
4 years, 6 months ago (2016-06-22 00:35:08 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years, 6 months ago (2016-06-22 02:06:37 UTC) #16
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 02:09:13 UTC) #18
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a84983c58d89dbb83fc97eb24ad70f5780375dd9
Cr-Commit-Position: refs/heads/master@{#401162}

Powered by Google App Engine
This is Rietveld 408576698