Chromium Code Reviews| 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/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
| 16 #include "content/common/service_worker/service_worker_types.h" | |
| 16 #include "content/public/browser/resource_request_info.h" | 17 #include "content/public/browser/resource_request_info.h" |
| 17 #include "content/public/common/referrer.h" | 18 #include "content/public/common/referrer.h" |
| 18 #include "content/public/common/resource_type.h" | 19 #include "content/public/common/resource_type.h" |
| 19 #include "net/base/load_states.h" | 20 #include "net/base/load_states.h" |
| 20 | 21 |
| 21 namespace content { | 22 namespace content { |
| 22 class CrossSiteResourceHandler; | 23 class CrossSiteResourceHandler; |
| 23 class DetachableResourceHandler; | 24 class DetachableResourceHandler; |
| 24 class ResourceContext; | 25 class ResourceContext; |
| 25 class ResourceMessageFilter; | 26 class ResourceMessageFilter; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 46 int frame_tree_node_id, | 47 int frame_tree_node_id, |
| 47 int origin_pid, | 48 int origin_pid, |
| 48 int request_id, | 49 int request_id, |
| 49 int render_frame_id, | 50 int render_frame_id, |
| 50 bool is_main_frame, | 51 bool is_main_frame, |
| 51 bool parent_is_main_frame, | 52 bool parent_is_main_frame, |
| 52 int parent_render_frame_id, | 53 int parent_render_frame_id, |
| 53 ResourceType resource_type, | 54 ResourceType resource_type, |
| 54 ui::PageTransition transition_type, | 55 ui::PageTransition transition_type, |
| 55 bool should_replace_current_entry, | 56 bool should_replace_current_entry, |
| 57 FetchRedirectMode fetch_redirect_mode, | |
| 56 bool is_download, | 58 bool is_download, |
| 57 bool is_stream, | 59 bool is_stream, |
| 58 bool allow_download, | 60 bool allow_download, |
| 59 bool has_user_gesture, | 61 bool has_user_gesture, |
| 60 bool enable_load_timing, | 62 bool enable_load_timing, |
| 61 bool enable_upload_progress, | 63 bool enable_upload_progress, |
| 62 bool do_not_prompt_for_login, | 64 bool do_not_prompt_for_login, |
| 63 blink::WebReferrerPolicy referrer_policy, | 65 blink::WebReferrerPolicy referrer_policy, |
| 64 blink::WebPageVisibilityState visibility_state, | 66 blink::WebPageVisibilityState visibility_state, |
| 65 ResourceContext* context, | 67 ResourceContext* context, |
| 66 base::WeakPtr<ResourceMessageFilter> filter, | 68 base::WeakPtr<ResourceMessageFilter> filter, |
| 67 bool is_async); | 69 bool is_async); |
|
mmenke
2015/08/10 15:52:02
I love this class's constructor. :(
| |
| 68 ~ResourceRequestInfoImpl() override; | 70 ~ResourceRequestInfoImpl() override; |
| 69 | 71 |
| 70 // ResourceRequestInfo implementation: | 72 // ResourceRequestInfo implementation: |
| 71 ResourceContext* GetContext() const override; | 73 ResourceContext* GetContext() const override; |
| 72 int GetChildID() const override; | 74 int GetChildID() const override; |
| 73 int GetRouteID() const override; | 75 int GetRouteID() const override; |
| 74 int GetOriginPID() const override; | 76 int GetOriginPID() const override; |
| 75 int GetRequestID() const override; | 77 int GetRequestID() const override; |
| 76 int GetRenderFrameID() const override; | 78 int GetRenderFrameID() const override; |
| 77 bool IsMainFrame() const override; | 79 bool IsMainFrame() const override; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 140 | 142 |
| 141 // Identifies the type of process (renderer, plugin, etc.) making the request. | 143 // Identifies the type of process (renderer, plugin, etc.) making the request. |
| 142 int process_type() const { return process_type_; } | 144 int process_type() const { return process_type_; } |
| 143 | 145 |
| 144 // Downloads are allowed only as a top level request. | 146 // Downloads are allowed only as a top level request. |
| 145 bool allow_download() const { return allow_download_; } | 147 bool allow_download() const { return allow_download_; } |
| 146 | 148 |
| 147 // Whether this is a download. | 149 // Whether this is a download. |
| 148 void set_is_download(bool download) { is_download_ = download; } | 150 void set_is_download(bool download) { is_download_ = download; } |
| 149 | 151 |
| 152 FetchRedirectMode fetch_redirect_mode() const { return fetch_redirect_mode_; } | |
| 153 | |
| 150 // Whether this is a stream. | 154 // Whether this is a stream. |
| 151 bool is_stream() const { return is_stream_; } | 155 bool is_stream() const { return is_stream_; } |
| 152 void set_is_stream(bool stream) { is_stream_ = stream; } | 156 void set_is_stream(bool stream) { is_stream_ = stream; } |
| 153 | 157 |
| 154 void set_was_ignored_by_handler(bool value) { | 158 void set_was_ignored_by_handler(bool value) { |
| 155 was_ignored_by_handler_ = value; | 159 was_ignored_by_handler_ = value; |
| 156 } | 160 } |
| 157 | 161 |
| 158 // Whether this request has been counted towards the number of in flight | 162 // Whether this request has been counted towards the number of in flight |
| 159 // requests, which is only true for requests that require a file descriptor | 163 // requests, which is only true for requests that require a file descriptor |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 int child_id_; | 196 int child_id_; |
| 193 int route_id_; | 197 int route_id_; |
| 194 const int frame_tree_node_id_; | 198 const int frame_tree_node_id_; |
| 195 int origin_pid_; | 199 int origin_pid_; |
| 196 int request_id_; | 200 int request_id_; |
| 197 int render_frame_id_; | 201 int render_frame_id_; |
| 198 bool is_main_frame_; | 202 bool is_main_frame_; |
| 199 bool parent_is_main_frame_; | 203 bool parent_is_main_frame_; |
| 200 int parent_render_frame_id_; | 204 int parent_render_frame_id_; |
| 201 bool should_replace_current_entry_; | 205 bool should_replace_current_entry_; |
| 206 FetchRedirectMode fetch_redirect_mode_; | |
| 202 bool is_download_; | 207 bool is_download_; |
| 203 bool is_stream_; | 208 bool is_stream_; |
| 204 bool allow_download_; | 209 bool allow_download_; |
| 205 bool has_user_gesture_; | 210 bool has_user_gesture_; |
| 206 bool enable_load_timing_; | 211 bool enable_load_timing_; |
| 207 bool enable_upload_progress_; | 212 bool enable_upload_progress_; |
| 208 bool do_not_prompt_for_login_; | 213 bool do_not_prompt_for_login_; |
| 209 bool was_ignored_by_handler_; | 214 bool was_ignored_by_handler_; |
| 210 bool counted_as_in_flight_request_; | 215 bool counted_as_in_flight_request_; |
| 211 ResourceType resource_type_; | 216 ResourceType resource_type_; |
| 212 ui::PageTransition transition_type_; | 217 ui::PageTransition transition_type_; |
| 213 int memory_cost_; | 218 int memory_cost_; |
| 214 blink::WebReferrerPolicy referrer_policy_; | 219 blink::WebReferrerPolicy referrer_policy_; |
| 215 blink::WebPageVisibilityState visibility_state_; | 220 blink::WebPageVisibilityState visibility_state_; |
| 216 ResourceContext* context_; | 221 ResourceContext* context_; |
| 217 // The filter might be deleted without deleting this object if the process | 222 // The filter might be deleted without deleting this object if the process |
| 218 // exits during a transfer. | 223 // exits during a transfer. |
| 219 base::WeakPtr<ResourceMessageFilter> filter_; | 224 base::WeakPtr<ResourceMessageFilter> filter_; |
| 220 bool is_async_; | 225 bool is_async_; |
| 221 | 226 |
| 222 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 227 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
| 223 }; | 228 }; |
| 224 | 229 |
| 225 } // namespace content | 230 } // namespace content |
| 226 | 231 |
| 227 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 232 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| OLD | NEW |