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

Unified Diff: jingle/glue/pseudotcp_adapter.cc

Issue 7275024: PseudoTcp to expose settings of nagling and ACK delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
Index: jingle/glue/pseudotcp_adapter.cc
diff --git a/jingle/glue/pseudotcp_adapter.cc b/jingle/glue/pseudotcp_adapter.cc
index b86c805607011099e347f37ec29ac374edbcf71d..175adbe8f692756209004e56f8cd4a03815af040 100644
--- a/jingle/glue/pseudotcp_adapter.cc
+++ b/jingle/glue/pseudotcp_adapter.cc
@@ -46,6 +46,10 @@ class PseudoTcpAdapter::Core : public cricket::IPseudoTcpNotify,
// This is triggered by NotifyClock, NotifyPacket, Recv and Send.
virtual WriteResult TcpWritePacket(cricket::PseudoTcp* tcp,
const char* buffer, size_t len) OVERRIDE;
+
+ void SetAckDelay(int delay_ms);
+ void SetNagling(bool nagling);
+
private:
// These are invoked by the underlying Socket, and may trigger callbacks.
// They hold a reference to |this| while running, to protect from deletion.
@@ -269,6 +273,14 @@ void PseudoTcpAdapter::Core::OnTcpClosed(PseudoTcp* tcp, uint32 error) {
}
}
+void PseudoTcpAdapter::Core::SetAckDelay(int delay_ms) {
+ pseudo_tcp_.SetOption(cricket::PseudoTcp::OPT_ACKDELAY, delay_ms);
+}
+
+void PseudoTcpAdapter::Core::SetNagling(bool nagling) {
+ pseudo_tcp_.SetOption(cricket::PseudoTcp::OPT_NODELAY, nagling ? 1 : 0);
+}
+
cricket::IPseudoTcpNotify::WriteResult PseudoTcpAdapter::Core::TcpWritePacket(
PseudoTcp* tcp,
const char* buffer,
@@ -473,4 +485,14 @@ base::TimeDelta PseudoTcpAdapter::GetConnectTimeMicros() const {
return base::TimeDelta::FromMicroseconds(-1);
}
+void PseudoTcpAdapter::SetAckDelay(int delay_ms) {
+ DCHECK(CalledOnValidThread());
+ core_->SetAckDelay(delay_ms);
+}
+
+void PseudoTcpAdapter::SetNagling(bool nagling) {
+ DCHECK(CalledOnValidThread());
+ core_->SetNagling(nagling);
+}
+
} // namespace jingle_glue

Powered by Google App Engine
This is Rietveld 408576698