OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_dispatcher_host_request_info.h" | 5 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
6 | 6 |
7 #include "chrome/browser/ssl/ssl_client_auth_handler.h" | 7 #include "chrome/browser/ssl/ssl_client_auth_handler.h" |
8 #include "chrome/browser/ui/login/login_prompt.h" | 8 #include "chrome/browser/ui/login/login_prompt.h" |
9 #include "content/browser/renderer_host/resource_handler.h" | 9 #include "content/browser/renderer_host/resource_handler.h" |
10 #include "webkit/blob/blob_data.h" | 10 #include "webkit/blob/blob_data.h" |
11 | 11 |
12 ResourceDispatcherHostRequestInfo::ResourceDispatcherHostRequestInfo( | 12 ResourceDispatcherHostRequestInfo::ResourceDispatcherHostRequestInfo( |
13 ResourceHandler* handler, | 13 ResourceHandler* handler, |
14 ChildProcessInfo::ProcessType process_type, | 14 ChildProcessInfo::ProcessType process_type, |
15 int child_id, | 15 int child_id, |
16 int route_id, | 16 int route_id, |
17 int request_id, | 17 int request_id, |
18 ResourceType::Type resource_type, | 18 ResourceType::Type resource_type, |
19 uint64 upload_size, | 19 uint64 upload_size, |
20 bool is_download, | 20 bool is_download, |
21 bool allow_download, | 21 bool allow_download, |
22 bool has_user_gesture, | 22 bool has_user_gesture) |
23 int host_renderer_id, | |
24 int host_render_view_id) | |
25 : resource_handler_(handler), | 23 : resource_handler_(handler), |
26 cross_site_handler_(NULL), | 24 cross_site_handler_(NULL), |
27 process_type_(process_type), | 25 process_type_(process_type), |
28 child_id_(child_id), | 26 child_id_(child_id), |
29 route_id_(route_id), | 27 route_id_(route_id), |
30 request_id_(request_id), | 28 request_id_(request_id), |
31 pending_data_count_(0), | 29 pending_data_count_(0), |
32 is_download_(is_download), | 30 is_download_(is_download), |
33 allow_download_(allow_download), | 31 allow_download_(allow_download), |
34 has_user_gesture_(has_user_gesture), | 32 has_user_gesture_(has_user_gesture), |
35 pause_count_(0), | 33 pause_count_(0), |
36 resource_type_(resource_type), | 34 resource_type_(resource_type), |
37 replace_extension_localization_templates_(false), | 35 replace_extension_localization_templates_(false), |
38 last_load_state_(net::LOAD_STATE_IDLE), | 36 last_load_state_(net::LOAD_STATE_IDLE), |
39 upload_size_(upload_size), | 37 upload_size_(upload_size), |
40 last_upload_position_(0), | 38 last_upload_position_(0), |
41 waiting_for_upload_progress_ack_(false), | 39 waiting_for_upload_progress_ack_(false), |
42 memory_cost_(0), | 40 memory_cost_(0), |
43 is_paused_(false), | 41 is_paused_(false), |
44 called_on_response_started_(false), | 42 called_on_response_started_(false), |
45 has_started_reading_(false), | 43 has_started_reading_(false), |
46 paused_read_bytes_(0), | 44 paused_read_bytes_(0) { |
47 host_renderer_id_(host_renderer_id), | |
48 host_render_view_id_(host_render_view_id) { | |
49 } | 45 } |
50 | 46 |
51 ResourceDispatcherHostRequestInfo::~ResourceDispatcherHostRequestInfo() { | 47 ResourceDispatcherHostRequestInfo::~ResourceDispatcherHostRequestInfo() { |
52 resource_handler_->OnRequestClosed(); | 48 resource_handler_->OnRequestClosed(); |
53 } | 49 } |
54 | 50 |
55 void ResourceDispatcherHostRequestInfo::set_login_handler(LoginHandler* lh) { | 51 void ResourceDispatcherHostRequestInfo::set_login_handler(LoginHandler* lh) { |
56 login_handler_ = lh; | 52 login_handler_ = lh; |
57 } | 53 } |
58 | 54 |
59 void ResourceDispatcherHostRequestInfo::set_ssl_client_auth_handler( | 55 void ResourceDispatcherHostRequestInfo::set_ssl_client_auth_handler( |
60 SSLClientAuthHandler* s) { | 56 SSLClientAuthHandler* s) { |
61 ssl_client_auth_handler_ = s; | 57 ssl_client_auth_handler_ = s; |
62 } | 58 } |
63 | 59 |
64 void ResourceDispatcherHostRequestInfo::set_requested_blob_data( | 60 void ResourceDispatcherHostRequestInfo::set_requested_blob_data( |
65 webkit_blob::BlobData* data) { | 61 webkit_blob::BlobData* data) { |
66 requested_blob_data_ = data; | 62 requested_blob_data_ = data; |
67 } | 63 } |
OLD | NEW |