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

Unified Diff: chrome/service/cloud_print/connector_settings.cc

Issue 10958052: Removed unnecessary returning by reference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/cloud_print/connector_settings.cc
diff --git a/chrome/service/cloud_print/connector_settings.cc b/chrome/service/cloud_print/connector_settings.cc
index 667dd5b05635c794bd4cbc1d348aa7431a961e00..f40091462ab6a45312e1d1267d47193f08308f62 100644
--- a/chrome/service/cloud_print/connector_settings.cc
+++ b/chrome/service/cloud_print/connector_settings.cc
@@ -17,7 +17,8 @@ const char kDeleteOnEnumFail[] = "delete_on_enum_fail";
} // namespace
-ConnectorSettings::ConnectorSettings() : delete_on_enum_fail_(false) {
+ConnectorSettings::ConnectorSettings()
+ : delete_on_enum_fail_(false) {
}
ConnectorSettings::~ConnectorSettings() {
@@ -26,7 +27,7 @@ ConnectorSettings::~ConnectorSettings() {
void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
CopyFrom(ConnectorSettings());
- prefs->GetString(prefs::kCloudPrintProxyId, &proxy_id_);
+ proxy_id_ = prefs->GetString(prefs::kCloudPrintProxyId, "");
if (proxy_id_.empty()) {
proxy_id_ = cloud_print::PrintSystem::GenerateProxyId();
prefs->SetString(prefs::kCloudPrintProxyId, proxy_id_);
@@ -34,24 +35,22 @@ void ConnectorSettings::InitFrom(ServiceProcessPrefs* prefs) {
}
// Getting print system specific settings from the preferences.
- const base::DictionaryValue* print_system_settings = NULL;
- prefs->GetDictionary(prefs::kCloudPrintPrintSystemSettings,
- &print_system_settings);
+ const base::DictionaryValue* print_system_settings =
+ prefs->GetDictionary(prefs::kCloudPrintPrintSystemSettings);
if (print_system_settings) {
print_system_settings_.reset(print_system_settings->DeepCopy());
- // TODO(vitalybuka) : Consider to move option from print_system_settings.
+ // TODO(vitalybuka) : Consider to rename and move out option from
+ // print_system_settings.
print_system_settings_->GetBoolean(kDeleteOnEnumFail,
&delete_on_enum_fail_);
}
// Check if there is an override for the cloud print server URL.
- std::string cloud_print_server_url_str;
- prefs->GetString(prefs::kCloudPrintServiceURL,
- &cloud_print_server_url_str);
- if (cloud_print_server_url_str.empty()) {
- cloud_print_server_url_str = kDefaultCloudPrintServerUrl;
+ server_url_ = GURL(prefs->GetString(prefs::kCloudPrintServiceURL, ""));
+ DCHECK(server_url_.is_empty() || server_url_.is_valid());
+ if (server_url_.is_empty() || !server_url_.is_valid()) {
+ server_url_ = GURL(kDefaultCloudPrintServerUrl);
}
- server_url_ = GURL(cloud_print_server_url_str.c_str());
DCHECK(server_url_.is_valid());
}
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698