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

Unified Diff: remoting/protocol/jingle_session.h

Issue 2417913002: Process incoming IQs in the same order that they were sent. (Closed)
Patch Set: Reviewer's feedback Created 4 years, 2 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_session.cc » ('j') | remoting/protocol/jingle_session.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | remoting/protocol/jingle_session.cc » ('j') | remoting/protocol/jingle_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698