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

Unified Diff: content/renderer/p2p/socket_client_impl.cc

Issue 2140693002: Support port range for IPC P2P UDP sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and remove unused constructor from test Created 4 years, 5 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 | « content/renderer/p2p/socket_client_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/socket_client_impl.cc
diff --git a/content/renderer/p2p/socket_client_impl.cc b/content/renderer/p2p/socket_client_impl.cc
index fd74bb9d017bd6cda493c22440a3fabf05396e7c..6b2f0121b054870c02ab63e611ad8fbecba7c37f 100644
--- a/content/renderer/p2p/socket_client_impl.cc
+++ b/content/renderer/p2p/socket_client_impl.cc
@@ -44,11 +44,12 @@ P2PSocketClientImpl::~P2PSocketClientImpl() {
CHECK(state_ == STATE_CLOSED || state_ == STATE_UNINITIALIZED);
}
-void P2PSocketClientImpl::Init(
- P2PSocketType type,
- const net::IPEndPoint& local_address,
- const P2PHostAndIPEndPoint& remote_address,
- P2PSocketClientDelegate* delegate) {
+void P2PSocketClientImpl::Init(P2PSocketType type,
+ const net::IPEndPoint& local_address,
+ uint16_t min_port,
+ uint16_t max_port,
+ const P2PHostAndIPEndPoint& remote_address,
+ P2PSocketClientDelegate* delegate) {
DCHECK(delegate_task_runner_->BelongsToCurrentThread());
DCHECK(delegate);
// |delegate_| is only accessesed on |delegate_message_loop_|.
@@ -56,17 +57,20 @@ void P2PSocketClientImpl::Init(
ipc_task_runner_->PostTask(
FROM_HERE, base::Bind(&P2PSocketClientImpl::DoInit, this, type,
- local_address, remote_address));
+ local_address, min_port, max_port, remote_address));
}
void P2PSocketClientImpl::DoInit(P2PSocketType type,
const net::IPEndPoint& local_address,
+ uint16_t min_port,
+ uint16_t max_port,
const P2PHostAndIPEndPoint& remote_address) {
DCHECK_EQ(state_, STATE_UNINITIALIZED);
state_ = STATE_OPENING;
socket_id_ = dispatcher_->RegisterClient(this);
dispatcher_->SendP2PMessage(new P2PHostMsg_CreateSocket(
- type, socket_id_, local_address, remote_address));
+ type, socket_id_, local_address, P2PPortRange(min_port, max_port),
+ remote_address));
}
uint64_t P2PSocketClientImpl::Send(const net::IPEndPoint& address,
« no previous file with comments | « content/renderer/p2p/socket_client_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698