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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 ~JingleMessage(); | 83 ~JingleMessage(); |
84 | 84 |
85 // Caller keeps ownership of |stanza|. | 85 // Caller keeps ownership of |stanza|. |
86 static bool IsJingleMessage(const buzz::XmlElement* stanza); | 86 static bool IsJingleMessage(const buzz::XmlElement* stanza); |
87 static std::string GetActionName(ActionType action); | 87 static std::string GetActionName(ActionType action); |
88 | 88 |
89 // Caller keeps ownership of |stanza|. |error| is set to debug error | 89 // Caller keeps ownership of |stanza|. |error| is set to debug error |
90 // message when parsing fails. | 90 // message when parsing fails. |
91 bool ParseXml(const buzz::XmlElement* stanza, std::string* error); | 91 bool ParseXml(const buzz::XmlElement* stanza, std::string* error); |
92 | 92 |
| 93 // Adds an XmlElement into |attachments|. This function implicitly creates |
| 94 // |attachments| if it's empty, and |attachment| should not be an empty |
| 95 // unique_ptr. |
| 96 void AddAttachment(std::unique_ptr<buzz::XmlElement> attachment); |
| 97 |
93 std::unique_ptr<buzz::XmlElement> ToXml() const; | 98 std::unique_ptr<buzz::XmlElement> ToXml() const; |
94 | 99 |
95 SignalingAddress from; | 100 SignalingAddress from; |
96 SignalingAddress to; | 101 SignalingAddress to; |
97 ActionType action = UNKNOWN_ACTION; | 102 ActionType action = UNKNOWN_ACTION; |
98 std::string sid; | 103 std::string sid; |
99 | 104 |
100 std::string initiator; | 105 std::string initiator; |
101 | 106 |
102 std::unique_ptr<ContentDescription> description; | 107 std::unique_ptr<ContentDescription> description; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 std::unique_ptr<buzz::XmlElement> ToXml() const; | 185 std::unique_ptr<buzz::XmlElement> ToXml() const; |
181 | 186 |
182 std::list<IceCredentials> ice_credentials; | 187 std::list<IceCredentials> ice_credentials; |
183 std::list<NamedCandidate> candidates; | 188 std::list<NamedCandidate> candidates; |
184 }; | 189 }; |
185 | 190 |
186 } // protocol | 191 } // protocol |
187 } // remoting | 192 } // remoting |
188 | 193 |
189 #endif // REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ | 194 #endif // REMOTING_PROTOCOL_JINGLE_MESSAGES_H_ |
OLD | NEW |