summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorsra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 04:41:27 +0000
committersra@chromium.org <sra@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-22 04:41:27 +0000
commit4b14d07f99813eee85d240a91f6ccf132e5dfd89 (patch)
tree92235d4673e9b5c1745974ce4a046f93415b850f /chrome
parentde643683ad556728e5448323a45a6365daabcf9c (diff)
downloadchromium_src-4b14d07f99813eee85d240a91f6ccf132e5dfd89.zip
chromium_src-4b14d07f99813eee85d240a91f6ccf132e5dfd89.tar.gz
chromium_src-4b14d07f99813eee85d240a91f6ccf132e5dfd89.tar.bz2
Coverity fixit changes
None of these fix known bugs * pass string by reference * initialize _int_value field (even though guarded by _is_string) BUG=none TEST=none Review URL: http://codereview.chromium.org/155838 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/installer/util/shell_util.cc22
-rw-r--r--chrome/installer/util/shell_util.h2
2 files changed, 13 insertions, 11 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 98c137f..2a7619a 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -184,29 +184,31 @@ class RegistryEntry {
private:
// Create a object that represent default value of a key
- RegistryEntry(const std::wstring& key_path, const std::wstring& value) :
- _key_path(key_path), _name(L""), _value(value),
- _is_string(true) {
+ RegistryEntry(const std::wstring& key_path, const std::wstring& value)
+ : _key_path(key_path), _name(),
+ _is_string(true), _value(value), _int_value(0) {
}
// Create a object that represent a key of type REG_SZ
RegistryEntry(const std::wstring& key_path, const std::wstring& name,
- const std::wstring& value) : _key_path(key_path),
- _name(name), _value(value), _is_string(true) {
+ const std::wstring& value)
+ : _key_path(key_path), _name(name),
+ _is_string(true), _value(value), _int_value(0) {
}
// Create a object that represent a key of integer type
RegistryEntry(const std::wstring& key_path, const std::wstring& name,
- DWORD value) : _key_path(key_path),
- _name(name), _int_value(value), _is_string(false) {
+ DWORD value)
+ : _key_path(key_path), _name(name),
+ _is_string(false), _value(), _int_value(value) {
}
- bool _is_string; // true if current registry entry is of type REG_SZ
std::wstring _key_path; // key path for the registry entry
std::wstring _name; // name of the registry entry
+ bool _is_string; // true if current registry entry is of type REG_SZ
std::wstring _value; // string value (useful if _is_string = true)
DWORD _int_value; // integer value (useful if _is_string = false)
-}; // class RegistryEntry
+}; // class RegistryEntry
// This method checks if Chrome is already registered on the local machine.
@@ -586,7 +588,7 @@ bool ShellUtil::CreateChromeQuickLaunchShortcut(const std::wstring& chrome_exe,
}
bool ShellUtil::MakeChromeDefault(int shell_change,
- const std::wstring chrome_exe) {
+ const std::wstring& chrome_exe) {
bool ret = true;
// First use the new "recommended" way on Vista to make Chrome default
// browser.
diff --git a/chrome/installer/util/shell_util.h b/chrome/installer/util/shell_util.h
index b294f85..a834496c 100644
--- a/chrome/installer/util/shell_util.h
+++ b/chrome/installer/util/shell_util.h
@@ -177,7 +177,7 @@ class ShellUtil {
// as default only for the current user.
// chrome_exe: The chrome.exe path to register as default browser.
static bool MakeChromeDefault(int shell_change,
- const std::wstring chrome_exe);
+ const std::wstring& chrome_exe);
// Remove Chrome shortcut from Desktop.
// If shell_change is CURRENT_USER, the shortcut is removed from the