| 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/renderer_host/resource_request_info_impl.h" | 5 #include "content/browser/renderer_host/resource_request_info_impl.h" |
| 6 | 6 |
| 7 #include "content/browser/worker_host/worker_service_impl.h" | 7 #include "content/browser/worker_host/worker_service_impl.h" |
| 8 #include "content/common/net/url_request_user_data.h" | 8 #include "content/common/net/url_request_user_data.h" |
| 9 #include "content/public/browser/global_request_id.h" | 9 #include "content/public/browser/global_request_id.h" |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 render_process_id, // child_id | 34 render_process_id, // child_id |
| 35 render_view_id, // route_id | 35 render_view_id, // route_id |
| 36 0, // origin_pid | 36 0, // origin_pid |
| 37 0, // request_id | 37 0, // request_id |
| 38 resource_type == ResourceType::MAIN_FRAME, // is_main_frame | 38 resource_type == ResourceType::MAIN_FRAME, // is_main_frame |
| 39 0, // frame_id | 39 0, // frame_id |
| 40 false, // parent_is_main_frame | 40 false, // parent_is_main_frame |
| 41 0, // parent_frame_id | 41 0, // parent_frame_id |
| 42 resource_type, // resource_type | 42 resource_type, // resource_type |
| 43 PAGE_TRANSITION_LINK, // transition_type | 43 PAGE_TRANSITION_LINK, // transition_type |
| 44 0, // upload_size | |
| 45 false, // is_download | 44 false, // is_download |
| 46 true, // allow_download | 45 true, // allow_download |
| 47 false, // has_user_gesture | 46 false, // has_user_gesture |
| 48 WebKit::WebReferrerPolicyDefault, // referrer_policy | 47 WebKit::WebReferrerPolicyDefault, // referrer_policy |
| 49 context); // context | 48 context); // context |
| 50 info->AssociateWithRequest(request); | 49 info->AssociateWithRequest(request); |
| 51 } | 50 } |
| 52 | 51 |
| 53 // static | 52 // static |
| 54 bool ResourceRequestInfo::GetRenderViewForRequest( | 53 bool ResourceRequestInfo::GetRenderViewForRequest( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 84 int child_id, | 83 int child_id, |
| 85 int route_id, | 84 int route_id, |
| 86 int origin_pid, | 85 int origin_pid, |
| 87 int request_id, | 86 int request_id, |
| 88 bool is_main_frame, | 87 bool is_main_frame, |
| 89 int64 frame_id, | 88 int64 frame_id, |
| 90 bool parent_is_main_frame, | 89 bool parent_is_main_frame, |
| 91 int64 parent_frame_id, | 90 int64 parent_frame_id, |
| 92 ResourceType::Type resource_type, | 91 ResourceType::Type resource_type, |
| 93 PageTransition transition_type, | 92 PageTransition transition_type, |
| 94 uint64 upload_size, | |
| 95 bool is_download, | 93 bool is_download, |
| 96 bool allow_download, | 94 bool allow_download, |
| 97 bool has_user_gesture, | 95 bool has_user_gesture, |
| 98 WebKit::WebReferrerPolicy referrer_policy, | 96 WebKit::WebReferrerPolicy referrer_policy, |
| 99 ResourceContext* context) | 97 ResourceContext* context) |
| 100 : cross_site_handler_(NULL), | 98 : cross_site_handler_(NULL), |
| 101 async_handler_(NULL), | 99 async_handler_(NULL), |
| 102 process_type_(process_type), | 100 process_type_(process_type), |
| 103 child_id_(child_id), | 101 child_id_(child_id), |
| 104 route_id_(route_id), | 102 route_id_(route_id), |
| 105 origin_pid_(origin_pid), | 103 origin_pid_(origin_pid), |
| 106 request_id_(request_id), | 104 request_id_(request_id), |
| 107 is_main_frame_(is_main_frame), | 105 is_main_frame_(is_main_frame), |
| 108 frame_id_(frame_id), | 106 frame_id_(frame_id), |
| 109 parent_is_main_frame_(parent_is_main_frame), | 107 parent_is_main_frame_(parent_is_main_frame), |
| 110 parent_frame_id_(parent_frame_id), | 108 parent_frame_id_(parent_frame_id), |
| 111 is_download_(is_download), | 109 is_download_(is_download), |
| 112 allow_download_(allow_download), | 110 allow_download_(allow_download), |
| 113 has_user_gesture_(has_user_gesture), | 111 has_user_gesture_(has_user_gesture), |
| 114 resource_type_(resource_type), | 112 resource_type_(resource_type), |
| 115 transition_type_(transition_type), | 113 transition_type_(transition_type), |
| 116 upload_size_(upload_size), | |
| 117 memory_cost_(0), | 114 memory_cost_(0), |
| 118 referrer_policy_(referrer_policy), | 115 referrer_policy_(referrer_policy), |
| 119 context_(context) { | 116 context_(context) { |
| 120 } | 117 } |
| 121 | 118 |
| 122 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() { | 119 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() { |
| 123 } | 120 } |
| 124 | 121 |
| 125 ResourceContext* ResourceRequestInfoImpl::GetContext() const { | 122 ResourceContext* ResourceRequestInfoImpl::GetContext() const { |
| 126 return context_; | 123 return context_; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 156 } |
| 160 | 157 |
| 161 ResourceType::Type ResourceRequestInfoImpl::GetResourceType() const { | 158 ResourceType::Type ResourceRequestInfoImpl::GetResourceType() const { |
| 162 return resource_type_; | 159 return resource_type_; |
| 163 } | 160 } |
| 164 | 161 |
| 165 WebKit::WebReferrerPolicy ResourceRequestInfoImpl::GetReferrerPolicy() const { | 162 WebKit::WebReferrerPolicy ResourceRequestInfoImpl::GetReferrerPolicy() const { |
| 166 return referrer_policy_; | 163 return referrer_policy_; |
| 167 } | 164 } |
| 168 | 165 |
| 169 uint64 ResourceRequestInfoImpl::GetUploadSize() const { | |
| 170 return upload_size_; | |
| 171 } | |
| 172 | |
| 173 bool ResourceRequestInfoImpl::HasUserGesture() const { | 166 bool ResourceRequestInfoImpl::HasUserGesture() const { |
| 174 return has_user_gesture_; | 167 return has_user_gesture_; |
| 175 } | 168 } |
| 176 | 169 |
| 177 bool ResourceRequestInfoImpl::GetAssociatedRenderView( | 170 bool ResourceRequestInfoImpl::GetAssociatedRenderView( |
| 178 int* render_process_id, | 171 int* render_process_id, |
| 179 int* render_view_id) const { | 172 int* render_view_id) const { |
| 180 // If the request is from the worker process, find a content that owns the | 173 // If the request is from the worker process, find a content that owns the |
| 181 // worker. | 174 // worker. |
| 182 if (process_type_ == PROCESS_TYPE_WORKER) { | 175 if (process_type_ == PROCESS_TYPE_WORKER) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 209 GlobalRequestID ResourceRequestInfoImpl::GetGlobalRequestID() const { | 202 GlobalRequestID ResourceRequestInfoImpl::GetGlobalRequestID() const { |
| 210 return GlobalRequestID(child_id_, request_id_); | 203 return GlobalRequestID(child_id_, request_id_); |
| 211 } | 204 } |
| 212 | 205 |
| 213 void ResourceRequestInfoImpl::set_requested_blob_data( | 206 void ResourceRequestInfoImpl::set_requested_blob_data( |
| 214 webkit_blob::BlobData* data) { | 207 webkit_blob::BlobData* data) { |
| 215 requested_blob_data_ = data; | 208 requested_blob_data_ = data; |
| 216 } | 209 } |
| 217 | 210 |
| 218 } // namespace content | 211 } // namespace content |
| OLD | NEW |