| 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 23 matching lines...) Expand all Loading... |
| 34 bool allow_download, | 34 bool allow_download, |
| 35 bool is_async) { | 35 bool is_async) { |
| 36 // 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 |
| 37 // same time. | 37 // same time. |
| 38 DCHECK(!(is_main_frame && parent_is_main_frame)); | 38 DCHECK(!(is_main_frame && parent_is_main_frame)); |
| 39 | 39 |
| 40 // 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 |
| 41 // the main frame. | 41 // the main frame. |
| 42 DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame); | 42 DCHECK(resource_type != RESOURCE_TYPE_MAIN_FRAME || is_main_frame); |
| 43 | 43 |
| 44 ResourceRequestInfoImpl* info = | 44 ResourceRequestInfoImpl* info = 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 -1, // frame_tree_node_id |
| 49 0, // origin_pid | 49 0, // origin_pid |
| 50 0, // request_id | 50 0, // request_id |
| 51 render_frame_id, // render_frame_id | 51 render_frame_id, // render_frame_id |
| 52 is_main_frame, // is_main_frame | 52 is_main_frame, // is_main_frame |
| 53 parent_is_main_frame, // parent_is_main_frame | 53 parent_is_main_frame, // parent_is_main_frame |
| 54 0, // parent_render_frame_id | 54 0, // parent_render_frame_id |
| 55 resource_type, // resource_type | 55 resource_type, // resource_type |
| 56 ui::PAGE_TRANSITION_LINK, // transition_type | 56 ui::PAGE_TRANSITION_LINK, // transition_type |
| 57 false, // should_replace_current_entry | 57 false, // should_replace_current_entry |
| 58 false, // is_download | 58 false, // is_download |
| 59 false, // is_stream | 59 false, // is_stream |
| 60 allow_download, // allow_download | 60 allow_download, // allow_download |
| 61 false, // has_user_gesture | 61 false, // has_user_gesture |
| 62 false, // enable load timing | 62 false, // enable load timing |
| 63 false, // enable upload progress | 63 false, // enable upload progress |
| 64 false, // do_not_prompt_for_login | 64 false, // do_not_prompt_for_login |
| 65 blink::WebReferrerPolicyDefault, // referrer_policy | 65 blink::WebReferrerPolicyDefault, // referrer_policy |
| 66 blink::WebPageVisibilityStateVisible, // visibility_state | 66 blink::WebPageVisibilityStateVisible, // visibility_state |
| 67 context, // context | 67 context, // context |
| 68 base::WeakPtr<ResourceMessageFilter>(), // filter | 68 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 69 is_async); // is_async | 69 is_async); // is_async |
| 70 info->AssociateWithRequest(request); | 70 info->AssociateWithRequest(request); |
| 71 } | 71 } |
| 72 | 72 |
| 73 // static | 73 // static |
| 74 bool ResourceRequestInfo::GetRenderFrameForRequest( | 74 bool ResourceRequestInfo::GetRenderFrameForRequest( |
| 75 const net::URLRequest* request, | 75 const net::URLRequest* request, |
| 76 int* render_process_id, | 76 int* render_process_id, |
| 77 int* render_frame_id) { | 77 int* render_frame_id) { |
| 78 URLRequestUserData* user_data = static_cast<URLRequestUserData*>( | 78 URLRequestUserData* user_data = static_cast<URLRequestUserData*>( |
| 79 request->GetUserData(URLRequestUserData::kUserDataKey)); | 79 request->GetUserData(URLRequestUserData::kUserDataKey)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 96 // static | 96 // static |
| 97 const ResourceRequestInfoImpl* ResourceRequestInfoImpl::ForRequest( | 97 const ResourceRequestInfoImpl* ResourceRequestInfoImpl::ForRequest( |
| 98 const net::URLRequest* request) { | 98 const net::URLRequest* request) { |
| 99 return ForRequest(const_cast<net::URLRequest*>(request)); | 99 return ForRequest(const_cast<net::URLRequest*>(request)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 ResourceRequestInfoImpl::ResourceRequestInfoImpl( | 102 ResourceRequestInfoImpl::ResourceRequestInfoImpl( |
| 103 int process_type, | 103 int process_type, |
| 104 int child_id, | 104 int child_id, |
| 105 int route_id, | 105 int route_id, |
| 106 int64 frame_tree_node_id, |
| 106 int origin_pid, | 107 int origin_pid, |
| 107 int request_id, | 108 int request_id, |
| 108 int render_frame_id, | 109 int render_frame_id, |
| 109 bool is_main_frame, | 110 bool is_main_frame, |
| 110 bool parent_is_main_frame, | 111 bool parent_is_main_frame, |
| 111 int parent_render_frame_id, | 112 int parent_render_frame_id, |
| 112 ResourceType resource_type, | 113 ResourceType resource_type, |
| 113 ui::PageTransition transition_type, | 114 ui::PageTransition transition_type, |
| 114 bool should_replace_current_entry, | 115 bool should_replace_current_entry, |
| 115 bool is_download, | 116 bool is_download, |
| 116 bool is_stream, | 117 bool is_stream, |
| 117 bool allow_download, | 118 bool allow_download, |
| 118 bool has_user_gesture, | 119 bool has_user_gesture, |
| 119 bool enable_load_timing, | 120 bool enable_load_timing, |
| 120 bool enable_upload_progress, | 121 bool enable_upload_progress, |
| 121 bool do_not_prompt_for_login, | 122 bool do_not_prompt_for_login, |
| 122 blink::WebReferrerPolicy referrer_policy, | 123 blink::WebReferrerPolicy referrer_policy, |
| 123 blink::WebPageVisibilityState visibility_state, | 124 blink::WebPageVisibilityState visibility_state, |
| 124 ResourceContext* context, | 125 ResourceContext* context, |
| 125 base::WeakPtr<ResourceMessageFilter> filter, | 126 base::WeakPtr<ResourceMessageFilter> filter, |
| 126 bool is_async) | 127 bool is_async) |
| 127 : cross_site_handler_(NULL), | 128 : cross_site_handler_(NULL), |
| 128 detachable_handler_(NULL), | 129 detachable_handler_(NULL), |
| 129 process_type_(process_type), | 130 process_type_(process_type), |
| 130 child_id_(child_id), | 131 child_id_(child_id), |
| 131 route_id_(route_id), | 132 route_id_(route_id), |
| 133 frame_tree_node_id_(frame_tree_node_id), |
| 132 origin_pid_(origin_pid), | 134 origin_pid_(origin_pid), |
| 133 request_id_(request_id), | 135 request_id_(request_id), |
| 134 render_frame_id_(render_frame_id), | 136 render_frame_id_(render_frame_id), |
| 135 is_main_frame_(is_main_frame), | 137 is_main_frame_(is_main_frame), |
| 136 parent_is_main_frame_(parent_is_main_frame), | 138 parent_is_main_frame_(parent_is_main_frame), |
| 137 parent_render_frame_id_(parent_render_frame_id), | 139 parent_render_frame_id_(parent_render_frame_id), |
| 138 should_replace_current_entry_(should_replace_current_entry), | 140 should_replace_current_entry_(should_replace_current_entry), |
| 139 is_download_(is_download), | 141 is_download_(is_download), |
| 140 is_stream_(is_stream), | 142 is_stream_(is_stream), |
| 141 allow_download_(allow_download), | 143 allow_download_(allow_download), |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 base::WeakPtr<ResourceMessageFilter> filter) { | 274 base::WeakPtr<ResourceMessageFilter> filter) { |
| 273 child_id_ = child_id; | 275 child_id_ = child_id; |
| 274 route_id_ = route_id; | 276 route_id_ = route_id; |
| 275 origin_pid_ = origin_pid; | 277 origin_pid_ = origin_pid; |
| 276 request_id_ = request_id; | 278 request_id_ = request_id; |
| 277 parent_render_frame_id_ = parent_render_frame_id; | 279 parent_render_frame_id_ = parent_render_frame_id; |
| 278 filter_ = filter; | 280 filter_ = filter; |
| 279 } | 281 } |
| 280 | 282 |
| 281 } // namespace content | 283 } // namespace content |
| OLD | NEW |