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

Side by Side Diff: content/browser/renderer_host/p2p/socket_host_udp.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/browser/renderer_host/p2p/socket_host_udp.h" 5 #include "content/browser/renderer_host/p2p/socket_host_udp.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 " transient error. Dropping the packet."; 335 " transient error. Dropping the packet.";
336 } 336 }
337 337
338 // UMA to track the histograms from 1ms to 1 sec for how long a packet spends 338 // UMA to track the histograms from 1ms to 1 sec for how long a packet spends
339 // in the browser process. 339 // in the browser process.
340 UMA_HISTOGRAM_TIMES( 340 UMA_HISTOGRAM_TIMES(
341 "WebRTC.SystemSendPacketDuration_UDP" /* name */, 341 "WebRTC.SystemSendPacketDuration_UDP" /* name */,
342 base::TimeTicks::Now() - 342 base::TimeTicks::Now() -
343 base::TimeTicks::FromInternalValue(tick_received) /* sample */); 343 base::TimeTicks::FromInternalValue(tick_received) /* sample */);
344 344
345 message_sender_->Send(new P2PMsg_OnSendComplete(id_)); 345 message_sender_->Send(new P2PMsg_OnSendComplete(
346 id_, P2PSendPacketMetrics(packet_id /* packet_id */)));
Sergey Ulanov 2014/12/16 00:21:43 Don't need the comment.
guoweis_left_chromium 2014/12/16 23:12:33 Done.
346 } 347 }
347 348
348 P2PSocketHost* P2PSocketHostUdp::AcceptIncomingTcpConnection( 349 P2PSocketHost* P2PSocketHostUdp::AcceptIncomingTcpConnection(
349 const net::IPEndPoint& remote_address, int id) { 350 const net::IPEndPoint& remote_address, int id) {
350 NOTREACHED(); 351 NOTREACHED();
351 OnError(); 352 OnError();
352 return NULL; 353 return NULL;
353 } 354 }
354 355
355 bool P2PSocketHostUdp::SetOption(P2PSocketOption option, int value) { 356 bool P2PSocketHostUdp::SetOption(P2PSocketOption option, int value) {
356 DCHECK_EQ(STATE_OPEN, state_); 357 DCHECK_EQ(STATE_OPEN, state_);
357 switch (option) { 358 switch (option) {
358 case P2P_SOCKET_OPT_RCVBUF: 359 case P2P_SOCKET_OPT_RCVBUF:
359 return socket_->SetReceiveBufferSize(value) == net::OK; 360 return socket_->SetReceiveBufferSize(value) == net::OK;
360 case P2P_SOCKET_OPT_SNDBUF: 361 case P2P_SOCKET_OPT_SNDBUF:
361 return socket_->SetSendBufferSize(value) == net::OK; 362 return socket_->SetSendBufferSize(value) == net::OK;
362 case P2P_SOCKET_OPT_DSCP: 363 case P2P_SOCKET_OPT_DSCP:
363 return (net::OK == socket_->SetDiffServCodePoint( 364 return (net::OK == socket_->SetDiffServCodePoint(
364 static_cast<net::DiffServCodePoint>(value))) ? true : false; 365 static_cast<net::DiffServCodePoint>(value))) ? true : false;
365 default: 366 default:
366 NOTREACHED(); 367 NOTREACHED();
367 return false; 368 return false;
368 } 369 }
369 } 370 }
370 371
371 } // namespace content 372 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698