OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/public/browser/resource_request_info.h" |
| 6 |
| 7 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 8 #include "content/public/common/process_type.h" |
| 9 #include "ipc/ipc_message.h" |
| 10 #include "net/url_request/url_request.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 // static |
| 15 const ResourceRequestInfo* ResourceRequestInfo::ForRequest( |
| 16 const net::URLRequest* request) { |
| 17 return static_cast<const ResourceRequestInfo*>(request->GetUserData(NULL)); |
| 18 } |
| 19 |
| 20 // static |
| 21 ResourceRequestInfo* ResourceRequestInfo::CreateForTesting( |
| 22 ResourceContext* context) { |
| 23 return new ResourceDispatcherHostRequestInfo( |
| 24 NULL, // handler |
| 25 PROCESS_TYPE_RENDERER, // process_type |
| 26 -1, // child_id |
| 27 MSG_ROUTING_NONE, // route_id |
| 28 0, // origin_pid |
| 29 0, // request_id |
| 30 true, // is_main_frame |
| 31 0, // frame_id |
| 32 false, // parent_is_main_frame |
| 33 0, // parent_frame_id |
| 34 ResourceType::MAIN_FRAME, // resource_type |
| 35 PAGE_TRANSITION_LINK, // transition_type |
| 36 0, // upload_size |
| 37 false, // is_download |
| 38 true, // allow_download |
| 39 false, // has_user_gesture |
| 40 WebKit::WebReferrerPolicyDefault, // referrer_policy |
| 41 context); // context |
| 42 } |
| 43 |
| 44 ResourceRequestInfo::ResourceRequestInfo( |
| 45 ResourceContext* context, |
| 46 int child_id, |
| 47 int route_id, |
| 48 int origin_pid, |
| 49 int request_id, |
| 50 bool is_main_frame, |
| 51 int64 frame_id, |
| 52 bool parent_is_main_frame, |
| 53 int64 parent_frame_id, |
| 54 ResourceType::Type resource_type, |
| 55 WebKit::WebReferrerPolicy referrer_policy, |
| 56 uint64 upload_size) |
| 57 : context_(context), |
| 58 child_id_(child_id), |
| 59 route_id_(route_id), |
| 60 origin_pid_(origin_pid), |
| 61 request_id_(request_id), |
| 62 frame_id_(frame_id), |
| 63 parent_frame_id_(parent_frame_id), |
| 64 is_main_frame_(is_main_frame), |
| 65 parent_is_main_frame_(parent_is_main_frame), |
| 66 resource_type_(resource_type), |
| 67 referrer_policy_(referrer_policy), |
| 68 upload_size_(upload_size) { |
| 69 } |
| 70 |
| 71 ResourceRequestInfo::~ResourceRequestInfo() { |
| 72 } |
| 73 |
| 74 } // namespace content |
OLD | NEW |