summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 11:55:10 +0000
committerricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-10 11:55:10 +0000
commit0553072d237ad2b977e948591de3f87eee536a9c (patch)
tree58b462d22b2342db07c041ac8abaf061e671d1e5 /jingle
parent9377d2ad77c6d7ee0190c90544eaed0ff0c7fc9c (diff)
downloadchromium_src-0553072d237ad2b977e948591de3f87eee536a9c.zip
chromium_src-0553072d237ad2b977e948591de3f87eee536a9c.tar.gz
chromium_src-0553072d237ad2b977e948591de3f87eee536a9c.tar.bz2
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239759 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/notifier/listener/push_notifications_send_update_task.cc12
-rw-r--r--jingle/notifier/listener/push_notifications_send_update_task_unittest.cc2
2 files changed, 4 insertions, 10 deletions
diff --git a/jingle/notifier/listener/push_notifications_send_update_task.cc b/jingle/notifier/listener/push_notifications_send_update_task.cc
index 4e0c127..9b5abb6 100644
--- a/jingle/notifier/listener/push_notifications_send_update_task.cc
+++ b/jingle/notifier/listener/push_notifications_send_update_task.cc
@@ -71,20 +71,14 @@ buzz::XmlElement* PushNotificationsSendUpdateTask::MakeUpdateMessage(
recipient_element->AddAttr(buzz::QN_TO, recipient.to);
if (!recipient.user_specific_data.empty()) {
std::string base64_data;
- if (!base::Base64Encode(recipient.user_specific_data, &base64_data)) {
- DLOG(WARNING) << "Could not encode data "
- << recipient.user_specific_data;
- } else {
- recipient_element->SetBodyText(base64_data);
- }
+ base::Base64Encode(recipient.user_specific_data, &base64_data);
+ recipient_element->SetBodyText(base64_data);
}
}
buzz::XmlElement* data = new buzz::XmlElement(kQnData, true);
std::string base64_data;
- if (!base::Base64Encode(notification.data, &base64_data)) {
- DLOG(WARNING) << "Could not encode data " << notification.data;
- }
+ base::Base64Encode(notification.data, &base64_data);
data->SetBodyText(base64_data);
push->AddElement(data);
diff --git a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
index c57bd93..0395352 100644
--- a/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
+++ b/jingle/notifier/listener/push_notifications_send_update_task_unittest.cc
@@ -36,7 +36,7 @@ TEST_F(PushNotificationsSendUpdateTaskTest, MakeUpdateMessage) {
notification.data = "test_data";
std::string base64_data;
- EXPECT_TRUE(base::Base64Encode(notification.data, &base64_data));
+ base::Base64Encode(notification.data, &base64_data);
scoped_ptr<buzz::XmlElement> message(
PushNotificationsSendUpdateTask::MakeUpdateMessage(