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

Unified Diff: remoting/protocol/jingle_session.cc

Issue 2967213002: Fix ASSERT in JingleMessage::OrderedMessageQueue. (Closed)
Patch Set: Created 3 years, 5 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 | « remoting/protocol/jingle_session.h ('k') | remoting/protocol/jingle_session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index dc77271e587768205feb7d08d36e69ec41fd4f12..ae6917b373ea6b98bd01903d46f0fbe3a6c52bdb 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -115,6 +115,9 @@ class JingleSession::OrderedMessageQueue {
const std::string& id,
PendingMessage&& pending_message);
+ // Sets the initial ID of the session initiate message.
+ void setInitialId(const std::string& id);
Sergey Ulanov 2017/07/05 18:00:14 SetInitialiId() please
kelvinp 2017/07/05 22:29:40 Done.
+
private:
// Implements an ordered list by using map with the |sequence_id| as the key,
// so that |queue_| is always sorted by |sequence_id|.
@@ -125,6 +128,12 @@ class JingleSession::OrderedMessageQueue {
DISALLOW_COPY_AND_ASSIGN(OrderedMessageQueue);
};
+void JingleSession::OrderedMessageQueue::setInitialId(const std::string& id) {
Sergey Ulanov 2017/07/05 18:00:14 Put this after OnIncomingMessage() so the order ma
kelvinp 2017/07/05 22:29:41 Done.
+ int current = GetSequentialId(id);
+ if (current != kInvalid)
+ next_incoming_ = current + 1;
+}
+
std::vector<JingleSession::PendingMessage>
JingleSession::OrderedMessageQueue::OnIncomingMessage(
const std::string& id,
@@ -224,6 +233,7 @@ void JingleSession::StartConnection(
}
void JingleSession::InitializeIncomingConnection(
+ const std::string& id,
Sergey Ulanov 2017/07/05 18:00:14 call it message_id.
kelvinp 2017/07/05 22:29:40 Done.
const JingleMessage& initiate_message,
std::unique_ptr<Authenticator> authenticator) {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -234,6 +244,7 @@ void JingleSession::InitializeIncomingConnection(
peer_address_ = initiate_message.from;
authenticator_ = std::move(authenticator);
session_id_ = initiate_message.sid;
+ message_queue_->setInitialId(id);
SetState(ACCEPTING);
« no previous file with comments | « remoting/protocol/jingle_session.h ('k') | remoting/protocol/jingle_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698