| 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 #ifndef REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ | 5 #ifndef REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ |
| 6 #define REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ | 6 #define REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // ContentDescription used for chromoting sessions. It contains the information | 22 // ContentDescription used for chromoting sessions. It contains the information |
| 23 // from the content description stanza in the session intialization handshake. | 23 // from the content description stanza in the session intialization handshake. |
| 24 // | 24 // |
| 25 // This class also provides a type abstraction so that the Chromotocol Session | 25 // This class also provides a type abstraction so that the Chromotocol Session |
| 26 // interface does not need to depend on libjingle. | 26 // interface does not need to depend on libjingle. |
| 27 class ContentDescription : public cricket::ContentDescription { | 27 class ContentDescription : public cricket::ContentDescription { |
| 28 public: | 28 public: |
| 29 static const char kChromotingContentName[]; | 29 static const char kChromotingContentName[]; |
| 30 | 30 |
| 31 // Takes ownership of |config| and |authenticator_message|. |
| 31 ContentDescription(const CandidateSessionConfig* config, | 32 ContentDescription(const CandidateSessionConfig* config, |
| 32 const std::string& auth_token, | 33 const buzz::XmlElement* authenticator_message); |
| 33 const std::string& certificate); | |
| 34 virtual ~ContentDescription(); | 34 virtual ~ContentDescription(); |
| 35 | 35 |
| 36 const CandidateSessionConfig* config() const { | 36 const CandidateSessionConfig* config() const { |
| 37 return candidate_config_.get(); | 37 return candidate_config_.get(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 const std::string& auth_token() const { return auth_token_; } | 40 const buzz::XmlElement* authenticator_message() const { |
| 41 const std::string& certificate() const { return certificate_; } | 41 return authenticator_message_.get(); |
| 42 } |
| 42 | 43 |
| 43 buzz::XmlElement* ToXml() const; | 44 buzz::XmlElement* ToXml() const; |
| 44 | 45 |
| 45 static ContentDescription* ParseXml(const buzz::XmlElement* element); | 46 static ContentDescription* ParseXml(const buzz::XmlElement* element); |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 scoped_ptr<const CandidateSessionConfig> candidate_config_; | 49 scoped_ptr<const CandidateSessionConfig> candidate_config_; |
| 49 | 50 scoped_ptr<const buzz::XmlElement> authenticator_message_; |
| 50 // This may contain the initiating, or the accepting token depending on | |
| 51 // context. | |
| 52 std::string auth_token_; | |
| 53 | |
| 54 std::string certificate_; | |
| 55 }; | 51 }; |
| 56 | 52 |
| 57 } // namespace protocol | 53 } // namespace protocol |
| 58 } // namespace remoting | 54 } // namespace remoting |
| 59 | 55 |
| 60 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ | 56 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ |
| OLD | NEW |