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

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

Issue 759923003: Detect situation when there is no missing send completion signal in P2PSocket implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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/socket_dispatcher.h" 5 #include "content/renderer/p2p/socket_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "content/child/child_process.h" 10 #include "content/child/child_process.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 150
151 void P2PSocketDispatcher::OnIncomingTcpConnection( 151 void P2PSocketDispatcher::OnIncomingTcpConnection(
152 int socket_id, const net::IPEndPoint& address) { 152 int socket_id, const net::IPEndPoint& address) {
153 P2PSocketClientImpl* client = GetClient(socket_id); 153 P2PSocketClientImpl* client = GetClient(socket_id);
154 if (client) { 154 if (client) {
155 client->OnIncomingTcpConnection(address); 155 client->OnIncomingTcpConnection(address);
156 } 156 }
157 } 157 }
158 158
159 void P2PSocketDispatcher::OnSendComplete(int socket_id) { 159 void P2PSocketDispatcher::OnSendComplete(
160 int socket_id,
161 const P2PSendPacketMetrics& send_metrics) {
160 P2PSocketClientImpl* client = GetClient(socket_id); 162 P2PSocketClientImpl* client = GetClient(socket_id);
161 if (client) { 163 if (client) {
162 client->OnSendComplete(); 164 client->OnSendComplete(send_metrics);
163 } 165 }
164 } 166 }
165 167
166 void P2PSocketDispatcher::OnError(int socket_id) { 168 void P2PSocketDispatcher::OnError(int socket_id) {
167 P2PSocketClientImpl* client = GetClient(socket_id); 169 P2PSocketClientImpl* client = GetClient(socket_id);
168 if (client) { 170 if (client) {
169 client->OnError(); 171 client->OnError();
170 } 172 }
171 } 173 }
172 174
(...skipping 14 matching lines...) Expand all
187 // hasn't processed the close message by the time it sends the 189 // hasn't processed the close message by the time it sends the
188 // message to the renderer. 190 // message to the renderer.
189 DVLOG(1) << "Received P2P message for socket that doesn't exist."; 191 DVLOG(1) << "Received P2P message for socket that doesn't exist.";
190 return NULL; 192 return NULL;
191 } 193 }
192 194
193 return client; 195 return client;
194 } 196 }
195 197
196 } // namespace content 198 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698