| 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 "content/browser/loader/resource_request_info_impl.h" | 5 #include "content/browser/loader/resource_request_info_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/loader/global_routing_id.h" | 7 #include "content/browser/loader/global_routing_id.h" |
| 8 #include "content/browser/loader/resource_message_filter.h" | 8 #include "content/browser/loader/resource_message_filter.h" |
| 9 #include "content/common/net/url_request_user_data.h" | 9 #include "content/common/net/url_request_user_data.h" |
| 10 #include "content/public/browser/global_request_id.h" | 10 #include "content/public/browser/global_request_id.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request, | 26 void ResourceRequestInfo::AllocateForTesting(net::URLRequest* request, |
| 27 ResourceType resource_type, | 27 ResourceType resource_type, |
| 28 ResourceContext* context, | 28 ResourceContext* context, |
| 29 int render_process_id, | 29 int render_process_id, |
| 30 int render_view_id, | 30 int render_view_id, |
| 31 int render_frame_id, | 31 int render_frame_id, |
| 32 bool is_main_frame, | 32 bool is_main_frame, |
| 33 bool parent_is_main_frame, | 33 bool parent_is_main_frame, |
| 34 bool allow_download, |
| 34 bool is_async) { | 35 bool is_async) { |
| 35 // Make sure both |is_main_frame| and |parent_is_main_frame| aren't set at the | 36 // Make sure both |is_main_frame| and |parent_is_main_frame| aren't set at the |
| 36 // same time. | 37 // same time. |
| 37 DCHECK(!(is_main_frame && parent_is_main_frame)); | 38 DCHECK(!(is_main_frame && parent_is_main_frame)); |
| 38 | 39 |
| 39 // Make sure RESOURCE_TYPE_MAIN_FRAME is declared as being fetched as part of | 40 // Make sure RESOURCE_TYPE_MAIN_FRAME is declared as being fetched as part of |
| 40 // the main frame. | 41 // the main frame. |
| 41 DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame); | 42 DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame); |
| 42 | 43 |
| 43 ResourceRequestInfoImpl* info = | 44 ResourceRequestInfoImpl* info = |
| 44 new ResourceRequestInfoImpl( | 45 new ResourceRequestInfoImpl( |
| 45 PROCESS_TYPE_RENDERER, // process_type | 46 PROCESS_TYPE_RENDERER, // process_type |
| 46 render_process_id, // child_id | 47 render_process_id, // child_id |
| 47 render_view_id, // route_id | 48 render_view_id, // route_id |
| 48 0, // origin_pid | 49 0, // origin_pid |
| 49 0, // request_id | 50 0, // request_id |
| 50 render_frame_id, // render_frame_id | 51 render_frame_id, // render_frame_id |
| 51 is_main_frame, // is_main_frame | 52 is_main_frame, // is_main_frame |
| 52 parent_is_main_frame, // parent_is_main_frame | 53 parent_is_main_frame, // parent_is_main_frame |
| 53 0, // parent_render_frame_id | 54 0, // parent_render_frame_id |
| 54 resource_type, // resource_type | 55 resource_type, // resource_type |
| 55 ui::PAGE_TRANSITION_LINK, // transition_type | 56 ui::PAGE_TRANSITION_LINK, // transition_type |
| 56 false, // should_replace_current_entry | 57 false, // should_replace_current_entry |
| 57 false, // is_download | 58 false, // is_download |
| 58 false, // is_stream | 59 false, // is_stream |
| 59 true, // allow_download | 60 allow_download, // allow_download |
| 60 false, // has_user_gesture | 61 false, // has_user_gesture |
| 61 false, // enable load timing | 62 false, // enable load timing |
| 62 false, // enable upload progress | 63 false, // enable upload progress |
| 63 blink::WebReferrerPolicyDefault, // referrer_policy | 64 blink::WebReferrerPolicyDefault, // referrer_policy |
| 64 blink::WebPageVisibilityStateVisible, // visibility_state | 65 blink::WebPageVisibilityStateVisible, // visibility_state |
| 65 context, // context | 66 context, // context |
| 66 base::WeakPtr<ResourceMessageFilter>(), // filter | 67 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 67 is_async); // is_async | 68 is_async); // is_async |
| 68 info->AssociateWithRequest(request); | 69 info->AssociateWithRequest(request); |
| 69 } | 70 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 base::WeakPtr<ResourceMessageFilter> filter) { | 269 base::WeakPtr<ResourceMessageFilter> filter) { |
| 269 child_id_ = child_id; | 270 child_id_ = child_id; |
| 270 route_id_ = route_id; | 271 route_id_ = route_id; |
| 271 origin_pid_ = origin_pid; | 272 origin_pid_ = origin_pid; |
| 272 request_id_ = request_id; | 273 request_id_ = request_id; |
| 273 parent_render_frame_id_ = parent_render_frame_id; | 274 parent_render_frame_id_ = parent_render_frame_id; |
| 274 filter_ = filter; | 275 filter_ = filter; |
| 275 } | 276 } |
| 276 | 277 |
| 277 } // namespace content | 278 } // namespace content |
| OLD | NEW |