summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 18:43:00 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 18:43:00 +0000
commit21c7ff9afa9017603dd43007ce98939c2676a2c6 (patch)
treeb340f9f95dafba7c33eb0658376de29021cb736d /webkit
parentd952a0583a393551b3f08fb77bd8cd49dde6c446 (diff)
downloadchromium_src-21c7ff9afa9017603dd43007ce98939c2676a2c6.zip
chromium_src-21c7ff9afa9017603dd43007ce98939c2676a2c6.tar.gz
chromium_src-21c7ff9afa9017603dd43007ce98939c2676a2c6.tar.bz2
Add TCP configuration parameters for Transport API.
BUG=91439 TEST=None Review URL: http://codereview.chromium.org/7820008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99776 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/p2p_transport.cc4
-rw-r--r--webkit/glue/p2p_transport.h6
-rw-r--r--webkit/plugins/ppapi/ppb_transport_impl.cc26
3 files changed, 34 insertions, 2 deletions
diff --git a/webkit/glue/p2p_transport.cc b/webkit/glue/p2p_transport.cc
index 33d824f..a4c518b 100644
--- a/webkit/glue/p2p_transport.cc
+++ b/webkit/glue/p2p_transport.cc
@@ -10,7 +10,9 @@ P2PTransport::Config::Config()
: stun_server_port(0),
relay_server_port(0),
tcp_receive_window(0),
- tcp_send_window(0) {
+ tcp_send_window(0),
+ tcp_no_delay(false),
+ tcp_ack_delay_ms(0) {
}
P2PTransport::Config::~Config() {
diff --git a/webkit/glue/p2p_transport.h b/webkit/glue/p2p_transport.h
index 652117e..7795344 100644
--- a/webkit/glue/p2p_transport.h
+++ b/webkit/glue/p2p_transport.h
@@ -62,6 +62,12 @@ class P2PTransport {
// TCP window sizes. Default size is used when set to 0.
int tcp_receive_window;
int tcp_send_window;
+
+ // Disables Neagle's algorithm when set to true.
+ bool tcp_no_delay;
+
+ // TCP ACK delay.
+ int tcp_ack_delay_ms;
};
virtual ~P2PTransport() {}
diff --git a/webkit/plugins/ppapi/ppb_transport_impl.cc b/webkit/plugins/ppapi/ppb_transport_impl.cc
index f9d9cc1..e7779aa 100644
--- a/webkit/plugins/ppapi/ppb_transport_impl.cc
+++ b/webkit/plugins/ppapi/ppb_transport_impl.cc
@@ -33,6 +33,8 @@ const char kTcpProtocolName[] = "tcp";
const int kMinBufferSize = 1024;
const int kMaxBufferSize = 1024 * 1024;
+const int kMinAckDelay = 10;
+const int kMaxAckDelay = 1000;
int MapNetError(int result) {
if (result > 0)
@@ -170,6 +172,29 @@ int32_t PPB_Transport_Impl::SetProperty(PP_TransportProperty property,
break;
}
+ case PP_TRANSPORTPROPERTY_TCP_NO_DELAY: {
+ if (!use_tcp_)
+ return PP_ERROR_BADARGUMENT;
+
+ if (value.type != PP_VARTYPE_BOOL)
+ return PP_ERROR_BADARGUMENT;
+ config_.tcp_no_delay = PP_ToBool(value.value.as_bool);
+ break;
+ }
+
+ case PP_TRANSPORTPROPERTY_TCP_ACK_DELAY: {
+ if (!use_tcp_)
+ return PP_ERROR_BADARGUMENT;
+
+ int32_t int_value = value.value.as_int;
+ if (value.type != PP_VARTYPE_INT32 || int_value < kMinAckDelay ||
+ int_value > kMaxAckDelay) {
+ return PP_ERROR_BADARGUMENT;
+ }
+ config_.tcp_ack_delay_ms = int_value;
+ break;
+ }
+
default:
return PP_ERROR_BADARGUMENT;
}
@@ -299,7 +324,6 @@ int32_t PPB_Transport_Impl::Close() {
p2p_transport_.reset();
-
PluginModule* plugin_module = ResourceHelper::GetPluginModule(this);
if (plugin_module)
plugin_module->GetCallbackTracker()->AbortAll();