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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 int64 adjusted_original_content_length = | 575 int64 adjusted_original_content_length = |
576 data_reduction_proxy::GetAdjustedOriginalContentLength( | 576 data_reduction_proxy::GetAdjustedOriginalContentLength( |
577 request_type, original_content_length, | 577 request_type, original_content_length, |
578 received_content_length); | 578 received_content_length); |
579 AccumulateContentLength(received_content_length, | 579 AccumulateContentLength(received_content_length, |
580 adjusted_original_content_length, | 580 adjusted_original_content_length, |
581 request_type); | 581 request_type); |
582 RecordContentLengthHistograms(received_content_length, | 582 RecordContentLengthHistograms(received_content_length, |
583 original_content_length, | 583 original_content_length, |
584 freshness_lifetime); | 584 freshness_lifetime); |
| 585 |
585 if (data_reduction_proxy_enabled_ && | 586 if (data_reduction_proxy_enabled_ && |
586 data_reduction_proxy_usage_stats_ && | 587 data_reduction_proxy_usage_stats_ && |
587 !proxy_config_getter_.is_null()) { | 588 !proxy_config_getter_.is_null()) { |
588 data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms( | 589 data_reduction_proxy_usage_stats_->RecordBytesHistograms( |
589 *request, | 590 request, |
590 *data_reduction_proxy_enabled_, | 591 *data_reduction_proxy_enabled_, |
591 proxy_config_getter_.Run()); | 592 proxy_config_getter_.Run()); |
592 } | 593 } |
593 DVLOG(2) << __FUNCTION__ | 594 DVLOG(2) << __FUNCTION__ |
594 << " received content length: " << received_content_length | 595 << " received content length: " << received_content_length |
595 << " original content length: " << original_content_length | 596 << " original content length: " << original_content_length |
596 << " url: " << request->url(); | 597 << " url: " << request->url(); |
597 } | 598 } |
598 | 599 |
599 extensions_delegate_->OnCompleted(request, started); | 600 extensions_delegate_->OnCompleted(request, started); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 if (data_reduction_proxy_statistics_prefs_) { | 833 if (data_reduction_proxy_statistics_prefs_) { |
833 StoreAccumulatedContentLength(received_content_length, | 834 StoreAccumulatedContentLength(received_content_length, |
834 original_content_length, | 835 original_content_length, |
835 request_type, | 836 request_type, |
836 reinterpret_cast<Profile*>(profile_), | 837 reinterpret_cast<Profile*>(profile_), |
837 data_reduction_proxy_statistics_prefs_); | 838 data_reduction_proxy_statistics_prefs_); |
838 } | 839 } |
839 received_content_length_ += received_content_length; | 840 received_content_length_ += received_content_length; |
840 original_content_length_ += original_content_length; | 841 original_content_length_ += original_content_length; |
841 } | 842 } |
OLD | NEW |