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

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

Issue 6623048: Replace libjingle's HttpPortAllocatorSession with Pepper's http client (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thread switching Created 9 years, 9 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 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 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/ref_counted.h" 10 #include "base/ref_counted.h"
11 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
12 #include "base/task.h" 12 #include "base/task.h"
13 #include "remoting/jingle_glue/jingle_client.h" 13 #include "remoting/jingle_glue/jingle_client.h"
14 #include "remoting/proto/internal.pb.h" 14 #include "remoting/proto/internal.pb.h"
15 #include "remoting/protocol/connection_to_host.h" 15 #include "remoting/protocol/connection_to_host.h"
16 #include "remoting/protocol/host_stub.h" 16 #include "remoting/protocol/host_stub.h"
17 #include "remoting/protocol/input_stub.h" 17 #include "remoting/protocol/input_stub.h"
18 #include "remoting/protocol/message_reader.h" 18 #include "remoting/protocol/message_reader.h"
19 #include "remoting/protocol/session.h" 19 #include "remoting/protocol/session.h"
20 #include "remoting/protocol/session_manager.h" 20 #include "remoting/protocol/session_manager.h"
21 21
22 class MessageLoop; 22 class MessageLoop;
23 23
24 namespace remoting { 24 namespace remoting {
25 25
26 class JingleThread; 26 class JingleThread;
27 class PortAllocatorSessionFactory;
27 class VideoPacket; 28 class VideoPacket;
28 29
29 namespace protocol { 30 namespace protocol {
30 31
31 class ClientMessageDispatcher; 32 class ClientMessageDispatcher;
32 class ClientStub; 33 class ClientStub;
33 class SessionConfig; 34 class SessionConfig;
34 class VideoReader; 35 class VideoReader;
35 class VideoStub; 36 class VideoStub;
36 37
(...skipping 12 matching lines...) Expand all
49 // Called when the network connection has failed. 50 // Called when the network connection has failed.
50 virtual void OnConnectionFailed(ConnectionToHost* conn) = 0; 51 virtual void OnConnectionFailed(ConnectionToHost* conn) = 0;
51 }; 52 };
52 53
53 // Takes ownership of |network_manager| and |socket_factory|. Both 54 // Takes ownership of |network_manager| and |socket_factory|. Both
54 // |network_manager| and |socket_factory| may be set to NULL. 55 // |network_manager| and |socket_factory| may be set to NULL.
55 // 56 //
56 // TODO(sergeyu): Constructor shouldn't need thread here. 57 // TODO(sergeyu): Constructor shouldn't need thread here.
57 ConnectionToHost(JingleThread* thread, 58 ConnectionToHost(JingleThread* thread,
58 talk_base::NetworkManager* network_manager, 59 talk_base::NetworkManager* network_manager,
59 talk_base::PacketSocketFactory* socket_factory); 60 talk_base::PacketSocketFactory* socket_factory,
61 PortAllocatorSessionFactory* session_factory);
60 virtual ~ConnectionToHost(); 62 virtual ~ConnectionToHost();
61 63
62 // TODO(ajwong): We need to generalize this API. 64 // TODO(ajwong): We need to generalize this API.
63 virtual void Connect(const std::string& username, 65 virtual void Connect(const std::string& username,
64 const std::string& auth_token, 66 const std::string& auth_token,
65 const std::string& host_jid, 67 const std::string& host_jid,
66 HostEventCallback* event_callback, 68 HostEventCallback* event_callback,
67 ClientStub* client_stub, 69 ClientStub* client_stub,
68 VideoStub* video_stub); 70 VideoStub* video_stub);
69 virtual void Disconnect(); 71 virtual void Disconnect();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 108
107 // Initially false, this is set to true once the client has authenticated 109 // Initially false, this is set to true once the client has authenticated
108 // properly. When this is false, many messages to the host (like input events) 110 // properly. When this is false, many messages to the host (like input events)
109 // will be suppressed. 111 // will be suppressed.
110 bool client_authenticated_; 112 bool client_authenticated_;
111 113
112 JingleThread* thread_; 114 JingleThread* thread_;
113 115
114 scoped_ptr<talk_base::NetworkManager> network_manager_; 116 scoped_ptr<talk_base::NetworkManager> network_manager_;
115 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; 117 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_;
118 scoped_ptr<PortAllocatorSessionFactory> port_allocator_session_factory_;
116 119
117 scoped_ptr<SignalStrategy> signal_strategy_; 120 scoped_ptr<SignalStrategy> signal_strategy_;
118 scoped_refptr<JingleClient> jingle_client_; 121 scoped_refptr<JingleClient> jingle_client_;
119 scoped_refptr<SessionManager> session_manager_; 122 scoped_refptr<SessionManager> session_manager_;
120 scoped_refptr<Session> session_; 123 scoped_refptr<Session> session_;
121 124
122 scoped_ptr<VideoReader> video_reader_; 125 scoped_ptr<VideoReader> video_reader_;
123 126
124 HostEventCallback* event_callback_; 127 HostEventCallback* event_callback_;
125 128
(...skipping 25 matching lines...) Expand all
151 private: 154 private:
152 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); 155 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost);
153 }; 156 };
154 157
155 } // namespace protocol 158 } // namespace protocol
156 } // namespace remoting 159 } // namespace remoting
157 160
158 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::ConnectionToHost); 161 DISABLE_RUNNABLE_METHOD_REFCOUNT(remoting::protocol::ConnectionToHost);
159 162
160 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ 163 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698