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

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

Issue 2335133003: PlzNavigate: support the WebRequest API (Closed)
Patch Set: Rebase + addressed nit Created 4 years, 2 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 DetachableResourceHandler; 24 class DetachableResourceHandler;
24 class ResourceContext; 25 class ResourceContext;
25 class ResourceMessageFilter; 26 class ResourceMessageFilter;
26 struct GlobalRequestID; 27 struct GlobalRequestID;
(...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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 const scoped_refptr<ResourceRequestBodyImpl>& body() const { return body_; } 184 const scoped_refptr<ResourceRequestBodyImpl>& body() const { return body_; }
183 void ResetBody(); 185 void ResetBody();
184 186
185 bool initiated_in_secure_context() const { 187 bool initiated_in_secure_context() const {
186 return initiated_in_secure_context_; 188 return initiated_in_secure_context_;
187 } 189 }
188 void set_initiated_in_secure_context_for_testing(bool secure) { 190 void set_initiated_in_secure_context_for_testing(bool secure) {
189 initiated_in_secure_context_ = secure; 191 initiated_in_secure_context_ = secure;
190 } 192 }
191 193
194 void set_navigation_ui_data(
195 std::unique_ptr<NavigationUIData> navigation_ui_data) {
196 navigation_ui_data_ = std::move(navigation_ui_data);
197 }
198
192 private: 199 private:
193 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 200 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
194 DeletedFilterDetached); 201 DeletedFilterDetached);
195 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 202 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
196 DeletedFilterDetachedRedirect); 203 DeletedFilterDetachedRedirect);
197 // Non-owning, may be NULL. 204 // Non-owning, may be NULL.
198 DetachableResourceHandler* detachable_handler_; 205 DetachableResourceHandler* detachable_handler_;
199 206
200 int process_type_; 207 int process_type_;
201 int child_id_; 208 int child_id_;
(...skipping 22 matching lines...) Expand all
224 ResourceContext* context_; 231 ResourceContext* context_;
225 // The filter might be deleted without deleting this object if the process 232 // The filter might be deleted without deleting this object if the process
226 // exits during a transfer. 233 // exits during a transfer.
227 base::WeakPtr<ResourceMessageFilter> filter_; 234 base::WeakPtr<ResourceMessageFilter> filter_;
228 bool report_raw_headers_; 235 bool report_raw_headers_;
229 bool is_async_; 236 bool is_async_;
230 bool is_using_lofi_; 237 bool is_using_lofi_;
231 const std::string original_headers_; 238 const std::string original_headers_;
232 scoped_refptr<ResourceRequestBodyImpl> body_; 239 scoped_refptr<ResourceRequestBodyImpl> body_;
233 bool initiated_in_secure_context_; 240 bool initiated_in_secure_context_;
241 std::unique_ptr<NavigationUIData> navigation_ui_data_;
234 242
235 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); 243 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl);
236 }; 244 };
237 245
238 } // namespace content 246 } // namespace content
239 247
240 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ 248 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_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