| 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 "net/quic/chromium/quic_chromium_client_session.h" | 5 #include "net/quic/chromium/quic_chromium_client_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Size of the MRU cache of Token Binding signatures. Since the material being | 57 // Size of the MRU cache of Token Binding signatures. Since the material being |
| 58 // signed is constant and there aren't many keys being used to sign, a fairly | 58 // signed is constant and there aren't many keys being used to sign, a fairly |
| 59 // small number was chosen, somewhat arbitrarily, and to match | 59 // small number was chosen, somewhat arbitrarily, and to match |
| 60 // SSLClientSocketImpl. | 60 // SSLClientSocketImpl. |
| 61 const size_t kTokenBindingSignatureMapSize = 10; | 61 const size_t kTokenBindingSignatureMapSize = 10; |
| 62 | 62 |
| 63 // Time to wait (in seconds) when no networks are available and | 63 // Time to wait (in seconds) when no networks are available and |
| 64 // migrating sessions need to wait for a new network to connect. | 64 // migrating sessions need to wait for a new network to connect. |
| 65 const size_t kWaitTimeForNewNetworkSecs = 10; | 65 const size_t kWaitTimeForNewNetworkSecs = 10; |
| 66 | 66 |
| 67 // The maximum size of uncompressed QUIC headers that will be allowed. |
| 68 const size_t kMaxUncompressedHeaderSize = 256 * 1024; |
| 69 |
| 67 // Histograms for tracking down the crashes from http://crbug.com/354669 | 70 // Histograms for tracking down the crashes from http://crbug.com/354669 |
| 68 // Note: these values must be kept in sync with the corresponding values in: | 71 // Note: these values must be kept in sync with the corresponding values in: |
| 69 // tools/metrics/histograms/histograms.xml | 72 // tools/metrics/histograms/histograms.xml |
| 70 enum Location { | 73 enum Location { |
| 71 DESTRUCTOR = 0, | 74 DESTRUCTOR = 0, |
| 72 ADD_OBSERVER = 1, | 75 ADD_OBSERVER = 1, |
| 73 TRY_CREATE_STREAM = 2, | 76 TRY_CREATE_STREAM = 2, |
| 74 CREATE_OUTGOING_RELIABLE_STREAM = 3, | 77 CREATE_OUTGOING_RELIABLE_STREAM = 3, |
| 75 NOTIFY_FACTORY_OF_SESSION_CLOSED_LATER = 4, | 78 NOTIFY_FACTORY_OF_SESSION_CLOSED_LATER = 4, |
| 76 NOTIFY_FACTORY_OF_SESSION_CLOSED = 5, | 79 NOTIFY_FACTORY_OF_SESSION_CLOSED = 5, |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 QuicStreamId id) { | 671 QuicStreamId id) { |
| 669 return QuicMakeUnique<QuicChromiumClientStream>(id, this, net_log_); | 672 return QuicMakeUnique<QuicChromiumClientStream>(id, this, net_log_); |
| 670 } | 673 } |
| 671 | 674 |
| 672 void QuicChromiumClientSession::Initialize() { | 675 void QuicChromiumClientSession::Initialize() { |
| 673 QuicClientSessionBase::Initialize(); | 676 QuicClientSessionBase::Initialize(); |
| 674 SetHpackEncoderDebugVisitor( | 677 SetHpackEncoderDebugVisitor( |
| 675 base::MakeUnique<HpackEncoderDebugVisitor>()); | 678 base::MakeUnique<HpackEncoderDebugVisitor>()); |
| 676 SetHpackDecoderDebugVisitor( | 679 SetHpackDecoderDebugVisitor( |
| 677 base::MakeUnique<HpackDecoderDebugVisitor>()); | 680 base::MakeUnique<HpackDecoderDebugVisitor>()); |
| 681 set_max_uncompressed_header_bytes(kMaxUncompressedHeaderSize); |
| 678 } | 682 } |
| 679 | 683 |
| 680 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( | 684 void QuicChromiumClientSession::OnHeadersHeadOfLineBlocking( |
| 681 QuicTime::Delta delta) { | 685 QuicTime::Delta delta) { |
| 682 UMA_HISTOGRAM_TIMES( | 686 UMA_HISTOGRAM_TIMES( |
| 683 "Net.QuicSession.HeadersHOLBlockedTime", | 687 "Net.QuicSession.HeadersHOLBlockedTime", |
| 684 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); | 688 base::TimeDelta::FromMicroseconds(delta.ToMicroseconds())); |
| 685 } | 689 } |
| 686 | 690 |
| 687 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { | 691 void QuicChromiumClientSession::OnStreamFrame(const QuicStreamFrame& frame) { |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 } | 1760 } |
| 1757 | 1761 |
| 1758 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { | 1762 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { |
| 1759 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's | 1763 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's |
| 1760 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and | 1764 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and |
| 1761 // unacked packet map. | 1765 // unacked packet map. |
| 1762 return base::trace_event::EstimateMemoryUsage(packet_readers_); | 1766 return base::trace_event::EstimateMemoryUsage(packet_readers_); |
| 1763 } | 1767 } |
| 1764 | 1768 |
| 1765 } // namespace net | 1769 } // namespace net |
| OLD | NEW |