OLD | NEW |
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.h" | 5 #include "content/browser/renderer_host/p2p/socket_host.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/sys_byteorder.h" | 8 #include "base/sys_byteorder.h" |
9 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" | 9 #include "content/browser/renderer_host/p2p/socket_host_tcp.h" |
10 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" | 10 #include "content/browser/renderer_host/p2p/socket_host_tcp_server.h" |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 } // packet_processing_helpers | 456 } // packet_processing_helpers |
457 | 457 |
458 P2PSocketHost::P2PSocketHost(IPC::Sender* message_sender, | 458 P2PSocketHost::P2PSocketHost(IPC::Sender* message_sender, |
459 int socket_id, | 459 int socket_id, |
460 ProtocolType protocol_type) | 460 ProtocolType protocol_type) |
461 : message_sender_(message_sender), | 461 : message_sender_(message_sender), |
462 id_(socket_id), | 462 id_(socket_id), |
463 state_(STATE_UNINITIALIZED), | 463 state_(STATE_UNINITIALIZED), |
464 dump_incoming_rtp_packet_(false), | 464 dump_incoming_rtp_packet_(false), |
465 dump_outgoing_rtp_packet_(false), | 465 dump_outgoing_rtp_packet_(false), |
466 weak_ptr_factory_(this), | |
467 protocol_type_(protocol_type), | 466 protocol_type_(protocol_type), |
468 send_packets_delayed_total_(0), | 467 send_packets_delayed_total_(0), |
469 send_packets_total_(0), | 468 send_packets_total_(0), |
470 send_bytes_delayed_max_(0), | 469 send_bytes_delayed_max_(0), |
471 send_bytes_delayed_cur_(0) { | 470 send_bytes_delayed_cur_(0), |
| 471 weak_ptr_factory_(this) { |
472 } | 472 } |
473 | 473 |
474 P2PSocketHost::~P2PSocketHost() { | 474 P2PSocketHost::~P2PSocketHost() { |
475 if (protocol_type_ == P2PSocketHost::UDP) { | 475 if (protocol_type_ == P2PSocketHost::UDP) { |
476 UMA_HISTOGRAM_COUNTS_10000("WebRTC.SystemMaxConsecutiveBytesDelayed_UDP", | 476 UMA_HISTOGRAM_COUNTS_10000("WebRTC.SystemMaxConsecutiveBytesDelayed_UDP", |
477 send_bytes_delayed_max_); | 477 send_bytes_delayed_max_); |
478 } else { | 478 } else { |
479 UMA_HISTOGRAM_COUNTS_10000("WebRTC.SystemMaxConsecutiveBytesDelayed_TCP", | 479 UMA_HISTOGRAM_COUNTS_10000("WebRTC.SystemMaxConsecutiveBytesDelayed_TCP", |
480 send_bytes_delayed_max_); | 480 send_bytes_delayed_max_); |
481 } | 481 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 send_bytes_delayed_max_ = send_bytes_delayed_cur_; | 685 send_bytes_delayed_max_ = send_bytes_delayed_cur_; |
686 } | 686 } |
687 } | 687 } |
688 | 688 |
689 void P2PSocketHost::DecrementDelayedBytes(uint32 size) { | 689 void P2PSocketHost::DecrementDelayedBytes(uint32 size) { |
690 send_bytes_delayed_cur_ -= size; | 690 send_bytes_delayed_cur_ -= size; |
691 DCHECK_GE(send_bytes_delayed_cur_, 0); | 691 DCHECK_GE(send_bytes_delayed_cur_, 0); |
692 } | 692 } |
693 | 693 |
694 } // namespace content | 694 } // namespace content |
OLD | NEW |