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

Unified Diff: remoting/protocol/jingle_session.h

Issue 9452038: Implement timeouts for IQ requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix release build Created 8 years, 10 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_messages.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »
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 f092402606200e029fb1f8f1558430adc9e01222..c747250da52efd1f86a2a3ba6774b75b1a0c3f6a 100644
--- a/remoting/protocol/jingle_session.h
+++ b/remoting/protocol/jingle_session.h
@@ -13,6 +13,7 @@
#include "base/timer.h"
#include "crypto/rsa_private_key.h"
#include "net/base/completion_callback.h"
+#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/protocol/authenticator.h"
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/session.h"
@@ -25,9 +26,6 @@ class StreamSocket;
} // namespace net
namespace remoting {
-
-class IqRequest;
-
namespace protocol {
class JingleSessionManager;
@@ -86,8 +84,15 @@ class JingleSession : public Session,
scoped_ptr<Authenticator> authenticator);
void AcceptIncomingConnection(const JingleMessage& initiate_message);
- // Handler for session-initiate response.
- void OnSessionInitiateResponse(const buzz::XmlElement* response);
+ // Helper to send IqRequests to the peer. It sets up the response
+ // callback to OnMessageResponse() which simply terminates the
+ // session whenever a request fails or times out. This method should
+ // not be used for messages that need to be handled differently.
+ void SendMessage(const JingleMessage& message);
+ void OnMessageResponse(JingleMessage::ActionType request_type,
+ IqRequest* request,
+ const buzz::XmlElement* response);
+ void CleanupPendingRequests(IqRequest* request);
// Called by JingleSessionManager on incoming |message|. Must call
// |reply_callback| to send reply message before sending any other
@@ -108,10 +113,8 @@ class JingleSession : public Session,
bool InitializeConfigFromDescription(const ContentDescription* description);
void ProcessAuthenticationStep();
- void OnSessionInfoResponse(const buzz::XmlElement* response);
void SendTransportInfo();
- void OnTransportInfoResponse(const buzz::XmlElement* response);
// Terminates the session and sends session-terminate if it is
// necessary. |error| specifies the error code in case when the
@@ -136,9 +139,10 @@ class JingleSession : public Session,
scoped_ptr<Authenticator> authenticator_;
- scoped_ptr<IqRequest> initiate_request_;
- scoped_ptr<IqRequest> session_info_request_;
- scoped_ptr<IqRequest> transport_info_request_;
+ // Container for pending Iq requests. Requests are removed in
+ // CleanupPendingRequests() which is called when a response is
+ // received or one of the requests times out.
+ std::list<IqRequest*> pending_requests_;
ChannelsMap channels_;
« no previous file with comments | « remoting/protocol/jingle_messages.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698