OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "remoting/signaling/jid_util.h" | 5 #include "remoting/signaling/jid_util.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
8 | 10 |
9 namespace remoting { | 11 namespace remoting { |
10 | 12 |
11 std::string NormalizeJid(const std::string& jid) { | 13 std::string NormalizeJid(const std::string& jid) { |
12 std::string bare_jid; | 14 std::string bare_jid; |
13 std::string resource; | 15 std::string resource; |
14 if (SplitJidResource(jid, &bare_jid, &resource)) { | 16 if (SplitJidResource(jid, &bare_jid, &resource)) { |
15 return base::ToLowerASCII(bare_jid) + "/" + resource; | 17 return base::ToLowerASCII(bare_jid) + "/" + resource; |
16 } | 18 } |
(...skipping 17 matching lines...) Expand all Loading... |
34 if (bare_jid) { | 36 if (bare_jid) { |
35 *bare_jid = full_jid.substr(0, slash_index); | 37 *bare_jid = full_jid.substr(0, slash_index); |
36 } | 38 } |
37 if (resource) { | 39 if (resource) { |
38 *resource = full_jid.substr(slash_index + 1); | 40 *resource = full_jid.substr(slash_index + 1); |
39 } | 41 } |
40 return true; | 42 return true; |
41 } | 43 } |
42 | 44 |
43 } // namespace remoting | 45 } // namespace remoting |
OLD | NEW |