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 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/supports_user_data.h" | 13 #include "base/supports_user_data.h" |
14 #include "content/public/browser/resource_request_info.h" | 14 #include "content/public/browser/resource_request_info.h" |
15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
16 #include "content/public/common/process_type.h" | 16 #include "content/public/common/process_type.h" |
17 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
18 #include "net/base/load_states.h" | 18 #include "net/base/load_states.h" |
19 #include "webkit/glue/resource_type.h" | 19 #include "webkit/glue/resource_type.h" |
20 | 20 |
21 namespace webkit_blob { | 21 namespace webkit_blob { |
22 class BlobData; | 22 class BlobDataHandle; |
23 } | 23 } |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 class AsyncResourceHandler; | 26 class AsyncResourceHandler; |
27 class CrossSiteResourceHandler; | 27 class CrossSiteResourceHandler; |
28 class ResourceContext; | 28 class ResourceContext; |
29 struct GlobalRequestID; | 29 struct GlobalRequestID; |
30 | 30 |
31 // Holds the data ResourceDispatcherHost associates with each request. | 31 // Holds the data ResourceDispatcherHost associates with each request. |
32 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 32 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 void set_was_ignored_by_handler(bool value) { | 116 void set_was_ignored_by_handler(bool value) { |
117 was_ignored_by_handler_ = value; | 117 was_ignored_by_handler_ = value; |
118 } | 118 } |
119 | 119 |
120 // The approximate in-memory size (bytes) that we credited this request | 120 // The approximate in-memory size (bytes) that we credited this request |
121 // as consuming in |outstanding_requests_memory_cost_map_|. | 121 // as consuming in |outstanding_requests_memory_cost_map_|. |
122 int memory_cost() const { return memory_cost_; } | 122 int memory_cost() const { return memory_cost_; } |
123 void set_memory_cost(int cost) { memory_cost_ = cost; } | 123 void set_memory_cost(int cost) { memory_cost_ = cost; } |
124 | 124 |
125 // We hold a reference to the requested blob data to ensure it doesn't | |
126 // get finally released prior to the net::URLRequestJob being started. | |
127 webkit_blob::BlobData* requested_blob_data() const { | |
128 return requested_blob_data_.get(); | |
129 } | |
130 void set_requested_blob_data(webkit_blob::BlobData* data); | |
131 | |
132 private: | 125 private: |
133 // Non-owning, may be NULL. | 126 // Non-owning, may be NULL. |
134 CrossSiteResourceHandler* cross_site_handler_; | 127 CrossSiteResourceHandler* cross_site_handler_; |
135 AsyncResourceHandler* async_handler_; | 128 AsyncResourceHandler* async_handler_; |
136 | 129 |
137 ProcessType process_type_; | 130 ProcessType process_type_; |
138 int child_id_; | 131 int child_id_; |
139 int route_id_; | 132 int route_id_; |
140 int origin_pid_; | 133 int origin_pid_; |
141 int request_id_; | 134 int request_id_; |
142 bool is_main_frame_; | 135 bool is_main_frame_; |
143 int64 frame_id_; | 136 int64 frame_id_; |
144 bool parent_is_main_frame_; | 137 bool parent_is_main_frame_; |
145 int64 parent_frame_id_; | 138 int64 parent_frame_id_; |
146 bool is_download_; | 139 bool is_download_; |
147 bool allow_download_; | 140 bool allow_download_; |
148 bool has_user_gesture_; | 141 bool has_user_gesture_; |
149 bool was_ignored_by_handler_; | 142 bool was_ignored_by_handler_; |
150 ResourceType::Type resource_type_; | 143 ResourceType::Type resource_type_; |
151 PageTransition transition_type_; | 144 PageTransition transition_type_; |
152 int memory_cost_; | 145 int memory_cost_; |
153 scoped_refptr<webkit_blob::BlobData> requested_blob_data_; | |
154 WebKit::WebReferrerPolicy referrer_policy_; | 146 WebKit::WebReferrerPolicy referrer_policy_; |
155 ResourceContext* context_; | 147 ResourceContext* context_; |
156 | 148 |
157 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 149 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
158 }; | 150 }; |
159 | 151 |
160 } // namespace content | 152 } // namespace content |
161 | 153 |
162 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 154 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |