summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 21:02:08 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 21:02:08 +0000
commit062f0518d01e2adcd33130826a827db7dfd0f485 (patch)
treed6e3feb31d49971bb1a0841ffeb70aadc27eefe7 /chrome/browser/extensions
parentb58d3c5ff1569f7c4284675545559e10d33f792b (diff)
downloadchromium_src-062f0518d01e2adcd33130826a827db7dfd0f485.zip
chromium_src-062f0518d01e2adcd33130826a827db7dfd0f485.tar.gz
chromium_src-062f0518d01e2adcd33130826a827db7dfd0f485.tar.bz2
Coverity: Pass FilePaths and strings by reference.
CID=2716,4565,5054 BUG=none TEST=none Review URL: http://codereview.chromium.org/160120 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extensions_service.cc8
-rw-r--r--chrome/browser/extensions/extensions_service.h7
2 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 9872c72..486926d 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -694,8 +694,8 @@ void ExtensionsServiceBackend::LoadInstalledExtension(
ReportExtensionsLoaded(extensions);
}
-DictionaryValue* ExtensionsServiceBackend::ReadManifest(FilePath manifest_path,
- std::string* error) {
+DictionaryValue* ExtensionsServiceBackend::ReadManifest(
+ const FilePath& manifest_path, std::string* error) {
JSONFileValueSerializer serializer(manifest_path);
scoped_ptr<Value> root(serializer.Deserialize(error));
if (!root.get())
@@ -915,7 +915,7 @@ bool ExtensionsServiceBackend::InstallDirSafely(const FilePath& source_dir,
}
bool ExtensionsServiceBackend::SetCurrentVersion(const FilePath& dest_dir,
- std::string version) {
+ const std::string& version) {
// Write out the new CurrentVersion file.
// <profile>/Extension/<name>/CurrentVersion
FilePath current_version =
@@ -1084,7 +1084,7 @@ bool ExtensionsServiceBackend::ValidateSignature(const FilePath& extension_path,
void ExtensionsServiceBackend::OnExtensionUnpacked(
const FilePath& extension_path,
const FilePath& temp_extension_dir,
- const std::string expected_id,
+ const std::string& expected_id,
const DictionaryValue& manifest,
const std::vector< Tuple2<SkBitmap, FilePath> >& images,
bool silent, bool from_gallery) {
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index 0a36cc8..f7fad70 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -347,7 +347,8 @@ class ExtensionsServiceBackend
// Utility function to read an extension manifest and return it as a
// DictionaryValue. If it fails, NULL is returned and |error| contains an
// appropriate message.
- DictionaryValue* ReadManifest(FilePath manifest_path, std::string* error);
+ DictionaryValue* ReadManifest(const FilePath& manifest_path,
+ std::string* error);
// Load a single extension from |extension_path|, the top directory of
// a specific extension where its manifest file lives.
@@ -381,7 +382,7 @@ class ExtensionsServiceBackend
void OnExtensionUnpacked(
const FilePath& extension_path,
const FilePath& temp_extension_dir,
- const std::string expected_id,
+ const std::string& expected_id,
const DictionaryValue& manifest,
const std::vector< Tuple2<SkBitmap, FilePath> >& images,
bool silent,
@@ -446,7 +447,7 @@ class ExtensionsServiceBackend
// Update the CurrentVersion file in |dest_dir| to |version|.
bool SetCurrentVersion(const FilePath& dest_dir,
- std::string version);
+ const std::string& version);
// For the extension in |version_path| with |id|, check to see if it's an
// externally managed extension. If so return true if it should be