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

Issue 2227193002: Make UserScript non-copyable. (Closed)

Created:
4 years, 4 months ago by lazyboy
Modified:
4 years, 4 months ago
Reviewers:
Devlin, David Tseng
CC:
chromium-reviews, extensions-reviews_chromium.org, oshima+watch_chromium.org, aboxhall+watch_chromium.org, jam, nektar+watch_chromium.org, yuzo+watch_chromium.org, je_julie, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, chromium-apps-reviews_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make UserScript non-copyable. The main purpose of this CL is to get rid of copying around script file contents (awful!). This should also improve content_scripts's performance, by a little bit at least. For places we must create a copy (e.g. creating a UserScript from manifest metadata), provide a UserScript::CopyMetadataFrom() method. This method does not copy files' contents within the UserScript. *UserScriptLoader is now responsible for owning the UserScript-s in the browser/ process. All such ownerships are done via unique_ptr-s. BUG=622464 Test=Refactoring only, no visible change should happen. Watch out for any extensions content_scripts related regression. Committed: https://crrev.com/12c77d78dd3626b4e91664cfebd293a54b3e6d81 Cr-Commit-Position: refs/heads/master@{#413223}

Patch Set 1 : sync #

Patch Set 2 : uplaod with base #

Total comments: 3

Patch Set 3 : rebase at branch #

Patch Set 4 : remove browser and renderer implementation of UserScript and remove templates. #

Patch Set 5 : remove browser/renderer specific file impl as it is not helping much #

Total comments: 44

Patch Set 6 : sync only #

Patch Set 7 : address comments from Devlin #

Total comments: 10

Patch Set 8 : fix compile #

Patch Set 9 : address comments #

Patch Set 10 : sync @tott #

Patch Set 11 : sync @tott #

Patch Set 12 : sync @tott #

Unified diffs Side-by-side diffs Delta from patch set Stats (+361 lines, -316 lines) Patch
M chrome/browser/chromeos/accessibility/accessibility_manager.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_action.h View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/extensions/api/declarative_content/content_action.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/extensions/convert_user_script_unittest.cc View 1 2 3 4 5 6 7 8 7 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/extensions/extension_service_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +18 lines, -19 lines 0 comments Download
M chrome/browser/extensions/extension_user_script_loader_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +11 lines, -9 lines 0 comments Download
M chrome/browser/extensions/shared_user_script_master.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/shared_user_script_master.cc View 1 2 3 4 5 6 7 8 2 chunks +12 lines, -10 lines 0 comments Download
M chrome/browser/extensions/user_script_listener.cc View 1 2 3 4 5 6 1 chunk +4 lines, -7 lines 0 comments Download
M chrome/common/extensions/manifest_handlers/content_scripts_handler.cc View 1 2 3 4 5 6 22 chunks +56 lines, -65 lines 0 comments Download
M chrome/common/extensions/manifest_handlers/content_scripts_manifest_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -2 lines 0 comments Download
M extensions/browser/api/guest_view/web_view/web_view_internal_api.cc View 1 2 3 4 5 6 7 8 7 chunks +53 lines, -46 lines 0 comments Download
M extensions/browser/declarative_user_script_master.h View 1 2 3 4 5 6 1 chunk +6 lines, -5 lines 0 comments Download
M extensions/browser/declarative_user_script_master.cc View 1 2 3 4 5 6 2 chunks +15 lines, -10 lines 0 comments Download
M extensions/browser/extension_user_script_loader.cc View 1 2 3 4 2 chunks +15 lines, -12 lines 0 comments Download
M extensions/browser/guest_view/web_view/web_view_content_script_manager.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/guest_view/web_view/web_view_content_script_manager.cc View 1 2 3 4 5 6 4 chunks +7 lines, -6 lines 0 comments Download
M extensions/browser/user_script_loader.h View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M extensions/browser/user_script_loader.cc View 1 2 3 4 5 6 5 chunks +25 lines, -23 lines 0 comments Download
M extensions/browser/web_ui_user_script_loader.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -5 lines 0 comments Download
M extensions/browser/web_ui_user_script_loader.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +23 lines, -15 lines 0 comments Download
M extensions/common/user_script.h View 1 2 3 4 5 6 7 8 7 chunks +13 lines, -9 lines 0 comments Download
M extensions/common/user_script.cc View 1 2 3 4 5 6 7 8 5 chunks +43 lines, -16 lines 0 comments Download
M extensions/common/user_script_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -5 lines 0 comments Download
M extensions/renderer/user_script_injector.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
M extensions/renderer/user_script_injector.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +10 lines, -13 lines 0 comments Download
M extensions/renderer/user_script_set.h View 1 2 3 3 chunks +3 lines, -8 lines 0 comments Download
M extensions/renderer/user_script_set.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 43 (30 generated)
lazyboy
Here is the main CL for reducing UserScript copy...
4 years, 4 months ago (2016-08-11 00:38:35 UTC) #15
Devlin
Just a few very high-level comments, because I think we can simplify this a fair ...
4 years, 4 months ago (2016-08-11 17:05:54 UTC) #16
lazyboy
I've updated the CL with what we discussed, see patch set #4 Tests need to ...
4 years, 4 months ago (2016-08-16 22:58:21 UTC) #18
Devlin
On 2016/08/16 22:58:21, lazyboy wrote: > I'm still a bit worried about readability: looking at ...
4 years, 4 months ago (2016-08-17 00:26:11 UTC) #19
lazyboy
On 2016/08/17 00:26:11, Devlin wrote: > On 2016/08/16 22:58:21, lazyboy wrote: > > I'm still ...
4 years, 4 months ago (2016-08-17 01:42:52 UTC) #20
Devlin
This is pretty good. I have a bunch of nits, but they're mostly not even ...
4 years, 4 months ago (2016-08-17 16:39:31 UTC) #21
lazyboy
Comments addressed in patch set #7. I've not *fixed the 2-copy script content issue in ...
4 years, 4 months ago (2016-08-17 18:55:53 UTC) #22
Devlin
lgtm with nits, but don't forget to update CL description. ;) https://codereview.chromium.org/2227193002/diff/260001/extensions/browser/web_ui_user_script_loader.cc File extensions/browser/web_ui_user_script_loader.cc (right): ...
4 years, 4 months ago (2016-08-17 20:40:40 UTC) #23
lazyboy
+dtseng for OWNERS review: chrome/browser/chromeos/accessibility/accessibility_manager.cc @devlin: Updated CL description, fixed tests. https://codereview.chromium.org/2227193002/diff/260001/extensions/browser/web_ui_user_script_loader.cc File extensions/browser/web_ui_user_script_loader.cc (right): ...
4 years, 4 months ago (2016-08-17 21:34:21 UTC) #27
David Tseng
lgtm
4 years, 4 months ago (2016-08-18 23:12:04 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2227193002/400001
4 years, 4 months ago (2016-08-19 18:17:27 UTC) #39
commit-bot: I haz the power
Committed patchset #12 (id:400001)
4 years, 4 months ago (2016-08-19 20:06:31 UTC) #41
commit-bot: I haz the power
4 years, 4 months ago (2016-08-19 20:10:29 UTC) #43
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/12c77d78dd3626b4e91664cfebd293a54b3e6d81
Cr-Commit-Position: refs/heads/master@{#413223}

Powered by Google App Engine
This is Rietveld 408576698