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/renderer/p2p/ipc_socket_factory.h" | 5 #include "content/renderer/p2p/ipc_socket_factory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 CHECK(send_metrics.packet_id == 0 || | 602 CHECK(send_metrics.packet_id == 0 || |
603 record.packet_id == send_metrics.packet_id); | 603 record.packet_id == send_metrics.packet_id); |
604 | 604 |
605 send_bytes_available_ += record.packet_size; | 605 send_bytes_available_ += record.packet_size; |
606 | 606 |
607 DCHECK_LE(send_bytes_available_, kMaximumInFlightBytes); | 607 DCHECK_LE(send_bytes_available_, kMaximumInFlightBytes); |
608 | 608 |
609 in_flight_packet_records_.pop_front(); | 609 in_flight_packet_records_.pop_front(); |
610 TraceSendThrottlingState(); | 610 TraceSendThrottlingState(); |
611 | 611 |
| 612 int64_t send_time_ms = -1; |
| 613 if (send_metrics.rtc_packet_id >= 0) { |
| 614 send_time_ms = (send_metrics.send_time - base::TimeTicks::UnixEpoch()) |
| 615 .InMilliseconds(); |
| 616 } |
| 617 SignalSentPacket(this, rtc::SentPacket(send_metrics.rtc_packet_id, |
| 618 send_time_ms)); |
| 619 |
612 if (writable_signal_expected_ && send_bytes_available_ > 0) { | 620 if (writable_signal_expected_ && send_bytes_available_ > 0) { |
613 WebRtcLogMessage(base::StringPrintf( | 621 WebRtcLogMessage(base::StringPrintf( |
614 "IpcPacketSocket: sending is unblocked. %d packets in flight.", | 622 "IpcPacketSocket: sending is unblocked. %d packets in flight.", |
615 static_cast<int>(in_flight_packet_records_.size()))); | 623 static_cast<int>(in_flight_packet_records_.size()))); |
616 | 624 |
617 SignalReadyToSend(this); | 625 SignalReadyToSend(this); |
618 writable_signal_expected_ = false; | 626 writable_signal_expected_ = false; |
619 } | 627 } |
620 } | 628 } |
621 | 629 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 794 } |
787 | 795 |
788 rtc::AsyncResolverInterface* | 796 rtc::AsyncResolverInterface* |
789 IpcPacketSocketFactory::CreateAsyncResolver() { | 797 IpcPacketSocketFactory::CreateAsyncResolver() { |
790 scoped_ptr<AsyncAddressResolverImpl> resolver( | 798 scoped_ptr<AsyncAddressResolverImpl> resolver( |
791 new AsyncAddressResolverImpl(socket_dispatcher_)); | 799 new AsyncAddressResolverImpl(socket_dispatcher_)); |
792 return resolver.release(); | 800 return resolver.release(); |
793 } | 801 } |
794 | 802 |
795 } // namespace content | 803 } // namespace content |
OLD | NEW |