| 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" |
| 11 #include "base/debug/dump_without_crashing.h" | 11 #include "base/debug/dump_without_crashing.h" |
| 12 #include "base/debug/stack_trace.h" | 12 #include "base/debug/stack_trace.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/metrics/sparse_histogram.h" | 15 #include "base/metrics/sparse_histogram.h" |
| 16 #include "base/metrics/user_metrics.h" | 16 #include "base/metrics/user_metrics.h" |
| 17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/profiler/scoped_tracker.h" | 18 #include "base/profiler/scoped_tracker.h" |
| 19 #include "components/prefs/pref_member.h" | 19 #include "components/prefs/pref_member.h" |
| 20 #include "components/prefs/pref_service.h" | 20 #include "components/prefs/pref_service.h" |
| 21 #include "ios/chrome/browser/pref_names.h" | 21 #include "ios/chrome/browser/pref_names.h" |
| 22 #include "ios/web/public/web_thread.h" | 22 #include "ios/web/public/web_thread.h" |
| 23 #include "net/base/load_flags.h" | 23 #include "net/base/load_flags.h" |
| 24 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
| 25 #include "net/cookies/cookie_options.h" | 25 #include "net/cookies/cookie_options.h" |
| 26 #include "net/http/http_status_code.h" | 26 #include "net/http/http_status_code.h" |
| 27 #include "net/log/net_log.h" | |
| 28 #include "net/url_request/url_request.h" | 27 #include "net/url_request/url_request.h" |
| 29 | 28 |
| 30 namespace { | 29 namespace { |
| 31 | 30 |
| 32 const char kDNTHeader[] = "DNT"; | 31 const char kDNTHeader[] = "DNT"; |
| 33 | 32 |
| 34 void ReportInvalidReferrerSendOnUI() { | 33 void ReportInvalidReferrerSendOnUI() { |
| 35 base::RecordAction( | 34 base::RecordAction( |
| 36 base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer")); | 35 base::UserMetricsAction("Net.URLRequest_StartJob_InvalidReferrer")); |
| 37 } | 36 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 166 } |
| 168 | 167 |
| 169 bool IOSChromeNetworkDelegate:: | 168 bool IOSChromeNetworkDelegate:: |
| 170 OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 169 OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 171 const net::URLRequest& request, | 170 const net::URLRequest& request, |
| 172 const GURL& target_url, | 171 const GURL& target_url, |
| 173 const GURL& referrer_url) const { | 172 const GURL& referrer_url) const { |
| 174 ReportInvalidReferrerSend(target_url, referrer_url); | 173 ReportInvalidReferrerSend(target_url, referrer_url); |
| 175 return true; | 174 return true; |
| 176 } | 175 } |
| OLD | NEW |