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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
576 int64 adjusted_original_content_length = | 576 int64 adjusted_original_content_length = |
577 data_reduction_proxy::GetAdjustedOriginalContentLength( | 577 data_reduction_proxy::GetAdjustedOriginalContentLength( |
578 request_type, original_content_length, | 578 request_type, original_content_length, |
579 received_content_length); | 579 received_content_length); |
580 AccumulateContentLength(received_content_length, | 580 AccumulateContentLength(received_content_length, |
581 adjusted_original_content_length, | 581 adjusted_original_content_length, |
582 request_type); | 582 request_type); |
583 RecordContentLengthHistograms(received_content_length, | 583 RecordContentLengthHistograms(received_content_length, |
584 original_content_length, | 584 original_content_length, |
585 freshness_lifetime); | 585 freshness_lifetime); |
586 if (data_reduction_proxy_enabled_ && data_reduction_proxy_usage_stats_) { | 586 if (data_reduction_proxy_enabled_ && data_reduction_proxy_usage_stats_ && |
bengr
2014/08/29 19:29:47
nit: It might be a bit cleaner to put each conditi
megjablon
2014/08/29 20:26:32
Done.
| |
587 !proxy_config_getter_.is_null()) { | |
587 data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms( | 588 data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms( |
588 *request, *data_reduction_proxy_enabled_); | 589 *request, |
590 *data_reduction_proxy_enabled_, | |
591 proxy_config_getter_.Run()); | |
589 } | 592 } |
590 DVLOG(2) << __FUNCTION__ | 593 DVLOG(2) << __FUNCTION__ |
591 << " received content length: " << received_content_length | 594 << " received content length: " << received_content_length |
592 << " original content length: " << original_content_length | 595 << " original content length: " << original_content_length |
593 << " url: " << request->url(); | 596 << " url: " << request->url(); |
594 } | 597 } |
595 | 598 |
596 extensions_delegate_->OnCompleted(request, started); | 599 extensions_delegate_->OnCompleted(request, started); |
597 } else if (request->status().status() == net::URLRequestStatus::FAILED || | 600 } else if (request->status().status() == net::URLRequestStatus::FAILED || |
598 request->status().status() == net::URLRequestStatus::CANCELED) { | 601 request->status().status() == net::URLRequestStatus::CANCELED) { |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
817 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 820 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
818 DCHECK_GE(received_content_length, 0); | 821 DCHECK_GE(received_content_length, 0); |
819 DCHECK_GE(original_content_length, 0); | 822 DCHECK_GE(original_content_length, 0); |
820 StoreAccumulatedContentLength(received_content_length, | 823 StoreAccumulatedContentLength(received_content_length, |
821 original_content_length, | 824 original_content_length, |
822 request_type, | 825 request_type, |
823 reinterpret_cast<Profile*>(profile_)); | 826 reinterpret_cast<Profile*>(profile_)); |
824 received_content_length_ += received_content_length; | 827 received_content_length_ += received_content_length; |
825 original_content_length_ += original_content_length; | 828 original_content_length_ += original_content_length; |
826 } | 829 } |
OLD | NEW |