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 "chrome/browser/net/chrome_network_delegate.h" | 5 #include "chrome/browser/net/chrome_network_delegate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 int64 adjusted_original_content_length = | 579 int64 adjusted_original_content_length = |
580 data_reduction_proxy::GetAdjustedOriginalContentLength( | 580 data_reduction_proxy::GetAdjustedOriginalContentLength( |
581 request_type, original_content_length, | 581 request_type, original_content_length, |
582 received_content_length); | 582 received_content_length); |
583 AccumulateContentLength(received_content_length, | 583 AccumulateContentLength(received_content_length, |
584 adjusted_original_content_length, | 584 adjusted_original_content_length, |
585 request_type); | 585 request_type); |
586 RecordContentLengthHistograms(received_content_length, | 586 RecordContentLengthHistograms(received_content_length, |
587 original_content_length, | 587 original_content_length, |
588 freshness_lifetime); | 588 freshness_lifetime); |
| 589 |
589 if (data_reduction_proxy_enabled_ && | 590 if (data_reduction_proxy_enabled_ && |
590 data_reduction_proxy_usage_stats_ && | 591 data_reduction_proxy_usage_stats_ && |
591 !proxy_config_getter_.is_null()) { | 592 !proxy_config_getter_.is_null()) { |
592 data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms( | 593 data_reduction_proxy_usage_stats_->RecordBytesHistograms( |
593 *request, | 594 *request, |
594 *data_reduction_proxy_enabled_, | 595 *data_reduction_proxy_enabled_, |
595 proxy_config_getter_.Run()); | 596 proxy_config_getter_.Run()); |
596 } | 597 } |
597 DVLOG(2) << __FUNCTION__ | 598 DVLOG(2) << __FUNCTION__ |
598 << " received content length: " << received_content_length | 599 << " received content length: " << received_content_length |
599 << " original content length: " << original_content_length | 600 << " original content length: " << original_content_length |
600 << " url: " << request->url(); | 601 << " url: " << request->url(); |
601 } | 602 } |
602 | 603 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 834 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
834 DCHECK_GE(received_content_length, 0); | 835 DCHECK_GE(received_content_length, 0); |
835 DCHECK_GE(original_content_length, 0); | 836 DCHECK_GE(original_content_length, 0); |
836 StoreAccumulatedContentLength(received_content_length, | 837 StoreAccumulatedContentLength(received_content_length, |
837 original_content_length, | 838 original_content_length, |
838 request_type, | 839 request_type, |
839 reinterpret_cast<Profile*>(profile_)); | 840 reinterpret_cast<Profile*>(profile_)); |
840 received_content_length_ += received_content_length; | 841 received_content_length_ += received_content_length; |
841 original_content_length_ += original_content_length; | 842 original_content_length_ += original_content_length; |
842 } | 843 } |
OLD | NEW |