| 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 switch (referrer.policy) { | 244 switch (referrer.policy) { |
| 245 case blink::WebReferrerPolicyAlways: | 245 case blink::WebReferrerPolicyAlways: |
| 246 case blink::WebReferrerPolicyNever: | 246 case blink::WebReferrerPolicyNever: |
| 247 case blink::WebReferrerPolicyOrigin: | 247 case blink::WebReferrerPolicyOrigin: |
| 248 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; | 248 net_referrer_policy = net::URLRequest::NEVER_CLEAR_REFERRER; |
| 249 break; | 249 break; |
| 250 case blink::WebReferrerPolicyNoReferrerWhenDowngrade: | 250 case blink::WebReferrerPolicyNoReferrerWhenDowngrade: |
| 251 net_referrer_policy = | 251 net_referrer_policy = |
| 252 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE; | 252 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE; |
| 253 break; | 253 break; |
| 254 case blink::WebReferrerPolicyOriginWhenCrossOrigin: |
| 255 net_referrer_policy = |
| 256 net::URLRequest::ORIGIN_ONLY_ON_TRANSITION_CROSS_ORIGIN; |
| 257 break; |
| 254 case blink::WebReferrerPolicyDefault: | 258 case blink::WebReferrerPolicyDefault: |
| 255 default: | 259 default: |
| 256 net_referrer_policy = | 260 net_referrer_policy = |
| 257 command_line->HasSwitch(switches::kReducedReferrerGranularity) | 261 command_line->HasSwitch(switches::kReducedReferrerGranularity) |
| 258 ? net::URLRequest:: | 262 ? net::URLRequest:: |
| 259 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN | 263 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN |
| 260 : net::URLRequest:: | 264 : net::URLRequest:: |
| 261 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE; | 265 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE; |
| 262 break; | 266 break; |
| 263 } | 267 } |
| (...skipping 2085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2349 | 2353 |
| 2350 // Add a flag to selectively bypass the data reduction proxy if the resource | 2354 // Add a flag to selectively bypass the data reduction proxy if the resource |
| 2351 // type is not an image. | 2355 // type is not an image. |
| 2352 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2356 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
| 2353 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2357 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
| 2354 | 2358 |
| 2355 return load_flags; | 2359 return load_flags; |
| 2356 } | 2360 } |
| 2357 | 2361 |
| 2358 } // namespace content | 2362 } // namespace content |
| OLD | NEW |