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

Side by Side Diff: remoting/client/plugin/pepper_port_allocator_session.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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_
6 #define REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_
7
8 #include "base/message_loop.h"
9 #include "ppapi/cpp/completion_callback.h"
10 #include "third_party/libjingle/source/talk/p2p/client/basicportallocator.h"
11
12 namespace remoting {
13
14 class ChromotingInstance;
15 class PepperCreateSessionTask;
16 class PepperURLFetcher;
17 class PortAllocatorSessionFactory;
18
19 class PepperPortAllocatorSession : public cricket::BasicPortAllocatorSession {
20 public:
21 PepperPortAllocatorSession(
22 ChromotingInstance* instance,
23 MessageLoop* message_loop,
24 cricket::BasicPortAllocator* allocator,
25 const std::string& name,
26 const std::string& session_type,
27 const std::vector<talk_base::SocketAddress>& stun_hosts,
28 const std::vector<std::string>& relay_hosts,
29 const std::string& relay,
30 const std::string& agent);
31 virtual ~PepperPortAllocatorSession();
32
33 const std::string& relay_token() const {
34 return relay_token_;
35 }
36 virtual void SendSessionRequest(const std::string& host, int port);
Sergey Ulanov 2011/03/07 12:58:45 Add comments that these are overrides. Maybe add O
Alpha Left Google 2011/03/07 18:02:29 Done.
37 virtual void ReceiveSessionResponse(const std::string& response);
38
39 void OnRequestDone(bool success, int status_code,
40 const std::string& response);
41
42 static PortAllocatorSessionFactory* CreateFactory(
Sergey Ulanov 2011/03/07 12:58:45 It doesn't look right, that the object creates fac
Alpha Left Google 2011/03/07 18:02:29 I'll make this a method in the namespace but I don
43 ChromotingInstance* instance);
44
45 private:
46 virtual void GetPortConfigurations();
47 void TryCreateRelaySession();
48
49 ChromotingInstance* const instance_;
50 MessageLoop* const jingle_message_loop_;
51
52 std::vector<std::string> relay_hosts_;
53 std::vector<talk_base::SocketAddress> stun_hosts_;
54 std::string relay_token_;
55 std::string agent_;
56 int attempts_;
57
58 scoped_refptr<PepperCreateSessionTask> create_session_task_;
59
60 DISALLOW_COPY_AND_ASSIGN(PepperPortAllocatorSession);
61 };
62
63 } // namespace remoting
64
65 #endif // REMOTING_CLIENT_PLUGIN_PEPPER_PORT_ALLOCATOR_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698