| 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 <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2058 loader->NotifyRequestFailed(false, net::ERR_ABORTED); | 2058 loader->NotifyRequestFailed(false, net::ERR_ABORTED); |
| 2059 return; | 2059 return; |
| 2060 } | 2060 } |
| 2061 | 2061 |
| 2062 const net::URLRequestContext* request_context = | 2062 const net::URLRequestContext* request_context = |
| 2063 resource_context->GetRequestContext(); | 2063 resource_context->GetRequestContext(); |
| 2064 | 2064 |
| 2065 int load_flags = info.begin_params.load_flags; | 2065 int load_flags = info.begin_params.load_flags; |
| 2066 load_flags |= net::LOAD_VERIFY_EV_CERT; | 2066 load_flags |= net::LOAD_VERIFY_EV_CERT; |
| 2067 if (info.is_main_frame) | 2067 if (info.is_main_frame) |
| 2068 load_flags |= net::LOAD_MAIN_FRAME; | 2068 load_flags |= net::LOAD_MAIN_FRAME_DEPRECATED; |
| 2069 | 2069 |
| 2070 // TODO(davidben): BuildLoadFlagsForRequest includes logic for | 2070 // TODO(davidben): BuildLoadFlagsForRequest includes logic for |
| 2071 // CanSendCookiesForOrigin and CanReadRawCookies. Is this needed here? | 2071 // CanSendCookiesForOrigin and CanReadRawCookies. Is this needed here? |
| 2072 | 2072 |
| 2073 // Sync loads should have maximum priority and should be the only | 2073 // Sync loads should have maximum priority and should be the only |
| 2074 // requests that have the ignore limits flag set. | 2074 // requests that have the ignore limits flag set. |
| 2075 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); | 2075 DCHECK(!(load_flags & net::LOAD_IGNORE_LIMITS)); |
| 2076 | 2076 |
| 2077 std::unique_ptr<net::URLRequest> new_request; | 2077 std::unique_ptr<net::URLRequest> new_request; |
| 2078 new_request = request_context->CreateRequest( | 2078 new_request = request_context->CreateRequest( |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2558 int child_id, | 2558 int child_id, |
| 2559 bool is_sync_load) { | 2559 bool is_sync_load) { |
| 2560 int load_flags = request_data.load_flags; | 2560 int load_flags = request_data.load_flags; |
| 2561 | 2561 |
| 2562 // Although EV status is irrelevant to sub-frames and sub-resources, we have | 2562 // Although EV status is irrelevant to sub-frames and sub-resources, we have |
| 2563 // to perform EV certificate verification on all resources because an HTTP | 2563 // to perform EV certificate verification on all resources because an HTTP |
| 2564 // keep-alive connection created to load a sub-frame or a sub-resource could | 2564 // keep-alive connection created to load a sub-frame or a sub-resource could |
| 2565 // be reused to load a main frame. | 2565 // be reused to load a main frame. |
| 2566 load_flags |= net::LOAD_VERIFY_EV_CERT; | 2566 load_flags |= net::LOAD_VERIFY_EV_CERT; |
| 2567 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { | 2567 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { |
| 2568 load_flags |= net::LOAD_MAIN_FRAME; | 2568 load_flags |= net::LOAD_MAIN_FRAME_DEPRECATED; |
| 2569 } else if (request_data.resource_type == RESOURCE_TYPE_PREFETCH) { | 2569 } else if (request_data.resource_type == RESOURCE_TYPE_PREFETCH) { |
| 2570 load_flags |= net::LOAD_PREFETCH; | 2570 load_flags |= net::LOAD_PREFETCH; |
| 2571 } | 2571 } |
| 2572 | 2572 |
| 2573 if (is_sync_load) | 2573 if (is_sync_load) |
| 2574 load_flags |= net::LOAD_IGNORE_LIMITS; | 2574 load_flags |= net::LOAD_IGNORE_LIMITS; |
| 2575 | 2575 |
| 2576 return load_flags; | 2576 return load_flags; |
| 2577 } | 2577 } |
| 2578 | 2578 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2673 request_info->GetRouteID(), is_content_initiated, true, &throttles); | 2673 request_info->GetRouteID(), is_content_initiated, true, &throttles); |
| 2674 if (!throttles.empty()) { | 2674 if (!throttles.empty()) { |
| 2675 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2675 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2676 std::move(throttles))); | 2676 std::move(throttles))); |
| 2677 } | 2677 } |
| 2678 } | 2678 } |
| 2679 return handler; | 2679 return handler; |
| 2680 } | 2680 } |
| 2681 | 2681 |
| 2682 } // namespace content | 2682 } // namespace content |
| OLD | NEW |