| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <list> | 5 #include <list> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
| 10 #include "net/spdy/spdy_header_block.h" | 10 #include "net/spdy/spdy_header_block.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 friend class test::HpackHuffmanAggregatorPeer; | 28 friend class test::HpackHuffmanAggregatorPeer; |
| 29 | 29 |
| 30 HpackHuffmanAggregator(); | 30 HpackHuffmanAggregator(); |
| 31 ~HpackHuffmanAggregator(); | 31 ~HpackHuffmanAggregator(); |
| 32 | 32 |
| 33 // Encodes the request and response headers of the transaction with an | 33 // Encodes the request and response headers of the transaction with an |
| 34 // HpackEncoder keyed on the transaction's SpdySessionKey. Literal headers | 34 // HpackEncoder keyed on the transaction's SpdySessionKey. Literal headers |
| 35 // emitted by that encoder are aggregated into internal character counts, | 35 // emitted by that encoder are aggregated into internal character counts, |
| 36 // which are periodically published to a UMA histogram. | 36 // which are periodically published to a UMA histogram. |
| 37 void AggregateTransactionCharacterCounts( | 37 void AggregateTransactionCharacterCounts( |
| 38 const HttpRequestInfo& request, | 38 const HttpRequestInfo& request, |
| 39 const HttpRequestHeaders& request_headers, | 39 const HttpRequestHeaders& request_headers, |
| 40 const ProxyServer& proxy, | 40 const ProxyServer& proxy, |
| 41 const HttpResponseHeaders& response_headers); | 41 const HttpResponseHeaders& response_headers); |
| 42 | 42 |
| 43 // Returns whether the aggregator is enabled for the session by a field trial. | 43 // Returns whether the aggregator is enabled for the session by a field trial. |
| 44 static bool UseAggregator(); | 44 static bool UseAggregator(); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 typedef std::pair<SpdySessionKey, HpackEncoder*> OriginEncoder; | 47 typedef std::pair<SpdySessionKey, HpackEncoder*> OriginEncoder; |
| 48 typedef std::list<OriginEncoder> OriginEncoders; | 48 typedef std::list<OriginEncoder> OriginEncoders; |
| 49 | 49 |
| 50 // Returns true if the request is considered cross-origin, | 50 // Returns true if the request is considered cross-origin, |
| 51 // and should not be aggregated. | 51 // and should not be aggregated. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 std::vector<size_t> counts_; | 65 std::vector<size_t> counts_; |
| 66 size_t total_counts_; | 66 size_t total_counts_; |
| 67 | 67 |
| 68 OriginEncoders encoders_; | 68 OriginEncoders encoders_; |
| 69 size_t max_encoders_; | 69 size_t max_encoders_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(HpackHuffmanAggregator); | 71 DISALLOW_COPY_AND_ASSIGN(HpackHuffmanAggregator); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace net | 74 } // namespace net |
| OLD | NEW |