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

Unified Diff: remoting/protocol/jingle_messages.h

Issue 1984383003: Support LCS signaling address in the Host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add DCHECK Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/protocol/jingle_messages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_messages.h
diff --git a/remoting/protocol/jingle_messages.h b/remoting/protocol/jingle_messages.h
index e81d86237cca6cb624df75b76280721df78c646a..c7304cce023b80aa37a01c40976e3e1d382d8dff 100644
--- a/remoting/protocol/jingle_messages.h
+++ b/remoting/protocol/jingle_messages.h
@@ -17,6 +17,37 @@ namespace protocol {
class ContentDescription;
+// Represents an address of a Chromoting endpoint and its routing channel.
+// TODO(kelvinp): Move the struct to remoting/signaling. Potentially we could
+// update SignalStrategy interface to use this instead of jid for addressing.
+struct SignalingAddress {
+ enum class Channel { LCS, XMPP };
+
+ SignalingAddress();
+ SignalingAddress(const std::string& jid);
+ SignalingAddress(const std::string& jid,
+ const std::string& endpoint_id,
+ Channel channel);
+
+ // Represents the |to| or |from| field in an IQ stanza.
+ std::string jid;
+
+ // Represents the identifier of an endpoint. In LCS, this is the LCS address
+ // encoded in a JID like format. In XMPP, it is empty.
+ std::string endpoint_id;
+
+ Channel channel;
+
+ inline const std::string& id() const {
+ return (channel == Channel::LCS) ? endpoint_id : jid;
+ }
+
+ inline bool empty() const { return jid.empty(); }
+
+ bool operator==(const SignalingAddress& other);
+ bool operator!=(const SignalingAddress& other);
+};
+
struct JingleMessage {
enum ActionType {
UNKNOWN_ACTION,
@@ -40,7 +71,7 @@ struct JingleMessage {
JingleMessage();
- JingleMessage(const std::string& to_value,
+ JingleMessage(const SignalingAddress& to,
ActionType action_value,
const std::string& sid_value);
~JingleMessage();
@@ -55,8 +86,8 @@ struct JingleMessage {
std::unique_ptr<buzz::XmlElement> ToXml() const;
- std::string from;
- std::string to;
+ SignalingAddress from;
+ SignalingAddress to;
ActionType action = UNKNOWN_ACTION;
std::string sid;
« no previous file with comments | « no previous file | remoting/protocol/jingle_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698