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

Unified Diff: remoting/protocol/jingle_session.h

Issue 1545743002: Move ownership of Transport out of Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass_client
Patch Set: Created 5 years 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/ice_transport_unittest.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 ba1172d64c23cecb495ff0cb50ab57dacb89d7e1..87a98c7b12e654e6d5eedf9d4679f777c92bff05 100644
--- a/remoting/protocol/jingle_session.h
+++ b/remoting/protocol/jingle_session.h
@@ -11,7 +11,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/threading/non_thread_safe.h"
+#include "base/threading/thread_checker.h"
#include "base/timer/timer.h"
#include "crypto/rsa_private_key.h"
#include "net/base/completion_callback.h"
@@ -20,20 +20,18 @@
#include "remoting/protocol/jingle_messages.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/session_config.h"
-#include "remoting/protocol/transport.h"
#include "remoting/signaling/iq_sender.h"
namespace remoting {
namespace protocol {
class JingleSessionManager;
+class Transport;
// JingleSessionManager and JingleSession implement the subset of the
// Jingle protocol used in Chromoting. Instances of this class are
// created by the JingleSessionManager.
-class JingleSession : public base::NonThreadSafe,
- public Session,
- public Transport::EventHandler {
+class JingleSession : public Session {
public:
~JingleSession() override;
@@ -42,7 +40,7 @@ class JingleSession : public base::NonThreadSafe,
ErrorCode error() override;
const std::string& jid() override;
const SessionConfig& config() override;
- Transport* GetTransport() override;
+ void SetTransport(Transport* transport) override;
void Close(protocol::ErrorCode error) override;
private:
@@ -61,6 +59,9 @@ class JingleSession : public base::NonThreadSafe,
scoped_ptr<Authenticator> authenticator);
void AcceptIncomingConnection(const JingleMessage& initiate_message);
+ // Callback for Transport interface to send transport-info messages.
+ void SendTransportInfo(scoped_ptr<buzz::XmlElement> transport_info);
+
// Sends |message| to the peer. The session is closed if the send fails or no
// response is received within a reasonable time. All other responses are
// ignored.
@@ -71,14 +72,6 @@ class JingleSession : public base::NonThreadSafe,
IqRequest* request,
const buzz::XmlElement* response);
- // Transport::EventHandler interface.
- void OnOutgoingTransportInfo(
- scoped_ptr<buzz::XmlElement> transport_info) override;
- void OnTransportRouteChange(const std::string& component,
- const TransportRoute& route) override;
- void OnTransportConnected() override;
- void OnTransportError(ErrorCode error) override;
-
// Response handler for transport-info responses. Transport-info timeouts are
// ignored and don't terminate connection.
void OnTransportInfoResponse(IqRequest* request,
@@ -119,6 +112,8 @@ class JingleSession : public base::NonThreadSafe,
// Returns true if the state of the session is not CLOSED or FAILED
bool is_session_active();
+ base::ThreadChecker thread_checker_;
+
JingleSessionManager* session_manager_;
std::string peer_jid_;
Session::EventHandler* event_handler_;
@@ -131,7 +126,7 @@ class JingleSession : public base::NonThreadSafe,
scoped_ptr<Authenticator> authenticator_;
- scoped_ptr<Transport> transport_;
+ Transport* transport_ = nullptr;
// Pending Iq requests. Used for all messages except transport-info.
std::set<IqRequest*> pending_requests_;
« no previous file with comments | « remoting/protocol/ice_transport_unittest.cc ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698