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

Side by Side Diff: content/renderer/p2p/p2p_transport_impl.cc

Issue 7820008: Add TCP configuration parameters for 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | jingle/glue/pseudotcp_adapter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/p2p/p2p_transport_impl.h" 5 #include "content/renderer/p2p/p2p_transport_impl.h"
6 6
7 #include "content/renderer/p2p/ipc_network_manager.h" 7 #include "content/renderer/p2p/ipc_network_manager.h"
8 #include "content/renderer/p2p/ipc_socket_factory.h" 8 #include "content/renderer/p2p/ipc_socket_factory.h"
9 #include "content/renderer/p2p/port_allocator.h" 9 #include "content/renderer/p2p/port_allocator.h"
10 #include "content/renderer/render_view.h" 10 #include "content/renderer/render_view.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 channel_adapter_.reset(new jingle_glue::TransportChannelSocketAdapter( 86 channel_adapter_.reset(new jingle_glue::TransportChannelSocketAdapter(
87 channel_.get())); 87 channel_.get()));
88 88
89 channel_->Connect(); 89 channel_->Connect();
90 90
91 if (protocol == PROTOCOL_TCP) { 91 if (protocol == PROTOCOL_TCP) {
92 pseudo_tcp_adapter_.reset(new jingle_glue::PseudoTcpAdapter( 92 pseudo_tcp_adapter_.reset(new jingle_glue::PseudoTcpAdapter(
93 channel_adapter_.release())); 93 channel_adapter_.release()));
94
95 if (config.tcp_receive_window > 0)
96 pseudo_tcp_adapter_->SetReceiveBufferSize(config.tcp_receive_window);
97 if (config.tcp_send_window > 0)
98 pseudo_tcp_adapter_->SetReceiveBufferSize(config.tcp_receive_window);
99 pseudo_tcp_adapter_->SetNoDelay(config.tcp_no_delay);
100 if (config.tcp_ack_delay_ms > 0)
101 pseudo_tcp_adapter_->SetAckDelay(config.tcp_ack_delay_ms);
102
94 int result = pseudo_tcp_adapter_->Connect(&connect_callback_); 103 int result = pseudo_tcp_adapter_->Connect(&connect_callback_);
95 if (result != net::ERR_IO_PENDING) 104 if (result != net::ERR_IO_PENDING)
96 OnTcpConnected(result); 105 OnTcpConnected(result);
97 } 106 }
98 107
99 return true; 108 return true;
100 } 109 }
101 110
102 bool P2PTransportImpl::AddRemoteCandidate(const std::string& address) { 111 bool P2PTransportImpl::AddRemoteCandidate(const std::string& address) {
103 cricket::Candidate candidate; 112 cricket::Candidate candidate;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 void P2PTransportImpl::OnTcpConnected(int result) { 153 void P2PTransportImpl::OnTcpConnected(int result) {
145 if (result < 0) { 154 if (result < 0) {
146 event_handler_->OnError(result); 155 event_handler_->OnError(result);
147 return; 156 return;
148 } 157 }
149 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE); 158 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE);
150 event_handler_->OnStateChange(state_); 159 event_handler_->OnStateChange(state_);
151 } 160 }
152 161
153 } // namespace content 162 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | jingle/glue/pseudotcp_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698