Chromium Code Reviews| 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_JINGLE_MESSAGES_H_ | 5 #ifndef REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ |
| 6 #define REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ | 6 #define REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 | 60 |
| 61 enum Reason { | 61 enum Reason { |
| 62 UNKNOWN_REASON, | 62 UNKNOWN_REASON, |
| 63 SUCCESS, | 63 SUCCESS, |
| 64 DECLINE, | 64 DECLINE, |
| 65 CANCEL, | 65 CANCEL, |
| 66 EXPIRED, | 66 EXPIRED, |
| 67 GENERAL_ERROR, | 67 GENERAL_ERROR, |
| 68 FAILED_APPLICATION, | 68 FAILED_APPLICATION, |
| 69 INCOMPATIBLE_PARAMETERS, | 69 INCOMPATIBLE_PARAMETERS, |
| 70 SECURITY_ERROR, | 70 }; |
| 71 | |
| 72 // Remoting specific error codes to fill the gap between Jingle errors and CRD | |
| 73 // errors. | |
| 74 enum struct ErrorCode { | |
|
Sergey Ulanov
2016/06/01 08:52:47
I don't think we want to add another enum to repre
Hzj_jie
2016/06/01 23:56:13
Done.
| |
| 75 UNKNOWN, | |
| 76 SESSION_REJECTED, | |
| 77 AUTHENTICATION_FAILED, | |
| 78 INVALID_ACCOUNT, | |
| 71 }; | 79 }; |
| 72 | 80 |
| 73 | 81 |
| 74 JingleMessage(); | 82 JingleMessage(); |
| 75 JingleMessage(const SignalingAddress& to, | 83 JingleMessage(const SignalingAddress& to, |
| 76 ActionType action_value, | 84 ActionType action_value, |
| 77 const std::string& sid_value); | 85 const std::string& sid_value); |
| 78 ~JingleMessage(); | 86 ~JingleMessage(); |
| 79 | 87 |
| 80 // Caller keeps ownership of |stanza|. | 88 // Caller keeps ownership of |stanza|. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 98 | 106 |
| 99 std::unique_ptr<buzz::XmlElement> transport_info; | 107 std::unique_ptr<buzz::XmlElement> transport_info; |
| 100 | 108 |
| 101 // Content of session-info messages. | 109 // Content of session-info messages. |
| 102 std::unique_ptr<buzz::XmlElement> info; | 110 std::unique_ptr<buzz::XmlElement> info; |
| 103 | 111 |
| 104 // Value from the <reason> tag if it is present in the | 112 // Value from the <reason> tag if it is present in the |
| 105 // message. Useful mainly for session-terminate messages, but Jingle | 113 // message. Useful mainly for session-terminate messages, but Jingle |
| 106 // spec allows it in any message. | 114 // spec allows it in any message. |
| 107 Reason reason = UNKNOWN_REASON; | 115 Reason reason = UNKNOWN_REASON; |
| 116 | |
| 117 // Value from the <google:remoting:error-code> tag if it is present in the | |
| 118 // message. Useful mainly for session-terminate messages. If it's UNKNOWN, | |
| 119 // or reason is UNKNOWN_REASON, this field will be ignored in the xml output. | |
| 120 ErrorCode error_code = ErrorCode::UNKNOWN; | |
| 108 }; | 121 }; |
| 109 | 122 |
| 110 struct JingleMessageReply { | 123 struct JingleMessageReply { |
| 111 enum ReplyType { | 124 enum ReplyType { |
| 112 REPLY_RESULT, | 125 REPLY_RESULT, |
| 113 REPLY_ERROR, | 126 REPLY_ERROR, |
| 114 }; | 127 }; |
| 115 enum ErrorType { | 128 enum ErrorType { |
| 116 NONE, | 129 NONE, |
| 117 BAD_REQUEST, | 130 BAD_REQUEST, |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 std::unique_ptr<buzz::XmlElement> ToXml() const; | 179 std::unique_ptr<buzz::XmlElement> ToXml() const; |
| 167 | 180 |
| 168 std::list<IceCredentials> ice_credentials; | 181 std::list<IceCredentials> ice_credentials; |
| 169 std::list<NamedCandidate> candidates; | 182 std::list<NamedCandidate> candidates; |
| 170 }; | 183 }; |
| 171 | 184 |
| 172 } // protocol | 185 } // protocol |
| 173 } // remoting | 186 } // remoting |
| 174 | 187 |
| 175 #endif // REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ | 188 #endif // REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ |
| OLD | NEW |