Index: content/renderer/p2p/port_allocator.h |
diff --git a/content/renderer/p2p/port_allocator.h b/content/renderer/p2p/port_allocator.h |
index a789e7a93cc6384d14988deea084e0ca0c6f2f2d..28502f0ff152f3f0ddbc714dce7a20e232ee20f3 100644 |
--- a/content/renderer/p2p/port_allocator.h |
+++ b/content/renderer/p2p/port_allocator.h |
@@ -5,6 +5,8 @@ |
#ifndef CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
#define CONTENT_RENDERER_P2P_PORT_ALLOCATOR_H_ |
+#include "base/memory/ref_counted.h" |
+#include "base/single_thread_task_runner.h" |
#include "third_party/webrtc/p2p/client/basicportallocator.h" |
#include "url/gurl.h" |
@@ -44,11 +46,13 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { |
bool enable_multiple_routes = true; |
}; |
- P2PPortAllocator(P2PSocketDispatcher* socket_dispatcher, |
- rtc::NetworkManager* network_manager, |
- rtc::PacketSocketFactory* socket_factory, |
- const Config& config, |
- const GURL& origin); |
+ P2PPortAllocator( |
+ const scoped_refptr<P2PSocketDispatcher>& socket_dispatcher, |
+ scoped_ptr<rtc::NetworkManager> network_manager, |
+ rtc::PacketSocketFactory* socket_factory, |
+ const Config& config, |
+ const GURL& origin, |
+ const scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
~P2PPortAllocator() override; |
cricket::PortAllocatorSession* CreateSessionInternal( |
@@ -59,11 +63,16 @@ class P2PPortAllocator : public cricket::BasicPortAllocator { |
private: |
friend class P2PPortAllocatorSession; |
- |
- P2PSocketDispatcher* socket_dispatcher_; |
+ scoped_ptr<rtc::NetworkManager> network_manager_; |
+ scoped_refptr<P2PSocketDispatcher> socket_dispatcher_; |
Config config_; |
GURL origin_; |
+ // This is the thread |network_manager_| is associated with and must be used |
+ // to delete |network_manager_|. |
+ const scoped_refptr<base::SingleThreadTaskRunner> |
+ network_manager_task_runner_; |
+ |
DISALLOW_COPY_AND_ASSIGN(P2PPortAllocator); |
}; |