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

Unified Diff: chrome/browser/extensions/component_loader.cc

Issue 2252253003: Remove ComponentLoader's unnecessary string copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/component_loader.cc
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index c6289573007995aa59ce773c6df3a42f610372fa..f61841ee28f676f795dcfbf8a3bb8c0ec92fe659 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -191,18 +191,18 @@ std::string ComponentLoader::Add(int manifest_resource_id,
!IsComponentExtensionWhitelisted(manifest_resource_id))
return std::string();
- std::string manifest_contents =
+ base::StringPiece manifest_contents =
ResourceBundle::GetSharedInstance().GetRawDataResource(
- manifest_resource_id).as_string();
+ manifest_resource_id);
return Add(manifest_contents, root_directory, true);
}
-std::string ComponentLoader::Add(const std::string& manifest_contents,
+std::string ComponentLoader::Add(const base::StringPiece& manifest_contents,
const base::FilePath& root_directory) {
return Add(manifest_contents, root_directory, false);
}
-std::string ComponentLoader::Add(const std::string& manifest_contents,
+std::string ComponentLoader::Add(const base::StringPiece& manifest_contents,
const base::FilePath& root_directory,
bool skip_whitelist) {
// The Value is kept for the lifetime of the ComponentLoader. This is
« no previous file with comments | « chrome/browser/extensions/component_loader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698