OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/net/ios_chrome_network_delegate.h" | 5 #include "ios/chrome/browser/net/ios_chrome_network_delegate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 NOTREACHED(); | 49 NOTREACHED(); |
50 } | 50 } |
51 | 51 |
52 // Record network errors that HTTP requests complete with, including OK and | 52 // Record network errors that HTTP requests complete with, including OK and |
53 // ABORTED. | 53 // ABORTED. |
54 void RecordNetworkErrorHistograms(const net::URLRequest* request) { | 54 void RecordNetworkErrorHistograms(const net::URLRequest* request) { |
55 if (request->url().SchemeIs("http")) { | 55 if (request->url().SchemeIs("http")) { |
56 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.HttpRequestCompletionErrorCodes", | 56 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.HttpRequestCompletionErrorCodes", |
57 std::abs(request->status().error())); | 57 std::abs(request->status().error())); |
58 | 58 |
59 if (request->load_flags() & net::LOAD_MAIN_FRAME) { | 59 if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) { |
60 UMA_HISTOGRAM_SPARSE_SLOWLY( | 60 UMA_HISTOGRAM_SPARSE_SLOWLY( |
61 "Net.HttpRequestCompletionErrorCodes.MainFrame", | 61 "Net.HttpRequestCompletionErrorCodes.MainFrame", |
62 std::abs(request->status().error())); | 62 std::abs(request->status().error())); |
63 } | 63 } |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 } // namespace | 67 } // namespace |
68 | 68 |
69 IOSChromeNetworkDelegate::IOSChromeNetworkDelegate() | 69 IOSChromeNetworkDelegate::IOSChromeNetworkDelegate() |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 166 } |
167 | 167 |
168 bool IOSChromeNetworkDelegate:: | 168 bool IOSChromeNetworkDelegate:: |
169 OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 169 OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
170 const net::URLRequest& request, | 170 const net::URLRequest& request, |
171 const GURL& target_url, | 171 const GURL& target_url, |
172 const GURL& referrer_url) const { | 172 const GURL& referrer_url) const { |
173 ReportInvalidReferrerSend(target_url, referrer_url); | 173 ReportInvalidReferrerSend(target_url, referrer_url); |
174 return true; | 174 return true; |
175 } | 175 } |
OLD | NEW |