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

Issue 2278003002: Stop copying script contents for each RenderFrames. (Closed)

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

Description

Stop copying script contents for each RenderFrames. Instead, after unpickling the script content, put them in a WebString on its first use (GetJsSources) in a frame. Reuse them for subsequent frames. The cleanup is done when UserScriptSet releases its shared memory connection. A completely naive test shows that on WSJ site, with ABPlus extension installed, this reduced (24025 * 11 + 14785 * 10) = 412125 char copies! BUG=622464 Test=No visible change is expected. Committed: https://crrev.com/0f702e9e3ccd2f408b198d2b2255d363da0310b9 Cr-Commit-Position: refs/heads/master@{#417018}

Patch Set 1 #

Total comments: 6

Patch Set 2 : use map GURL->WebString #

Patch Set 3 : fix WebScriptSource constructor param #

Total comments: 4

Patch Set 4 : address comments from Devlin #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -38 lines) Patch
M extensions/renderer/user_script_injector.h View 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/renderer/user_script_injector.cc View 1 2 3 4 chunks +12 lines, -38 lines 0 comments Download
M extensions/renderer/user_script_set.h View 1 4 chunks +11 lines, -0 lines 0 comments Download
M extensions/renderer/user_script_set.cc View 1 2 3 3 chunks +48 lines, -0 lines 0 comments Download

Messages

Total messages: 32 (21 generated)
lazyboy
4 years, 3 months ago (2016-08-25 02:13:12 UTC) #2
Devlin
catmullings@ cc'd as FYI, since she's also working in this area. https://codereview.chromium.org/2278003002/diff/1/extensions/renderer/user_script_set.cc File extensions/renderer/user_script_set.cc (right): ...
4 years, 3 months ago (2016-08-25 17:07:35 UTC) #8
lazyboy
https://codereview.chromium.org/2278003002/diff/1/extensions/renderer/user_script_set.cc File extensions/renderer/user_script_set.cc (right): https://codereview.chromium.org/2278003002/diff/1/extensions/renderer/user_script_set.cc#newcode265 extensions/renderer/user_script_set.cc:265: std::vector<blink::WebScriptSource> UserScriptSet::GetJsSources(int script_id) { On 2016/08/25 17:07:35, Devlin wrote: ...
4 years, 3 months ago (2016-09-06 19:37:32 UTC) #9
Devlin
Looks like there are a few failing tests?
4 years, 3 months ago (2016-09-06 20:33:33 UTC) #14
lazyboy
On 2016/09/06 20:33:33, Devlin wrote: > Looks like there are a few failing tests? Fixed ...
4 years, 3 months ago (2016-09-07 00:14:04 UTC) #15
Devlin
lgtm! https://codereview.chromium.org/2278003002/diff/40001/extensions/renderer/user_script_injector.cc File extensions/renderer/user_script_injector.cc (right): https://codereview.chromium.org/2278003002/diff/40001/extensions/renderer/user_script_injector.cc#newcode216 extensions/renderer/user_script_injector.cc:216: sources.insert(sources.begin(), g_greasemonkey_api.Get().GetSource()); nit: unrelated, but maybe put this ...
4 years, 3 months ago (2016-09-07 14:29:45 UTC) #20
lazyboy
https://codereview.chromium.org/2278003002/diff/40001/extensions/renderer/user_script_injector.cc File extensions/renderer/user_script_injector.cc (right): https://codereview.chromium.org/2278003002/diff/40001/extensions/renderer/user_script_injector.cc#newcode216 extensions/renderer/user_script_injector.cc:216: sources.insert(sources.begin(), g_greasemonkey_api.Get().GetSource()); On 2016/09/07 14:29:45, Devlin wrote: > nit: ...
4 years, 3 months ago (2016-09-07 16:47:35 UTC) #22
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/2278003002/60001
4 years, 3 months ago (2016-09-07 18:57:04 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-09-07 19:04:02 UTC) #29
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/0f702e9e3ccd2f408b198d2b2255d363da0310b9 Cr-Commit-Position: refs/heads/master@{#417018}
4 years, 3 months ago (2016-09-07 19:07:08 UTC) #31
lazyboy
4 years, 3 months ago (2016-09-09 07:55:34 UTC) #32
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/2325053002/ by lazyboy@chromium.org.

The reason for reverting is: Crashes renderer while destroying UserScriptSet via
ChromeExtensionsRendererClient LazyInstance....

Powered by Google App Engine
This is Rietveld 408576698