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

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

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Added missing comment Created 4 years, 3 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 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.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/resource_request_body_impl.h" 16 #include "content/common/resource_request_body_impl.h"
17 #include "content/public/browser/navigation_ui_data.h"
17 #include "content/public/browser/resource_request_info.h" 18 #include "content/public/browser/resource_request_info.h"
18 #include "content/public/common/referrer.h" 19 #include "content/public/common/referrer.h"
19 #include "content/public/common/resource_type.h" 20 #include "content/public/common/resource_type.h"
20 #include "net/base/load_states.h" 21 #include "net/base/load_states.h"
21 22
22 namespace content { 23 namespace content {
23 class CrossSiteResourceHandler; 24 class CrossSiteResourceHandler;
24 class DetachableResourceHandler; 25 class DetachableResourceHandler;
25 class ResourceContext; 26 class ResourceContext;
26 class ResourceMessageFilter; 27 class ResourceMessageFilter;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 blink::WebPageVisibilityState GetVisibilityState() const override; 88 blink::WebPageVisibilityState GetVisibilityState() const override;
88 ui::PageTransition GetPageTransition() const override; 89 ui::PageTransition GetPageTransition() const override;
89 bool HasUserGesture() const override; 90 bool HasUserGesture() const override;
90 bool WasIgnoredByHandler() const override; 91 bool WasIgnoredByHandler() const override;
91 bool GetAssociatedRenderFrame(int* render_process_id, 92 bool GetAssociatedRenderFrame(int* render_process_id,
92 int* render_frame_id) const override; 93 int* render_frame_id) const override;
93 bool IsAsync() const override; 94 bool IsAsync() const override;
94 bool IsDownload() const override; 95 bool IsDownload() const override;
95 bool IsUsingLoFi() const override; 96 bool IsUsingLoFi() const override;
96 bool ShouldReportRawHeaders() const; 97 bool ShouldReportRawHeaders() const;
98 NavigationUIData* GetNavigationUIData() const override;
97 99
98 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); 100 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request);
99 101
100 CONTENT_EXPORT int GetRequestID() const; 102 CONTENT_EXPORT int GetRequestID() const;
101 CONTENT_EXPORT GlobalRequestID GetGlobalRequestID() const; 103 CONTENT_EXPORT GlobalRequestID GetGlobalRequestID() const;
102 GlobalRoutingID GetGlobalRoutingID() const; 104 GlobalRoutingID GetGlobalRoutingID() const;
103 105
104 // PlzNavigate 106 // PlzNavigate
105 // The id of the FrameTreeNode that initiated this request (for a navigation 107 // The id of the FrameTreeNode that initiated this request (for a navigation
106 // request). 108 // request).
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const scoped_refptr<ResourceRequestBodyImpl>& body() const { return body_; } 192 const scoped_refptr<ResourceRequestBodyImpl>& body() const { return body_; }
191 void ResetBody(); 193 void ResetBody();
192 194
193 bool initiated_in_secure_context() const { 195 bool initiated_in_secure_context() const {
194 return initiated_in_secure_context_; 196 return initiated_in_secure_context_;
195 } 197 }
196 void set_initiated_in_secure_context_for_testing(bool secure) { 198 void set_initiated_in_secure_context_for_testing(bool secure) {
197 initiated_in_secure_context_ = secure; 199 initiated_in_secure_context_ = secure;
198 } 200 }
199 201
202 void set_navigation_ui_data(
203 std::unique_ptr<NavigationUIData> navigation_ui_data) {
204 navigation_ui_data_ = std::move(navigation_ui_data);
205 }
206
200 private: 207 private:
201 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 208 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
202 DeletedFilterDetached); 209 DeletedFilterDetached);
203 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 210 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
204 DeletedFilterDetachedRedirect); 211 DeletedFilterDetachedRedirect);
205 // Non-owning, may be NULL. 212 // Non-owning, may be NULL.
206 CrossSiteResourceHandler* cross_site_handler_; 213 CrossSiteResourceHandler* cross_site_handler_;
207 DetachableResourceHandler* detachable_handler_; 214 DetachableResourceHandler* detachable_handler_;
208 215
209 int process_type_; 216 int process_type_;
(...skipping 23 matching lines...) Expand all
233 ResourceContext* context_; 240 ResourceContext* context_;
234 // The filter might be deleted without deleting this object if the process 241 // The filter might be deleted without deleting this object if the process
235 // exits during a transfer. 242 // exits during a transfer.
236 base::WeakPtr<ResourceMessageFilter> filter_; 243 base::WeakPtr<ResourceMessageFilter> filter_;
237 bool report_raw_headers_; 244 bool report_raw_headers_;
238 bool is_async_; 245 bool is_async_;
239 bool is_using_lofi_; 246 bool is_using_lofi_;
240 const std::string original_headers_; 247 const std::string original_headers_;
241 scoped_refptr<ResourceRequestBodyImpl> body_; 248 scoped_refptr<ResourceRequestBodyImpl> body_;
242 bool initiated_in_secure_context_; 249 bool initiated_in_secure_context_;
250 std::unique_ptr<NavigationUIData> navigation_ui_data_;
243 251
244 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); 252 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl);
245 }; 253 };
246 254
247 } // namespace content 255 } // namespace content
248 256
249 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ 257 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698