summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorvadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
committervadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-11 01:48:50 +0000
commit33fca12d265b8129e6cff8fc1fc9ad7b34a19bab (patch)
treeef737a2c12192c512ea7e05460c758e42200590a /sync
parent5cddcd140cbe8fc9a8e10e67142cee75dc99684b (diff)
downloadchromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.zip
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.gz
chromium_src-33fca12d265b8129e6cff8fc1fc9ad7b34a19bab.tar.bz2
Revert 239921 "Revert 239759 "The comment in base64.h implies th..."
***************** Reverting the revert. Congrats, the original CL wasn't the cause for the failure; sorry for the mess. ***************** > Revert 239759 "The comment in base64.h implies that base::Base64..." > > > The comment in base64.h implies that base::Base64Encode() can return false, but > > this cannot happen in practice. Fix the comment. > > > > The implementation of Base64Encode() attempts to check for the return value > > MODP_B64_ERROR as a failure, but modp_b64_encode() cannot return this > > value. Remove the check. > > > > Remove unneeded integer cast. > > > > Change the return type to void. > > > > BUG=323357 > > TEST=base_unittests, compile all > > TBR=jochen@chromium.org,miket@chromium.org,joi@chromium.org,akalin@chromium.org,sergeyu@chromium.org > > > > Review URL: https://codereview.chromium.org/86913002 > > TBR=ricea@chromium.org > > Review URL: https://codereview.chromium.org/101113004 TBR=vadimt@chromium.org Review URL: https://codereview.chromium.org/111883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/internal_api/public/base/unique_position_unittest.cc2
-rw-r--r--sync/internal_api/sync_encryption_handler_impl.cc3
-rw-r--r--sync/protocol/proto_value_conversions.cc4
-rw-r--r--sync/syncable/syncable_util.cc2
-rw-r--r--sync/tools/null_invalidation_state_tracker.cc2
-rw-r--r--sync/util/cryptographer.cc6
-rw-r--r--sync/util/nigori.cc6
7 files changed, 11 insertions, 14 deletions
diff --git a/sync/internal_api/public/base/unique_position_unittest.cc b/sync/internal_api/public/base/unique_position_unittest.cc
index 371874a..4c0a660 100644
--- a/sync/internal_api/public/base/unique_position_unittest.cc
+++ b/sync/internal_api/public/base/unique_position_unittest.cc
@@ -392,7 +392,7 @@ class SuffixGenerator {
// random anyway.
std::string input = cache_guid_ + base::Int64ToString(next_id_--);
std::string output;
- CHECK(base::Base64Encode(base::SHA1HashString(input), &output));
+ base::Base64Encode(base::SHA1HashString(input), &output);
return output;
}
diff --git a/sync/internal_api/sync_encryption_handler_impl.cc b/sync/internal_api/sync_encryption_handler_impl.cc
index e468e6c..34bf0335 100644
--- a/sync/internal_api/sync_encryption_handler_impl.cc
+++ b/sync/internal_api/sync_encryption_handler_impl.cc
@@ -692,8 +692,7 @@ bool SyncEncryptionHandlerImpl::SetKeystoreKeys(
// Note: in order to Pack the keys, they must all be base64 encoded (else
// JSON serialization fails).
- if (!base::Base64Encode(raw_keystore_key, &keystore_key_))
- return false;
+ base::Base64Encode(raw_keystore_key, &keystore_key_);
// Go through and save the old keystore keys. We always persist all keystore
// keys the server sends us.
diff --git a/sync/protocol/proto_value_conversions.cc b/sync/protocol/proto_value_conversions.cc
index 0217c5c..cdb999e 100644
--- a/sync/protocol/proto_value_conversions.cc
+++ b/sync/protocol/proto_value_conversions.cc
@@ -54,9 +54,7 @@ base::StringValue* MakeInt64Value(int64 x) {
// that instead of a StringValue.
base::StringValue* MakeBytesValue(const std::string& bytes) {
std::string bytes_base64;
- if (!base::Base64Encode(bytes, &bytes_base64)) {
- NOTREACHED();
- }
+ base::Base64Encode(bytes, &bytes_base64);
return new base::StringValue(bytes_base64);
}
diff --git a/sync/syncable/syncable_util.cc b/sync/syncable/syncable_util.cc
index 74ae06a..d92aa47 100644
--- a/sync/syncable/syncable_util.cc
+++ b/sync/syncable/syncable_util.cc
@@ -101,7 +101,7 @@ std::string GenerateSyncableHash(
hash_input.append(client_tag);
std::string encode_output;
- CHECK(base::Base64Encode(base::SHA1HashString(hash_input), &encode_output));
+ base::Base64Encode(base::SHA1HashString(hash_input), &encode_output);
return encode_output;
}
diff --git a/sync/tools/null_invalidation_state_tracker.cc b/sync/tools/null_invalidation_state_tracker.cc
index ff21a6f..6823759 100644
--- a/sync/tools/null_invalidation_state_tracker.cc
+++ b/sync/tools/null_invalidation_state_tracker.cc
@@ -38,7 +38,7 @@ std::string NullInvalidationStateTracker::GetBootstrapData() const {
void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) {
std::string base64_data;
- CHECK(base::Base64Encode(data, &base64_data));
+ base::Base64Encode(data, &base64_data);
LOG(INFO) << "Setting bootstrap data to: " << base64_data;
}
diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc
index 0fed51e..29f3781 100644
--- a/sync/util/cryptographer.cc
+++ b/sync/util/cryptographer.cc
@@ -261,10 +261,8 @@ bool Cryptographer::GetBootstrapToken(std::string* token) const {
return false;
}
- if (!base::Base64Encode(encrypted_token, token)) {
- NOTREACHED();
- return false;
- }
+ base::Base64Encode(encrypted_token, token);
+
return true;
}
diff --git a/sync/util/nigori.cc b/sync/util/nigori.cc
index b0158f3..e74d81a91 100644
--- a/sync/util/nigori.cc
+++ b/sync/util/nigori.cc
@@ -150,7 +150,8 @@ bool Nigori::Permute(Type type, const std::string& name,
output.assign(ciphertext);
output.append(hash.begin(), hash.end());
- return Base64Encode(output, permuted);
+ Base64Encode(output, permuted);
+ return true;
}
// Enc[Kenc,Kmac](value)
@@ -186,7 +187,8 @@ bool Nigori::Encrypt(const std::string& value, std::string* encrypted) const {
output.append(ciphertext);
output.append(hash.begin(), hash.end());
- return Base64Encode(output, encrypted);
+ Base64Encode(output, encrypted);
+ return true;
}
bool Nigori::Decrypt(const std::string& encrypted, std::string* value) const {