Index: remoting/protocol/jingle_session_manager.h |
diff --git a/remoting/protocol/jingle_chromotocol_server.h b/remoting/protocol/jingle_session_manager.h |
similarity index 62% |
rename from remoting/protocol/jingle_chromotocol_server.h |
rename to remoting/protocol/jingle_session_manager.h |
index 84f7697ce9eb0fe768b8bef6ce73dc77bc1564d1..72410023f19a8c439d9f8246f7b42a5c030ef18f 100644 |
--- a/remoting/protocol/jingle_chromotocol_server.h |
+++ b/remoting/protocol/jingle_session_manager.h |
@@ -2,16 +2,16 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef REMOTING_PROTOCOL_JINGLE_CHROMOTOCOL_SERVER_H_ |
-#define REMOTING_PROTOCOL_JINGLE_CHROMOTOCOL_SERVER_H_ |
+#ifndef REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
+#define REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |
#include <list> |
#include <string> |
#include "base/lock.h" |
#include "base/ref_counted.h" |
-#include "remoting/protocol/chromotocol_server.h" |
-#include "remoting/protocol/jingle_chromotocol_connection.h" |
+#include "remoting/protocol/jingle_session.h" |
+#include "remoting/protocol/session_manager.h" |
#include "third_party/libjingle/source/talk/p2p/base/session.h" |
#include "third_party/libjingle/source/talk/p2p/base/sessionclient.h" |
#include "third_party/libjingle/source/talk/p2p/base/sessiondescription.h" |
@@ -26,15 +26,16 @@ namespace remoting { |
class JingleThread; |
+namespace protocol { |
+ |
// ContentDescription used for chromoting sessions. It simply wraps |
// CandidateChromotocolConfig. CandidateChromotocolConfig doesn't inherit |
// from ContentDescription to avoid dependency on libjingle in |
-// ChromotocolConnection interface. |
-class ChromotocolContentDescription : public cricket::ContentDescription { |
+// Chromotocol Session interface. |
+class ContentDescription : public cricket::ContentDescription { |
public: |
- explicit ChromotocolContentDescription( |
- const CandidateChromotocolConfig* config); |
- ~ChromotocolContentDescription(); |
+ explicit ContentDescription(const CandidateChromotocolConfig* config); |
+ ~ContentDescription(); |
const CandidateChromotocolConfig* config() const { |
return candidate_config_.get(); |
@@ -47,33 +48,33 @@ class ChromotocolContentDescription : public cricket::ContentDescription { |
// This class implements SessionClient for Chromoting sessions. It acts as a |
// server that accepts chromoting connections and can also make new connections |
// to other hosts. |
-class JingleChromotocolServer |
- : public ChromotocolServer, |
+class JingleSessionManager |
+ : public protocol::SessionManager, |
public cricket::SessionClient { |
public: |
- explicit JingleChromotocolServer(JingleThread* jingle_thread); |
+ explicit JingleSessionManager(remoting::JingleThread* jingle_thread); |
// Initializes the session client. Doesn't accept ownership of the |
// |session_manager|. Close() must be called _before_ the |session_manager| |
// is destroyed. |
virtual void Init(const std::string& local_jid, |
- cricket::SessionManager* session_manager, |
- IncomingConnectionCallback* incoming_connection_callback); |
+ cricket::SessionManager* cricket_session_manager, |
+ IncomingSessionCallback* incoming_session_callback); |
// ChromotocolServer interface. |
- virtual scoped_refptr<ChromotocolConnection> Connect( |
+ virtual scoped_refptr<protocol::Session> Connect( |
const std::string& jid, |
CandidateChromotocolConfig* chromotocol_config, |
- ChromotocolConnection::StateChangeCallback* state_change_callback); |
+ protocol::Session::StateChangeCallback* state_change_callback); |
virtual void Close(Task* closed_task); |
void set_allow_local_ips(bool allow_local_ips); |
protected: |
- virtual ~JingleChromotocolServer(); |
+ virtual ~JingleSessionManager(); |
private: |
- friend class JingleChromotocolConnection; |
+ friend class JingleSession; |
// The jingle thread used by this object. |
JingleThread* jingle_thread(); |
@@ -82,22 +83,22 @@ class JingleChromotocolServer |
MessageLoop* message_loop(); |
// Called by JingleChromotocolConnection when a new connection is initiated. |
- void AcceptConnection(JingleChromotocolConnection* connection, |
- cricket::Session* session); |
+ void AcceptConnection(JingleSession* jingle_session, |
+ cricket::Session* cricket_session); |
void DoConnect( |
- scoped_refptr<JingleChromotocolConnection> connection, |
+ scoped_refptr<JingleSession> jingle_session, |
const std::string& jid, |
- ChromotocolConnection::StateChangeCallback* state_change_callback); |
+ protocol::Session::StateChangeCallback* state_change_callback); |
- // Creates outgoing session description for an incoming connection. |
+ // Creates outgoing session description for an incoming session. |
cricket::SessionDescription* CreateSessionDescription( |
const CandidateChromotocolConfig* config); |
// cricket::SessionClient interface. |
- virtual void OnSessionCreate(cricket::Session* session, |
+ virtual void OnSessionCreate(cricket::Session* cricket_session, |
bool received_initiate); |
- virtual void OnSessionDestroy(cricket::Session* session); |
+ virtual void OnSessionDestroy(cricket::Session* cricket_session); |
virtual bool ParseContent(cricket::SignalingProtocol protocol, |
const buzz::XmlElement* elem, |
@@ -110,17 +111,19 @@ class JingleChromotocolServer |
std::string local_jid_; |
JingleThread* jingle_thread_; |
- cricket::SessionManager* session_manager_; |
- scoped_ptr<IncomingConnectionCallback> incoming_connection_callback_; |
+ cricket::SessionManager* cricket_session_manager_; |
+ scoped_ptr<IncomingSessionCallback> incoming_session_callback_; |
bool allow_local_ips_; |
bool closed_; |
- std::list<scoped_refptr<JingleChromotocolConnection> > connections_; |
+ std::list<scoped_refptr<JingleSession> > sessions_; |
- DISALLOW_COPY_AND_ASSIGN(JingleChromotocolServer); |
+ DISALLOW_COPY_AND_ASSIGN(JingleSessionManager); |
}; |
+} // namespace protocol |
+ |
} // namespace remoting |
-#endif // REMOTING_PROTOCOL_JINGLE_CHROMOTOCOL_SERVER_H_ |
+#endif // REMOTING_PROTOCOL_JINGLE_SESSION_MANAGER_H_ |