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

Issue 2250263004: [Extensions] Reduce string copy in renderer/ UserScript. (Closed)

Created:
4 years, 4 months ago by lazyboy
Modified:
4 years, 4 months ago
Reviewers:
Devlin
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, 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] Reduce string copy in renderer/ UserScript. Before passing StringPiece script (JS/CSS) content to blink (to create WebString or WebScriptSource), we sometimes unnecessarily created std::string. This CL removes the intermediate state. Greasemonkey scripts still require the intermediate std::string to pad it with header and tail though. Use reserve and StringPiece.appendToString() in that case to at least do that efficiently. BUG=622464 Test=No visible change. Committed: https://crrev.com/49cc0b3a4e425a884a0b12639951f84b4f84f693 Cr-Commit-Position: refs/heads/master@{#412946}

Patch Set 1 #

Total comments: 8

Patch Set 2 : fix typo #

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -23 lines) Patch
M extensions/renderer/dispatcher.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M extensions/renderer/programmatic_script_injector.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/programmatic_script_injector.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M extensions/renderer/script_injection.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M extensions/renderer/script_injector.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/user_script_injector.h View 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/user_script_injector.cc View 1 2 2 chunks +26 lines, -12 lines 0 comments Download

Messages

Total messages: 16 (10 generated)
lazyboy
Follow up from the other CL.
4 years, 4 months ago (2016-08-18 02:02:58 UTC) #2
Devlin
lgtm https://codereview.chromium.org/2250263004/diff/1/extensions/renderer/user_script_injector.cc File extensions/renderer/user_script_injector.cc (right): https://codereview.chromium.org/2250263004/diff/1/extensions/renderer/user_script_injector.cc#newcode206 extensions/renderer/user_script_injector.cc:206: sources.reserve()? (was this done in your other patch ...
4 years, 4 months ago (2016-08-18 17:08:17 UTC) #5
lazyboy
https://codereview.chromium.org/2250263004/diff/1/extensions/renderer/user_script_injector.cc File extensions/renderer/user_script_injector.cc (right): https://codereview.chromium.org/2250263004/diff/1/extensions/renderer/user_script_injector.cc#newcode206 extensions/renderer/user_script_injector.cc:206: On 2016/08/18 17:08:16, Devlin wrote: > sources.reserve()? (was this ...
4 years, 4 months ago (2016-08-18 18:53:23 UTC) #8
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/2250263004/30001
4 years, 4 months ago (2016-08-18 21:04:09 UTC) #13
commit-bot: I haz the power
Committed patchset #3 (id:30001)
4 years, 4 months ago (2016-08-18 21:55:46 UTC) #14
commit-bot: I haz the power
4 years, 4 months ago (2016-08-18 22:00:20 UTC) #16
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/49cc0b3a4e425a884a0b12639951f84b4f84f693
Cr-Commit-Position: refs/heads/master@{#412946}

Powered by Google App Engine
This is Rietveld 408576698