Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1020)

Side by Side Diff: content/browser/loader/resource_request_info_impl.h

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: fix ContentResourceProviderTest Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/gtest_prod_util.h" 13 #include "base/gtest_prod_util.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ref_counted.h" 15 #include "base/memory/ref_counted.h"
16 #include "base/supports_user_data.h" 16 #include "base/supports_user_data.h"
17 #include "content/browser/loader/resource_requester_info.h" 17 #include "content/browser/loader/resource_requester_info.h"
18 #include "content/common/resource_request_body_impl.h" 18 #include "content/common/resource_request_body_impl.h"
19 #include "content/common/url_loader.mojom.h" 19 #include "content/common/url_loader.mojom.h"
20 #include "content/public/browser/navigation_ui_data.h" 20 #include "content/public/browser/navigation_ui_data.h"
21 #include "content/public/browser/resource_request_info.h" 21 #include "content/public/browser/resource_request_info.h"
22 #include "content/public/common/previews_state.h"
22 #include "content/public/common/referrer.h" 23 #include "content/public/common/referrer.h"
23 #include "content/public/common/resource_type.h" 24 #include "content/public/common/resource_type.h"
24 #include "net/base/load_states.h" 25 #include "net/base/load_states.h"
25 26
26 namespace content { 27 namespace content {
27 class DetachableResourceHandler; 28 class DetachableResourceHandler;
28 class ResourceContext; 29 class ResourceContext;
29 struct GlobalRequestID; 30 struct GlobalRequestID;
30 struct GlobalRoutingID; 31 struct GlobalRoutingID;
31 32
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool allow_download, 64 bool allow_download,
64 bool has_user_gesture, 65 bool has_user_gesture,
65 bool enable_load_timing, 66 bool enable_load_timing,
66 bool enable_upload_progress, 67 bool enable_upload_progress,
67 bool do_not_prompt_for_login, 68 bool do_not_prompt_for_login,
68 blink::WebReferrerPolicy referrer_policy, 69 blink::WebReferrerPolicy referrer_policy,
69 blink::WebPageVisibilityState visibility_state, 70 blink::WebPageVisibilityState visibility_state,
70 ResourceContext* context, 71 ResourceContext* context,
71 bool report_raw_headers, 72 bool report_raw_headers,
72 bool is_async, 73 bool is_async,
73 bool is_using_lofi, 74 PreviewsState previews_state,
74 const std::string& original_headers, 75 const std::string& original_headers,
75 const scoped_refptr<ResourceRequestBodyImpl> body, 76 const scoped_refptr<ResourceRequestBodyImpl> body,
76 bool initiated_in_secure_context); 77 bool initiated_in_secure_context);
77 ~ResourceRequestInfoImpl() override; 78 ~ResourceRequestInfoImpl() override;
78 79
79 // ResourceRequestInfo implementation: 80 // ResourceRequestInfo implementation:
80 WebContentsGetter GetWebContentsGetterForRequest() const override; 81 WebContentsGetter GetWebContentsGetterForRequest() const override;
81 ResourceContext* GetContext() const override; 82 ResourceContext* GetContext() const override;
82 int GetChildID() const override; 83 int GetChildID() const override;
83 int GetRouteID() const override; 84 int GetRouteID() const override;
84 GlobalRequestID GetGlobalRequestID() const override; 85 GlobalRequestID GetGlobalRequestID() const override;
85 int GetOriginPID() const override; 86 int GetOriginPID() const override;
86 int GetRenderFrameID() const override; 87 int GetRenderFrameID() const override;
87 int GetFrameTreeNodeId() const override; 88 int GetFrameTreeNodeId() const override;
88 bool IsMainFrame() const override; 89 bool IsMainFrame() const override;
89 bool ParentIsMainFrame() const override; 90 bool ParentIsMainFrame() const override;
90 ResourceType GetResourceType() const override; 91 ResourceType GetResourceType() const override;
91 int GetProcessType() const override; 92 int GetProcessType() const override;
92 blink::WebReferrerPolicy GetReferrerPolicy() const override; 93 blink::WebReferrerPolicy GetReferrerPolicy() const override;
93 blink::WebPageVisibilityState GetVisibilityState() const override; 94 blink::WebPageVisibilityState GetVisibilityState() const override;
94 ui::PageTransition GetPageTransition() const override; 95 ui::PageTransition GetPageTransition() const override;
95 bool HasUserGesture() const override; 96 bool HasUserGesture() const override;
96 bool WasIgnoredByHandler() const override; 97 bool WasIgnoredByHandler() const override;
97 bool GetAssociatedRenderFrame(int* render_process_id, 98 bool GetAssociatedRenderFrame(int* render_process_id,
98 int* render_frame_id) const override; 99 int* render_frame_id) const override;
99 bool IsAsync() const override; 100 bool IsAsync() const override;
100 bool IsDownload() const override; 101 bool IsDownload() const override;
101 bool IsUsingLoFi() const override; 102 // Returns a bitmask of potentially several Previews optimizations.
103 PreviewsState GetPreviewsState() const override;
102 bool ShouldReportRawHeaders() const; 104 bool ShouldReportRawHeaders() const;
103 NavigationUIData* GetNavigationUIData() const override; 105 NavigationUIData* GetNavigationUIData() const override;
104 106
105 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); 107 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request);
106 108
107 CONTENT_EXPORT int GetRequestID() const; 109 CONTENT_EXPORT int GetRequestID() const;
108 GlobalRoutingID GetGlobalRoutingID() const; 110 GlobalRoutingID GetGlobalRoutingID() const;
109 111
110 // PlzNavigate 112 // PlzNavigate
111 // The id of the FrameTreeNode that initiated this request (for a navigation 113 // The id of the FrameTreeNode that initiated this request (for a navigation
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 bool was_ignored_by_handler_; 228 bool was_ignored_by_handler_;
227 bool counted_as_in_flight_request_; 229 bool counted_as_in_flight_request_;
228 ResourceType resource_type_; 230 ResourceType resource_type_;
229 ui::PageTransition transition_type_; 231 ui::PageTransition transition_type_;
230 int memory_cost_; 232 int memory_cost_;
231 blink::WebReferrerPolicy referrer_policy_; 233 blink::WebReferrerPolicy referrer_policy_;
232 blink::WebPageVisibilityState visibility_state_; 234 blink::WebPageVisibilityState visibility_state_;
233 ResourceContext* context_; 235 ResourceContext* context_;
234 bool report_raw_headers_; 236 bool report_raw_headers_;
235 bool is_async_; 237 bool is_async_;
236 bool is_using_lofi_; 238 PreviewsState previews_state_;
237 const std::string original_headers_; 239 const std::string original_headers_;
238 scoped_refptr<ResourceRequestBodyImpl> body_; 240 scoped_refptr<ResourceRequestBodyImpl> body_;
239 bool initiated_in_secure_context_; 241 bool initiated_in_secure_context_;
240 std::unique_ptr<NavigationUIData> navigation_ui_data_; 242 std::unique_ptr<NavigationUIData> navigation_ui_data_;
241 243
242 // This callback is set by MojoAsyncResourceHandler to update its mojo binding 244 // This callback is set by MojoAsyncResourceHandler to update its mojo binding
243 // and remote endpoint. This callback will be removed once PlzNavigate is 245 // and remote endpoint. This callback will be removed once PlzNavigate is
244 // shipped. 246 // shipped.
245 TransferCallback on_transfer_; 247 TransferCallback on_transfer_;
246 248
247 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); 249 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl);
248 }; 250 };
249 251
250 } // namespace content 252 } // namespace content
251 253
252 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ 254 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_loader_unittest.cc ('k') | content/browser/loader/resource_request_info_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698