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
3 // found in the LICENSE file.
5 #ifndef REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_
6 #define REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/ref_counted.h"
12 #include "remoting/protocol/session_config.h"
13 #include "third_party/libjingle/source/talk/p2p/base/sessiondescription.h"
22 // ContentDescription used for chromoting sessions. It contains the information
23 // from the content description stanza in the session intialization handshake.
25 // This class also provides a type abstraction so that the Chromotocol Session
26 // interface does not need to depend on libjingle.
27 class ContentDescription
: public cricket::ContentDescription
{
29 static const char kChromotingContentName
[];
31 ContentDescription(scoped_ptr
<CandidateSessionConfig
> config
,
32 scoped_ptr
<buzz::XmlElement
> authenticator_message
);
33 virtual ~ContentDescription();
35 virtual ContentDescription
* Copy() const OVERRIDE
;
37 const CandidateSessionConfig
* config() const {
38 return candidate_config_
.get();
41 const buzz::XmlElement
* authenticator_message() const {
42 return authenticator_message_
.get();
45 buzz::XmlElement
* ToXml() const;
47 static scoped_ptr
<ContentDescription
> ParseXml(
48 const buzz::XmlElement
* element
);
51 scoped_ptr
<const CandidateSessionConfig
> candidate_config_
;
52 scoped_ptr
<const buzz::XmlElement
> authenticator_message_
;
54 static bool ParseChannelConfigs(const buzz::XmlElement
* const element
,
55 const char tag_name
[],
58 std::vector
<ChannelConfig
>* const configs
);
61 } // namespace protocol
62 } // namespace remoting
64 #endif // REMOTING_PROTOCOL_CONTENT_DESCRIPTION_H_