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

Issue 2252253003: Remove ComponentLoader's unnecessary string copy. (Closed)

Created:
4 years, 4 months ago by lazyboy
Modified:
4 years, 4 months ago
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

Remove ComponentLoader's unnecessary string copy. ComponentLoader::Add(int manifest_id, ...) is how most components extensions get added. Couple of exceptions are: pdf_extension and IME. Otherwise, ComponentLoader::Add gets the resource from ResourceBundle and then converts the StringPiece representing the resource to std::string (copy) and feeds them to ComponentLoader::ParseManifest(). ParseManifest construct a StringPiece from the std::string since JSONStringValueDeserializer is capable of working with StringPiece-s. This CL removes the intermediate conversion from StringPiece to string for most of the cases. This probably helps chormeos more than non-chromeos, since I saw 30 component extension being loaded through ComponentLoader resulting in 49254 bytes of unnecessary copy. BUG=638775 Test=No observable change. FYI: this can affect built in chromeos extensions. Committed: https://crrev.com/3cdbf74891491f09473f87ebf215d327ff27296d Cr-Commit-Position: refs/heads/master@{#412719}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M chrome/browser/extensions/component_loader.h View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/component_loader.cc View 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 12 (7 generated)
lazyboy
4 years, 4 months ago (2016-08-17 23:29:03 UTC) #2
asargent_no_longer_on_chrome
nice catch, lgtm
4 years, 4 months ago (2016-08-17 23:53:00 UTC) #5
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/2252253003/1
4 years, 4 months ago (2016-08-18 01:24:43 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-18 01:29:27 UTC) #10
commit-bot: I haz the power
4 years, 4 months ago (2016-08-18 01:32:31 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/3cdbf74891491f09473f87ebf215d327ff27296d
Cr-Commit-Position: refs/heads/master@{#412719}

Powered by Google App Engine
This is Rietveld 408576698