Chromium Code Reviews| Index: remoting/protocol/jingle_session.h |
| diff --git a/remoting/protocol/jingle_session.h b/remoting/protocol/jingle_session.h |
| index 0c16edfe4d84b86123d0f19887dc7ea8bd93ef71..92d6e3786b67789edbdddfa7676d5987edaf5140 100644 |
| --- a/remoting/protocol/jingle_session.h |
| +++ b/remoting/protocol/jingle_session.h |
| @@ -18,6 +18,7 @@ |
| #include "remoting/protocol/authenticator.h" |
| #include "remoting/protocol/datagram_channel_factory.h" |
| #include "remoting/protocol/jingle_messages.h" |
| +#include "remoting/protocol/ordered_message_queue.h" |
| #include "remoting/protocol/session.h" |
| #include "remoting/protocol/session_config.h" |
| #include "remoting/signaling/iq_sender.h" |
| @@ -81,9 +82,15 @@ class JingleSession : public Session { |
| // Called by JingleSessionManager on incoming |message|. Must call |
| // |reply_callback| to send reply message before sending any other |
| // messages. |
| - void OnIncomingMessage(std::unique_ptr<JingleMessage> message, |
| + void OnIncomingMessage(std::string id, |
|
Sergey Ulanov
2016/10/19 21:23:39
const reference please
kelvinp
2016/10/21 00:26:03
Done.
|
| + std::unique_ptr<JingleMessage> message, |
| const ReplyCallback& reply_callback); |
| + // Called by OnIncomingMessage() to process the incoming Jingle messages |
| + // in the same order that they are sent. |
| + void OnIncomingMessageInOrder(std::unique_ptr<JingleMessage> message, |
|
Sergey Ulanov
2016/10/19 21:23:39
Call this ProcessIncomingMessage()?
kelvinp
2016/10/21 00:26:03
Done.
|
| + const ReplyCallback& reply_callback); |
| + |
| // Message handlers for incoming messages. |
| void OnAccept(std::unique_ptr<JingleMessage> message, |
| const ReplyCallback& reply_callback); |
| @@ -135,6 +142,18 @@ class JingleSession : public Session { |
| // Pending transport-info requests. |
| std::list<std::unique_ptr<IqRequest>> transport_info_requests_; |
| + struct PendingMessage { |
| + PendingMessage(std::unique_ptr<JingleMessage> message, |
| + const ReplyCallback& reply_callback); |
| + ~PendingMessage(); |
| + std::unique_ptr<JingleMessage> message; |
| + const ReplyCallback reply_callback; |
| + }; |
| + |
| + // A message queue to guarantee the incoming messages are processed in order. |
| + class OrderedMessageQueue; |
| + std::unique_ptr<OrderedMessageQueue> message_queue_; |
| + |
| base::WeakPtrFactory<JingleSession> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(JingleSession); |