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/jingle_messages.h" | 5 #include "remoting/protocol/jingle_messages.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "remoting/base/constants.h" | 9 #include "remoting/base/constants.h" |
10 #include "remoting/protocol/content_description.h" | 10 #include "remoting/protocol/content_description.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 { JingleMessage::SESSION_INITIATE, "session-initiate" }, | 59 { JingleMessage::SESSION_INITIATE, "session-initiate" }, |
60 { JingleMessage::SESSION_ACCEPT, "session-accept" }, | 60 { JingleMessage::SESSION_ACCEPT, "session-accept" }, |
61 { JingleMessage::SESSION_TERMINATE, "session-terminate" }, | 61 { JingleMessage::SESSION_TERMINATE, "session-terminate" }, |
62 { JingleMessage::SESSION_INFO, "session-info" }, | 62 { JingleMessage::SESSION_INFO, "session-info" }, |
63 { JingleMessage::TRANSPORT_INFO, "transport-info" }, | 63 { JingleMessage::TRANSPORT_INFO, "transport-info" }, |
64 }; | 64 }; |
65 | 65 |
66 const NameMapElement<JingleMessage::Reason> kReasons[] = { | 66 const NameMapElement<JingleMessage::Reason> kReasons[] = { |
67 { JingleMessage::SUCCESS, "success" }, | 67 { JingleMessage::SUCCESS, "success" }, |
68 { JingleMessage::DECLINE, "decline" }, | 68 { JingleMessage::DECLINE, "decline" }, |
| 69 { JingleMessage::CANCEL, "cancel" }, |
69 { JingleMessage::GENERAL_ERROR, "general-error" }, | 70 { JingleMessage::GENERAL_ERROR, "general-error" }, |
70 { JingleMessage::INCOMPATIBLE_PARAMETERS, "incompatible-parameters" }, | 71 { JingleMessage::INCOMPATIBLE_PARAMETERS, "incompatible-parameters" }, |
71 }; | 72 }; |
72 | 73 |
73 bool ParseCandidate(const buzz::XmlElement* element, | 74 bool ParseCandidate(const buzz::XmlElement* element, |
74 cricket::Candidate* candidate) { | 75 cricket::Candidate* candidate) { |
75 DCHECK(element->Name() == QName(kP2PTransportNamespace, "candidate")); | 76 DCHECK(element->Name() == QName(kP2PTransportNamespace, "candidate")); |
76 | 77 |
77 const std::string& name = element->Attr(QName(kEmptyNamespace, "name")); | 78 const std::string& name = element->Attr(QName(kEmptyNamespace, "name")); |
78 const std::string& address = element->Attr(QName(kEmptyNamespace, "address")); | 79 const std::string& address = element->Attr(QName(kEmptyNamespace, "address")); |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); | 435 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); |
435 text_elem->SetBodyText(error_text); | 436 text_elem->SetBodyText(error_text); |
436 error->AddElement(text_elem); | 437 error->AddElement(text_elem); |
437 } | 438 } |
438 | 439 |
439 return iq.Pass(); | 440 return iq.Pass(); |
440 } | 441 } |
441 | 442 |
442 } // namespace protocol | 443 } // namespace protocol |
443 } // namespace remoting | 444 } // namespace remoting |
OLD | NEW |