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 #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/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "remoting/protocol/session_config.h" | 12 #include "remoting/protocol/session_config.h" |
| 13 #include "third_party/webrtc/p2p/base/sessiondescription.h" |
13 | 14 |
14 namespace buzz { | 15 namespace buzz { |
15 class XmlElement; | 16 class XmlElement; |
16 } // namespace buzz | 17 } // namespace buzz |
17 | 18 |
18 namespace remoting { | 19 namespace remoting { |
19 namespace protocol { | 20 namespace protocol { |
20 | 21 |
21 // ContentDescription used for chromoting sessions. It contains the information | 22 // ContentDescription used for chromoting sessions. It contains the information |
22 // from the content description stanza in the session intialization handshake. | 23 // from the content description stanza in the session intialization handshake. |
23 // | 24 // |
24 // 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 |
25 // interface does not need to depend on libjingle. | 26 // interface does not need to depend on libjingle. |
26 class ContentDescription { | 27 class ContentDescription : public cricket::ContentDescription { |
27 public: | 28 public: |
28 static const char kChromotingContentName[]; | 29 static const char kChromotingContentName[]; |
29 | 30 |
30 ContentDescription(scoped_ptr<CandidateSessionConfig> config, | 31 ContentDescription(scoped_ptr<CandidateSessionConfig> config, |
31 scoped_ptr<buzz::XmlElement> authenticator_message); | 32 scoped_ptr<buzz::XmlElement> authenticator_message); |
32 ~ContentDescription(); | 33 ~ContentDescription() override; |
| 34 |
| 35 ContentDescription* Copy() const override; |
33 | 36 |
34 const CandidateSessionConfig* config() const { | 37 const CandidateSessionConfig* config() const { |
35 return candidate_config_.get(); | 38 return candidate_config_.get(); |
36 } | 39 } |
37 | 40 |
38 const buzz::XmlElement* authenticator_message() const { | 41 const buzz::XmlElement* authenticator_message() const { |
39 return authenticator_message_.get(); | 42 return authenticator_message_.get(); |
40 } | 43 } |
41 | 44 |
42 buzz::XmlElement* ToXml() const; | 45 buzz::XmlElement* ToXml() const; |
43 | 46 |
44 static scoped_ptr<ContentDescription> ParseXml( | 47 static scoped_ptr<ContentDescription> ParseXml( |
45 const buzz::XmlElement* element); | 48 const buzz::XmlElement* element); |
46 | 49 |
47 private: | 50 private: |
48 scoped_ptr<const CandidateSessionConfig> candidate_config_; | 51 scoped_ptr<const CandidateSessionConfig> candidate_config_; |
49 scoped_ptr<const buzz::XmlElement> authenticator_message_; | 52 scoped_ptr<const buzz::XmlElement> authenticator_message_; |
50 | 53 |
51 static bool ParseChannelConfigs(const buzz::XmlElement* const element, | 54 static bool ParseChannelConfigs(const buzz::XmlElement* const element, |
52 const char tag_name[], | 55 const char tag_name[], |
53 bool codec_required, | 56 bool codec_required, |
54 bool optional, | 57 bool optional, |
55 std::list<ChannelConfig>* const configs); | 58 std::list<ChannelConfig>* const configs); |
56 }; | 59 }; |
57 | 60 |
58 } // namespace protocol | 61 } // namespace protocol |
59 } // namespace remoting | 62 } // namespace remoting |
60 | 63 |
61 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ | 64 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_ |
OLD | NEW |