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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 #if defined(ENABLE_TASK_MANAGER) | 484 #if defined(ENABLE_TASK_MANAGER) |
485 // Note: Currently, OnNetworkBytesReceived is only implemented for HTTP jobs, | 485 // Note: Currently, OnNetworkBytesReceived is only implemented for HTTP jobs, |
486 // not FTP or other types, so those kinds of bytes will not be reported here. | 486 // not FTP or other types, so those kinds of bytes will not be reported here. |
487 task_management::TaskManagerInterface::OnRawBytesRead(request, | 487 task_management::TaskManagerInterface::OnRawBytesRead(request, |
488 bytes_received); | 488 bytes_received); |
489 #endif // defined(ENABLE_TASK_MANAGER) | 489 #endif // defined(ENABLE_TASK_MANAGER) |
490 } | 490 } |
491 | 491 |
492 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, | 492 void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request, |
493 bool started) { | 493 bool started) { |
494 data_use_measurement_.ReportDataUseUMA(request); | |
mmenke
2015/09/02 21:48:08
You need to do this on redirects, too - following
amohammadkhan
2015/09/03 04:31:18
Done.
| |
494 RecordNetworkErrorHistograms(request); | 495 RecordNetworkErrorHistograms(request); |
495 if (started) { | 496 if (started) { |
496 // Only call in for requests that were started, to obey the precondition | 497 // Only call in for requests that were started, to obey the precondition |
497 // that RecordCacheStateStats can only be called on requests for which | 498 // that RecordCacheStateStats can only be called on requests for which |
498 // OnResponseStarted was called. | 499 // OnResponseStarted was called. |
499 RecordCacheStateStats(request); | 500 RecordCacheStateStats(request); |
500 } | 501 } |
501 | 502 |
502 if (request->status().status() == net::URLRequestStatus::SUCCESS) { | 503 if (request->status().status() == net::URLRequestStatus::SUCCESS) { |
503 #if defined(OS_ANDROID) | 504 #if defined(OS_ANDROID) |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 return experimental_web_platform_features_enabled_; | 690 return experimental_web_platform_features_enabled_; |
690 } | 691 } |
691 | 692 |
692 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 693 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
693 const net::URLRequest& request, | 694 const net::URLRequest& request, |
694 const GURL& target_url, | 695 const GURL& target_url, |
695 const GURL& referrer_url) const { | 696 const GURL& referrer_url) const { |
696 ReportInvalidReferrerSend(target_url, referrer_url); | 697 ReportInvalidReferrerSend(target_url, referrer_url); |
697 return true; | 698 return true; |
698 } | 699 } |
OLD | NEW |