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

Unified Diff: remoting/protocol/chromium_port_allocator.h

Issue 1571943002: Simplify PortAllocatorBase and make PortAllocator creation synchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/cast_extension_session.cc ('k') | remoting/protocol/chromium_port_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/chromium_port_allocator.h
diff --git a/remoting/protocol/chromium_port_allocator.h b/remoting/protocol/chromium_port_allocator.h
index 63d6e576bf3d763bee70c55037d4a02b3b865d57..d01497ade0058b438236d839978ef22d0b34c2c4 100644
--- a/remoting/protocol/chromium_port_allocator.h
+++ b/remoting/protocol/chromium_port_allocator.h
@@ -26,11 +26,17 @@ struct NetworkSettings;
// stack.
class ChromiumPortAllocator : public PortAllocatorBase {
public:
- static scoped_ptr<ChromiumPortAllocator> Create(
- const scoped_refptr<net::URLRequestContextGetter>& url_context);
-
+ ChromiumPortAllocator(
+ scoped_ptr<rtc::NetworkManager> network_manager,
+ scoped_ptr<rtc::PacketSocketFactory> socket_factory,
+ scoped_refptr<TransportContext> transport_context,
+ scoped_refptr<net::URLRequestContextGetter> url_context);
~ChromiumPortAllocator() override;
+ scoped_refptr<net::URLRequestContextGetter> url_context() {
+ return url_context_;
+ }
+
// PortAllocatorBase overrides.
cricket::PortAllocatorSession* CreateSessionInternal(
const std::string& content_name,
@@ -39,14 +45,7 @@ class ChromiumPortAllocator : public PortAllocatorBase {
const std::string& ice_password) override;
private:
- ChromiumPortAllocator(
- const scoped_refptr<net::URLRequestContextGetter>& url_context,
- scoped_ptr<rtc::NetworkManager> network_manager,
- scoped_ptr<rtc::PacketSocketFactory> socket_factory);
-
scoped_refptr<net::URLRequestContextGetter> url_context_;
- scoped_ptr<rtc::NetworkManager> network_manager_;
- scoped_ptr<rtc::PacketSocketFactory> socket_factory_;
DISALLOW_COPY_AND_ASSIGN(ChromiumPortAllocator);
};
@@ -58,7 +57,8 @@ class ChromiumPortAllocatorFactory : public PortAllocatorFactory {
~ChromiumPortAllocatorFactory() override;
// PortAllocatorFactory interface.
- scoped_ptr<PortAllocatorBase> CreatePortAllocator() override;
+ scoped_ptr<cricket::PortAllocator> CreatePortAllocator(
+ scoped_refptr<TransportContext> transport_context) override;
private:
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
« no previous file with comments | « remoting/host/cast_extension_session.cc ('k') | remoting/protocol/chromium_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698