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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const bool kCaseSensitive = true; | 182 const bool kCaseSensitive = true; |
183 | 183 |
184 std::string mime_type; | 184 std::string mime_type; |
185 request->GetMimeType(&mime_type); | 185 request->GetMimeType(&mime_type); |
186 | 186 |
187 for (size_t i = 0; i < arraysize(kEligibleMasks); i++) { | 187 for (size_t i = 0; i < arraysize(kEligibleMasks); i++) { |
188 const char *prefix = kEligibleMasks[i].prefix; | 188 const char *prefix = kEligibleMasks[i].prefix; |
189 const char *suffix = kEligibleMasks[i].suffix; | 189 const char *suffix = kEligibleMasks[i].suffix; |
190 if (prefix && !base::StartsWithASCII(mime_type, prefix, kCaseSensitive)) | 190 if (prefix && !base::StartsWithASCII(mime_type, prefix, kCaseSensitive)) |
191 continue; | 191 continue; |
192 if (suffix && !EndsWith(mime_type, suffix, kCaseSensitive)) | 192 if (suffix && !base::EndsWith(mime_type, suffix, kCaseSensitive)) |
193 continue; | 193 continue; |
194 return true; | 194 return true; |
195 } | 195 } |
196 return false; | 196 return false; |
197 } | 197 } |
198 | 198 |
199 // Returns whether |request| was issued by a renderer process, as opposed to | 199 // Returns whether |request| was issued by a renderer process, as opposed to |
200 // the browser process or a plugin process. | 200 // the browser process or a plugin process. |
201 bool IsRendererInitiatedRequest(const net::URLRequest* request) { | 201 bool IsRendererInitiatedRequest(const net::URLRequest* request) { |
202 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 202 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 return experimental_web_platform_features_enabled_; | 707 return experimental_web_platform_features_enabled_; |
708 } | 708 } |
709 | 709 |
710 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 710 bool ChromeNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
711 const net::URLRequest& request, | 711 const net::URLRequest& request, |
712 const GURL& target_url, | 712 const GURL& target_url, |
713 const GURL& referrer_url) const { | 713 const GURL& referrer_url) const { |
714 ReportInvalidReferrerSend(target_url, referrer_url); | 714 ReportInvalidReferrerSend(target_url, referrer_url); |
715 return true; | 715 return true; |
716 } | 716 } |
OLD | NEW |