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

Unified Diff: sync/util/cryptographer.cc

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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 | « sync/test/engine/mock_connection_manager.cc ('k') | ui/base/gtk/menu_label_accelerator_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/util/cryptographer.cc
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index 61b5e6328e128999a523c4d43861d878955ab977..0fed51e1674f4206521861e3b85911e3f2266fa8 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -110,12 +110,12 @@ std::string Cryptographer::DecryptToString(
NigoriMap::const_iterator it = nigoris_.find(encrypted.key_name());
if (nigoris_.end() == it) {
NOTREACHED() << "Cannot decrypt message";
- return std::string(""); // Caller should have called CanDecrypt(encrypt).
+ return std::string(); // Caller should have called CanDecrypt(encrypt).
}
std::string plaintext;
if (!it->second->Decrypt(encrypted.blob(), &plaintext)) {
- return std::string("");
+ return std::string();
}
return plaintext;
@@ -271,18 +271,18 @@ bool Cryptographer::GetBootstrapToken(std::string* token) const {
std::string Cryptographer::UnpackBootstrapToken(
const std::string& token) const {
if (token.empty())
- return "";
+ return std::string();
std::string encrypted_data;
if (!base::Base64Decode(token, &encrypted_data)) {
DLOG(WARNING) << "Could not decode token.";
- return "";
+ return std::string();
}
std::string unencrypted_token;
if (!encryptor_->DecryptString(encrypted_data, &unencrypted_token)) {
DLOG(WARNING) << "Decryption of bootstrap token failed.";
- return "";
+ return std::string();
}
return unencrypted_token;
}
@@ -328,15 +328,15 @@ bool Cryptographer::KeybagIsStale(
std::string Cryptographer::GetDefaultNigoriKey() const {
if (!is_initialized())
- return "";
+ return std::string();
NigoriMap::const_iterator iter = nigoris_.find(default_nigori_name_);
if (iter == nigoris_.end())
- return "";
+ return std::string();
sync_pb::NigoriKey key;
if (!iter->second->ExportKeys(key.mutable_user_key(),
key.mutable_encryption_key(),
key.mutable_mac_key()))
- return "";
+ return std::string();
return key.SerializeAsString();
}
« no previous file with comments | « sync/test/engine/mock_connection_manager.cc ('k') | ui/base/gtk/menu_label_accelerator_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698