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

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

Issue 7888022: Add DISABLE_TCP_TRANSPORT flag in the Transport API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 3 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 | « no previous file | ppapi/c/dev/ppb_transport_dev.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/port_allocator.cc
diff --git a/content/renderer/p2p/port_allocator.cc b/content/renderer/p2p/port_allocator.cc
index 42df2750be6946993dca5d549c526b6ca0de9c24..e0fac7a34d600fe405185e4c3774249207555573 100644
--- a/content/renderer/p2p/port_allocator.cc
+++ b/content/renderer/p2p/port_allocator.cc
@@ -11,6 +11,7 @@
#include "content/renderer/p2p/host_address_request.h"
#include "jingle/glue/utils.h"
#include "net/base/ip_endpoint.h"
+#include "ppapi/c/dev/ppb_transport_dev.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebURLLoader.h"
@@ -59,6 +60,10 @@ P2PPortAllocator::P2PPortAllocator(
web_frame_(web_frame),
socket_dispatcher_(socket_dispatcher),
config_(config) {
+ uint32 flags = 0;
+ if (config_.disable_tcp_transport)
+ flags |= cricket::PORTALLOCATOR_DISABLE_TCP;
+ set_flags(flags);
}
P2PPortAllocator::~P2PPortAllocator() {
@@ -257,11 +262,11 @@ void P2PPortAllocatorSession::AddConfig() {
talk_base::SocketAddress address(relay_ip_.ip(), relay_udp_port_);
ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_UDP));
}
- if (relay_tcp_port_ > 0) {
+ if (relay_tcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) {
talk_base::SocketAddress address(relay_ip_.ip(), relay_tcp_port_);
ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_TCP));
}
- if (relay_ssltcp_port_ > 0) {
+ if (relay_ssltcp_port_ > 0 && !allocator_->config_.disable_tcp_transport) {
talk_base::SocketAddress address(relay_ip_.ip(), relay_ssltcp_port_);
ports.push_back(cricket::ProtocolAddress(address, cricket::PROTO_SSLTCP));
}
« no previous file with comments | « no previous file | ppapi/c/dev/ppb_transport_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698