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 #include "remoting/protocol/content_description.h" | 5 #include "remoting/protocol/content_description.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/protocol/authenticator.h" | 10 #include "remoting/protocol/authenticator.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 scoped_ptr<CandidateSessionConfig> config, | 116 scoped_ptr<CandidateSessionConfig> config, |
117 scoped_ptr<buzz::XmlElement> authenticator_message) | 117 scoped_ptr<buzz::XmlElement> authenticator_message) |
118 : candidate_config_(config.Pass()), | 118 : candidate_config_(config.Pass()), |
119 authenticator_message_(authenticator_message.Pass()) { | 119 authenticator_message_(authenticator_message.Pass()) { |
120 } | 120 } |
121 | 121 |
122 ContentDescription::~ContentDescription() { } | 122 ContentDescription::~ContentDescription() { } |
123 | 123 |
124 ContentDescription* ContentDescription::Copy() const { | 124 ContentDescription* ContentDescription::Copy() const { |
125 if (!candidate_config_.get() || !authenticator_message_.get()) { | 125 if (!candidate_config_.get() || !authenticator_message_.get()) { |
126 return NULL; | 126 return nullptr; |
127 } | 127 } |
128 scoped_ptr<XmlElement> message(new XmlElement(*authenticator_message_)); | 128 scoped_ptr<XmlElement> message(new XmlElement(*authenticator_message_)); |
129 return new ContentDescription(candidate_config_->Clone(), message.Pass()); | 129 return new ContentDescription(candidate_config_->Clone(), message.Pass()); |
130 } | 130 } |
131 | 131 |
132 // ToXml() creates content description for chromoting session. The | 132 // ToXml() creates content description for chromoting session. The |
133 // description looks as follows: | 133 // description looks as follows: |
134 // <description xmlns="google:remoting"> | 134 // <description xmlns="google:remoting"> |
135 // <control transport="stream" version="1" /> | 135 // <control transport="stream" version="1" /> |
136 // <event transport="datagram" version="1" /> | 136 // <event transport="datagram" version="1" /> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 const XmlElement* child = Authenticator::FindAuthenticatorMessage(element); | 233 const XmlElement* child = Authenticator::FindAuthenticatorMessage(element); |
234 if (child) | 234 if (child) |
235 authenticator_message.reset(new XmlElement(*child)); | 235 authenticator_message.reset(new XmlElement(*child)); |
236 | 236 |
237 return make_scoped_ptr( | 237 return make_scoped_ptr( |
238 new ContentDescription(config.Pass(), authenticator_message.Pass())); | 238 new ContentDescription(config.Pass(), authenticator_message.Pass())); |
239 } | 239 } |
240 | 240 |
241 } // namespace protocol | 241 } // namespace protocol |
242 } // namespace remoting | 242 } // namespace remoting |
OLD | NEW |