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

Side by Side Diff: jingle/notifier/listener/notification_defines.cc

Issue 10828264: Clean up logging for push_notifications_*.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | jingle/notifier/listener/push_notifications_listen_task.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "jingle/notifier/listener/notification_defines.h" 5 #include "jingle/notifier/listener/notification_defines.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/base64.h"
10 #include "base/logging.h"
11 #include "base/string_util.h"
12
9 namespace notifier { 13 namespace notifier {
10 14
11 Subscription::Subscription() {} 15 Subscription::Subscription() {}
12 Subscription::~Subscription() {} 16 Subscription::~Subscription() {}
13 17
14 bool Subscription::Equals(const Subscription& other) const { 18 bool Subscription::Equals(const Subscription& other) const {
15 return channel == other.channel && from == other.from; 19 return channel == other.channel && from == other.from;
16 } 20 }
17 21
18 namespace { 22 namespace {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 Notification::~Notification() {} 57 Notification::~Notification() {}
54 58
55 bool Notification::Equals(const Notification& other) const { 59 bool Notification::Equals(const Notification& other) const {
56 return 60 return
57 channel == other.channel && 61 channel == other.channel &&
58 data == other.data && 62 data == other.data &&
59 RecipientListsEqual(recipients, other.recipients); 63 RecipientListsEqual(recipients, other.recipients);
60 } 64 }
61 65
62 std::string Notification::ToString() const { 66 std::string Notification::ToString() const {
63 return "{ channel: \"" + channel + "\", data: \"" + data + "\" }"; 67 std::string printable_data;
68 if (IsStringASCII(data)) {
69 printable_data = data;
70 } else {
71 CHECK(base::Base64Encode(data, &printable_data));
rlarocque 2012/08/10 20:58:38 If this is supposed to be semi-human-readable bina
akalin 2012/08/13 20:24:15 Done.
72 }
73 return "{ channel: \"" + channel + "\", data: \"" + printable_data + "\" }";
64 } 74 }
65 75
66 } // namespace notifier 76 } // namespace notifier
OLDNEW
« no previous file with comments | « no previous file | jingle/notifier/listener/push_notifications_listen_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698