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

Side by Side Diff: remoting/protocol/jingle_connection_to_host.h

Issue 6030007: Chromoting protocol layers to receive and send login messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix style Created 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // JingleConnectionToHost implements the ConnectionToHost interface using 5 // JingleConnectionToHost implements the ConnectionToHost interface using
6 // libjingle as the transport protocol. 6 // libjingle as the transport protocol.
7 // 7 //
8 // Much of this class focuses on translating JingleClient and 8 // Much of this class focuses on translating JingleClient and
9 // ChromotingConnection callbacks into ConnectionToHost::HostEventCallback 9 // ChromotingConnection callbacks into ConnectionToHost::HostEventCallback
10 // messages. 10 // messages.
(...skipping 19 matching lines...) Expand all
30 30
31 class MessageLoop; 31 class MessageLoop;
32 32
33 namespace remoting { 33 namespace remoting {
34 34
35 class JingleThread; 35 class JingleThread;
36 class VideoPacket; 36 class VideoPacket;
37 37
38 namespace protocol { 38 namespace protocol {
39 39
40 class ClientMessageDispatcher;
40 class VideoReader; 41 class VideoReader;
41 class VideoStub; 42 class VideoStub;
42 43
43 class JingleConnectionToHost : public ConnectionToHost, 44 class JingleConnectionToHost : public ConnectionToHost,
44 public JingleClient::Callback { 45 public JingleClient::Callback {
45 public: 46 public:
46 // TODO(sergeyu): Constructor shouldn't need thread here. 47 // TODO(sergeyu): Constructor shouldn't need thread here.
47 explicit JingleConnectionToHost(JingleThread* thread); 48 explicit JingleConnectionToHost(JingleThread* thread);
48 virtual ~JingleConnectionToHost(); 49 virtual ~JingleConnectionToHost();
49 50
50 virtual void Connect(const std::string& username, 51 virtual void Connect(const std::string& username,
51 const std::string& auth_token, 52 const std::string& auth_token,
52 const std::string& host_jid, 53 const std::string& host_jid,
53 HostEventCallback* event_callback, 54 HostEventCallback* event_callback,
54 ClientStub* client_stub, 55 ClientStub* client_stub,
55 VideoStub* video_stub); 56 VideoStub* video_stub);
56 virtual void Disconnect(); 57 virtual void Disconnect();
57 58
58 virtual const SessionConfig* config(); 59 virtual const SessionConfig* config();
59 60
60 // JingleClient::Callback interface. 61 // JingleClient::Callback interface.
61 virtual void OnStateChange(JingleClient* client, JingleClient::State state); 62 virtual void OnStateChange(JingleClient* client, JingleClient::State state);
62 63
63 // Callback for chromotocol SessionManager. 64 // Callback for chromotocol SessionManager.
64 void OnNewSession( 65 void OnNewSession(
65 protocol::Session* connection, 66 Session* connection,
66 protocol::SessionManager::IncomingSessionResponse* response); 67 SessionManager::IncomingSessionResponse* response);
67 68
68 // Callback for chromotocol Session. 69 // Callback for chromotocol Session.
69 void OnSessionStateChange(protocol::Session::State state); 70 void OnSessionStateChange(Session::State state);
70 71
71 private: 72 private:
72 // The message loop for the jingle thread this object works on. 73 // The message loop for the jingle thread this object works on.
73 MessageLoop* message_loop(); 74 MessageLoop* message_loop();
74 75
75 // Called on the jingle thread after we've successfully to XMPP server. Starts 76 // Called on the jingle thread after we've successfully to XMPP server. Starts
76 // P2P connection to the host. 77 // P2P connection to the host.
77 void InitSession(); 78 void InitSession();
78 79
79 // Callback for |control_reader_|. 80 // Callback for |control_reader_|.
80 void OnControlMessage(ControlMessage* msg); 81 void OnControlMessage(ControlMessage* msg);
81 82
82 // Callback for |video_reader_|. 83 // Callback for |video_reader_|.
83 void OnVideoPacket(VideoPacket* packet); 84 void OnVideoPacket(VideoPacket* packet);
84 85
85 // Used by Disconnect() to disconnect chromoting connection, stop chromoting 86 // Used by Disconnect() to disconnect chromoting connection, stop chromoting
86 // server, and then disconnect XMPP connection. 87 // server, and then disconnect XMPP connection.
87 void OnDisconnected(); 88 void OnDisconnected();
88 void OnServerClosed(); 89 void OnServerClosed();
89 90
90 JingleThread* thread_; 91 JingleThread* thread_;
91 92
92 scoped_refptr<JingleClient> jingle_client_; 93 scoped_refptr<JingleClient> jingle_client_;
93 scoped_refptr<protocol::SessionManager> session_manager_; 94 scoped_refptr<SessionManager> session_manager_;
94 scoped_refptr<protocol::Session> session_; 95 scoped_refptr<Session> session_;
95 96
96 MessageReader control_reader_; 97 MessageReader control_reader_;
97 scoped_ptr<VideoReader> video_reader_; 98 scoped_ptr<VideoReader> video_reader_;
98 99
99 HostEventCallback* event_callback_; 100 HostEventCallback* event_callback_;
100 VideoStub* video_stub_; 101 VideoStub* video_stub_;
101 102
102 std::string host_jid_; 103 std::string host_jid_;
103 104
105 scoped_ptr<ClientMessageDispatcher> dispatcher_;
106
104 DISALLOW_COPY_AND_ASSIGN(JingleConnectionToHost); 107 DISALLOW_COPY_AND_ASSIGN(JingleConnectionToHost);
105 }; 108 };
106 109
107 } // namespace protocol 110 } // namespace protocol
108 } // namespace remoting 111 } // namespace remoting
109 112
110 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::JingleConnectionToHost); 113 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::JingleConnectionToHost);
111 114
112 #endif // REMOTING_PROTOCOL_JINGLE_CONNECTION_TO_HOST_H_ 115 #endif // REMOTING_PROTOCOL_JINGLE_CONNECTION_TO_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698