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

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

Issue 13992004: IpcSocketFactory pending packet limit is too small (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ipc_socket_factory.h" 5 #include "content/renderer/p2p/ipc_socket_factory.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/message_loop_proxy.h" 9 #include "base/message_loop_proxy.h"
10 #include "content/renderer/p2p/socket_client.h" 10 #include "content/renderer/p2p/socket_client.h"
11 #include "content/renderer/p2p/socket_dispatcher.h" 11 #include "content/renderer/p2p/socket_dispatcher.h"
12 #include "jingle/glue/utils.h" 12 #include "jingle/glue/utils.h"
13 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" 13 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
14 14
15 namespace content { 15 namespace content {
16 16
17 namespace { 17 namespace {
18 18
19 // TODO(sergeyu): Try adjusting these parameters to achieve optimal performance. 19 // TODO(hclam): This shouldn't be a pre-defined value. Bug: crbug.com/181321.
20 const int kMaxPendingPackets = 8; 20 const int kMaxPendingPackets = 32;
21 const int kWritableSignalThreshold = 0; 21 const int kWritableSignalThreshold = 0;
22 22
23 // IpcPacketSocket implements talk_base::AsyncPacketSocket interface 23 // IpcPacketSocket implements talk_base::AsyncPacketSocket interface
24 // using P2PSocketClient that works over IPC-channel. It must be used 24 // using P2PSocketClient that works over IPC-channel. It must be used
25 // on the thread it was created. 25 // on the thread it was created.
26 class IpcPacketSocket : public talk_base::AsyncPacketSocket, 26 class IpcPacketSocket : public talk_base::AsyncPacketSocket,
27 public P2PSocketClient::Delegate { 27 public P2PSocketClient::Delegate {
28 public: 28 public:
29 IpcPacketSocket(); 29 IpcPacketSocket();
30 virtual ~IpcPacketSocket(); 30 virtual ~IpcPacketSocket();
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 talk_base::SocketAddress crome_address; 396 talk_base::SocketAddress crome_address;
397 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_); 397 P2PSocketClient* socket_client = new P2PSocketClient(socket_dispatcher_);
398 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); 398 scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket());
399 if (!socket->Init(P2P_SOCKET_TCP_CLIENT, socket_client, local_address, 399 if (!socket->Init(P2P_SOCKET_TCP_CLIENT, socket_client, local_address,
400 remote_address)) 400 remote_address))
401 return NULL; 401 return NULL;
402 return socket.release(); 402 return socket.release();
403 } 403 }
404 404
405 } // namespace content 405 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698