Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: remoting/protocol/jingle_messages.cc

Issue 8537020: Send correct termination reason when session is terminated by the host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 static const NameMapElement<JingleMessage::ActionType> kActionTypes[] = { 58 static const NameMapElement<JingleMessage::ActionType> kActionTypes[] = {
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::TRANSPORT_INFO, "transport-info" }, 62 { JingleMessage::TRANSPORT_INFO, "transport-info" },
63 }; 63 };
64 64
65 static const NameMapElement<JingleMessage::Reason> kReasons[] = { 65 static const NameMapElement<JingleMessage::Reason> kReasons[] = {
66 { JingleMessage::SUCCESS, "success" }, 66 { JingleMessage::SUCCESS, "success" },
67 { JingleMessage::DECLINE, "decline" }, 67 { JingleMessage::DECLINE, "decline" },
68 { JingleMessage::GENERAL_ERROR, "general-error" },
68 { JingleMessage::INCOMPATIBLE_PARAMETERS, "incompatible-parameters" }, 69 { JingleMessage::INCOMPATIBLE_PARAMETERS, "incompatible-parameters" },
69 }; 70 };
70 71
71 bool ParseCandidate(const buzz::XmlElement* element, 72 bool ParseCandidate(const buzz::XmlElement* element,
72 cricket::Candidate* candidate) { 73 cricket::Candidate* candidate) {
73 DCHECK(element->Name() == QName(kP2PTransportNamespace, "candidate")); 74 DCHECK(element->Name() == QName(kP2PTransportNamespace, "candidate"));
74 75
75 const std::string& name = element->Attr(QName(kEmptyNamespace, "name")); 76 const std::string& name = element->Attr(QName(kEmptyNamespace, "name"));
76 const std::string& address = element->Attr(QName(kEmptyNamespace, "address")); 77 const std::string& address = element->Attr(QName(kEmptyNamespace, "address"));
77 const std::string& port_str = element->Attr(QName(kEmptyNamespace, "port")); 78 const std::string& port_str = element->Attr(QName(kEmptyNamespace, "port"));
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en"); 396 text_elem->SetAttr(QName(kXmlNamespace, "lang"), "en");
396 text_elem->SetBodyText(error_text); 397 text_elem->SetBodyText(error_text);
397 error->AddElement(text_elem); 398 error->AddElement(text_elem);
398 } 399 }
399 400
400 return iq; 401 return iq;
401 } 402 }
402 403
403 } // namespace protocol 404 } // namespace protocol
404 } // namespace remoting 405 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698