OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 5 #ifndef CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
6 #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 6 #define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // HttpPortAllocator. Refactor HttpPortAllocator | 27 // HttpPortAllocator. Refactor HttpPortAllocator |
28 class P2PPortAllocator : public cricket::BasicPortAllocator { | 28 class P2PPortAllocator : public cricket::BasicPortAllocator { |
29 public: | 29 public: |
30 P2PPortAllocator(WebKit::WebFrame* web_frame, | 30 P2PPortAllocator(WebKit::WebFrame* web_frame, |
31 P2PSocketDispatcher* socket_dispatcher, | 31 P2PSocketDispatcher* socket_dispatcher, |
32 talk_base::NetworkManager* network_manager, | 32 talk_base::NetworkManager* network_manager, |
33 talk_base::PacketSocketFactory* socket_factory, | 33 talk_base::PacketSocketFactory* socket_factory, |
34 const webkit_glue::P2PTransport::Config& config); | 34 const webkit_glue::P2PTransport::Config& config); |
35 virtual ~P2PPortAllocator(); | 35 virtual ~P2PPortAllocator(); |
36 | 36 |
37 virtual cricket::PortAllocatorSession* CreateSession( | 37 virtual cricket::PortAllocatorSession* CreateSessionInternal( |
38 const std::string& channel_name, | 38 int component, |
39 int component) OVERRIDE; | 39 const std::string& ice_username_fragment, |
| 40 const std::string& ice_password) OVERRIDE; |
40 | 41 |
41 private: | 42 private: |
42 friend class P2PPortAllocatorSession; | 43 friend class P2PPortAllocatorSession; |
43 | 44 |
44 WebKit::WebFrame* web_frame_; | 45 WebKit::WebFrame* web_frame_; |
45 P2PSocketDispatcher* socket_dispatcher_; | 46 P2PSocketDispatcher* socket_dispatcher_; |
46 webkit_glue::P2PTransport::Config config_; | 47 webkit_glue::P2PTransport::Config config_; |
47 | 48 |
48 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator); | 49 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator); |
49 }; | 50 }; |
50 | 51 |
51 class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession, | 52 class P2PPortAllocatorSession : public cricket::BasicPortAllocatorSession, |
52 public WebKit::WebURLLoaderClient { | 53 public WebKit::WebURLLoaderClient { |
53 public: | 54 public: |
54 P2PPortAllocatorSession( | 55 P2PPortAllocatorSession( |
55 P2PPortAllocator* allocator, | 56 P2PPortAllocator* allocator, |
56 const std::string& channel_name, | 57 int component, |
57 int candidate); | 58 const std::string& ice_username_fragment, |
| 59 const std::string& ice_password); |
58 virtual ~P2PPortAllocatorSession(); | 60 virtual ~P2PPortAllocatorSession(); |
59 | 61 |
60 // WebKit::WebURLLoaderClient overrides. | 62 // WebKit::WebURLLoaderClient overrides. |
61 virtual void didReceiveData(WebKit::WebURLLoader* loader, | 63 virtual void didReceiveData(WebKit::WebURLLoader* loader, |
62 const char* data, | 64 const char* data, |
63 int data_length, | 65 int data_length, |
64 int encoded_data_length) OVERRIDE; | 66 int encoded_data_length) OVERRIDE; |
65 virtual void didFinishLoading(WebKit::WebURLLoader* loader, | 67 virtual void didFinishLoading(WebKit::WebURLLoader* loader, |
66 double finish_time) OVERRIDE; | 68 double finish_time) OVERRIDE; |
67 virtual void didFail(WebKit::WebURLLoader* loader, | 69 virtual void didFail(WebKit::WebURLLoader* loader, |
(...skipping 24 matching lines...) Expand all Loading... |
92 int relay_udp_port_; | 94 int relay_udp_port_; |
93 int relay_tcp_port_; | 95 int relay_tcp_port_; |
94 int relay_ssltcp_port_; | 96 int relay_ssltcp_port_; |
95 | 97 |
96 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocatorSession); | 98 DISALLOW_COPY_AND_ASSIGN(P2PPortAllocatorSession); |
97 }; | 99 }; |
98 | 100 |
99 } // namespace content | 101 } // namespace content |
100 | 102 |
101 #endif // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ | 103 #endif // CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
OLD | NEW |