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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 | 454 |
455 int ChromeNetworkDelegate::OnBeforeURLRequest( | 455 int ChromeNetworkDelegate::OnBeforeURLRequest( |
456 net::URLRequest* request, | 456 net::URLRequest* request, |
457 const net::CompletionCallback& callback, | 457 const net::CompletionCallback& callback, |
458 GURL* new_url) { | 458 GURL* new_url) { |
459 #if defined(OS_ANDROID) | 459 #if defined(OS_ANDROID) |
460 // This UMA tracks the time to the first user-initiated request start, so | 460 // This UMA tracks the time to the first user-initiated request start, so |
461 // only non-null profiles are considered. | 461 // only non-null profiles are considered. |
462 if (first_request_ && profile_) { | 462 if (first_request_ && profile_) { |
463 bool record_timing = true; | 463 bool record_timing = true; |
464 #if defined(DATA_REDUCTION_PROXY_PROBE_URL) | 464 if (data_reduction_proxy_params_) { |
465 record_timing = (request->url() != GURL(DATA_REDUCTION_PROXY_PROBE_URL)); | 465 record_timing = |
466 #endif | 466 (request->url() != data_reduction_proxy_params_->probe_url()) && |
| 467 (request->url() != data_reduction_proxy_params_->warmup_url()); |
| 468 } |
467 if (record_timing) { | 469 if (record_timing) { |
468 first_request_ = false; | 470 first_request_ = false; |
469 net::LoadTimingInfo timing_info; | 471 net::LoadTimingInfo timing_info; |
470 request->GetLoadTimingInfo(&timing_info); | 472 request->GetLoadTimingInfo(&timing_info); |
471 BrowserThread::PostTask( | 473 BrowserThread::PostTask( |
472 BrowserThread::UI, FROM_HERE, | 474 BrowserThread::UI, FROM_HERE, |
473 base::Bind(&RecordIOThreadToRequestStartOnUIThread, | 475 base::Bind(&RecordIOThreadToRequestStartOnUIThread, |
474 timing_info.request_start)); | 476 timing_info.request_start)); |
475 } | 477 } |
476 } | 478 } |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 data_reduction_proxy::DataReductionProxyRequestType request_type) { | 884 data_reduction_proxy::DataReductionProxyRequestType request_type) { |
883 DCHECK_GE(received_content_length, 0); | 885 DCHECK_GE(received_content_length, 0); |
884 DCHECK_GE(original_content_length, 0); | 886 DCHECK_GE(original_content_length, 0); |
885 StoreAccumulatedContentLength(received_content_length, | 887 StoreAccumulatedContentLength(received_content_length, |
886 original_content_length, | 888 original_content_length, |
887 request_type, | 889 request_type, |
888 reinterpret_cast<Profile*>(profile_)); | 890 reinterpret_cast<Profile*>(profile_)); |
889 received_content_length_ += received_content_length; | 891 received_content_length_ += received_content_length; |
890 original_content_length_ += original_content_length; | 892 original_content_length_ += original_content_length; |
891 } | 893 } |
OLD | NEW |