OLD | NEW |
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/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 | 13 |
14 namespace notifier { | 14 namespace notifier { |
15 | 15 |
16 Subscription::Subscription() {} | 16 Subscription::Subscription() {} |
17 Subscription::~Subscription() {} | 17 Subscription::~Subscription() {} |
18 | 18 |
19 bool Subscription::Equals(const Subscription& other) const { | 19 bool Subscription::Equals(const Subscription& other) const { |
20 return channel == other.channel && from == other.from; | 20 return channel == other.channel && from == other.from; |
21 } | 21 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 std::string Notification::ToString() const { | 67 std::string Notification::ToString() const { |
68 // |channel| or |data| could hold binary data, so use GetDoubleQuotedJson() | 68 // |channel| or |data| could hold binary data, so use GetDoubleQuotedJson() |
69 // to escape them. | 69 // to escape them. |
70 const std::string& printable_channel = base::GetDoubleQuotedJson(channel); | 70 const std::string& printable_channel = base::GetDoubleQuotedJson(channel); |
71 const std::string& printable_data = base::GetDoubleQuotedJson(data); | 71 const std::string& printable_data = base::GetDoubleQuotedJson(data); |
72 return | 72 return |
73 "{ channel: " + printable_channel + ", data: " + printable_data + " }"; | 73 "{ channel: " + printable_channel + ", data: " + printable_data + " }"; |
74 } | 74 } |
75 | 75 |
76 } // namespace notifier | 76 } // namespace notifier |
OLD | NEW |