OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/protocol/authenticator.h" | 5 #include "remoting/protocol/authenticator.h" |
6 | 6 |
7 #include "remoting/base/constants.h" | 7 #include "remoting/base/constants.h" |
8 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" | 8 #include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 namespace protocol { | 11 namespace protocol { |
12 | 12 |
13 namespace { | 13 namespace { |
14 const buzz::StaticQName kAuthenticationQName = { kChromotingXmlNamespace, | 14 const buzz::StaticQName kAuthenticationQName = { kChromotingXmlNamespace, |
15 "authentication" }; | 15 "authentication" }; |
16 } // namespace | 16 } // namespace |
17 | 17 |
18 // static | 18 // static |
19 bool Authenticator::IsAuthenticatorMessage(const buzz::XmlElement* message) { | 19 bool Authenticator::IsAuthenticatorMessage(const buzz::XmlElement* message) { |
20 return message->Name() == kAuthenticationQName; | 20 return message->Name() == kAuthenticationQName; |
21 } | 21 } |
22 | 22 |
23 // static | 23 // static |
24 buzz::XmlElement* Authenticator::CreateEmptyAuthenticatorMessage() { | 24 scoped_ptr<buzz::XmlElement> Authenticator::CreateEmptyAuthenticatorMessage() { |
25 return new buzz::XmlElement(kAuthenticationQName); | 25 return scoped_ptr<buzz::XmlElement>( |
| 26 new buzz::XmlElement(kAuthenticationQName)); |
26 } | 27 } |
27 | 28 |
28 // static | 29 // static |
29 const buzz::XmlElement* Authenticator::FindAuthenticatorMessage( | 30 const buzz::XmlElement* Authenticator::FindAuthenticatorMessage( |
30 const buzz::XmlElement* message) { | 31 const buzz::XmlElement* message) { |
31 return message->FirstNamed(kAuthenticationQName); | 32 return message->FirstNamed(kAuthenticationQName); |
32 } | 33 } |
33 | 34 |
34 } // namespace protocol | 35 } // namespace protocol |
35 } // namespace remoting | 36 } // namespace remoting |
OLD | NEW |