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

Side by Side Diff: content/browser/frame_host/navigation_request.h

Issue 1616943003: Teach navigation throttles how to cancel requests in WillProcessResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fiddling. Created 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_FRAME_HOST_NAVIGATION_REQUEST_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 const scoped_refptr<ResourceResponse>& response) override; 154 const scoped_refptr<ResourceResponse>& response) override;
155 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response, 155 void OnResponseStarted(const scoped_refptr<ResourceResponse>& response,
156 scoped_ptr<StreamHandle> body) override; 156 scoped_ptr<StreamHandle> body) override;
157 void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) override; 157 void OnRequestFailed(bool has_stale_copy_in_cache, int net_error) override;
158 void OnRequestStarted(base::TimeTicks timestamp) override; 158 void OnRequestStarted(base::TimeTicks timestamp) override;
159 159
160 // Called when the NavigationThrottles have been checked by the 160 // Called when the NavigationThrottles have been checked by the
161 // NavigationHandle. 161 // NavigationHandle.
162 void OnStartChecksComplete(NavigationThrottle::ThrottleCheckResult result); 162 void OnStartChecksComplete(NavigationThrottle::ThrottleCheckResult result);
163 void OnRedirectChecksComplete(NavigationThrottle::ThrottleCheckResult result); 163 void OnRedirectChecksComplete(NavigationThrottle::ThrottleCheckResult result);
164 void OnResponseChecksComplete(NavigationThrottle::ThrottleCheckResult result);
clamy 2016/01/25 16:36:21 Let's remove the PlzNavigate changes since I'll be
Mike West 2016/01/26 09:41:41 Done.
164 165
165 // Called when the navigation is about to be sent to the IO thread. 166 // Called when the navigation is about to be sent to the IO thread.
166 void InitializeServiceWorkerHandleIfNeeded(); 167 void InitializeServiceWorkerHandleIfNeeded();
167 168
168 FrameTreeNode* frame_tree_node_; 169 FrameTreeNode* frame_tree_node_;
169 170
170 // Initialized on creation of the NavigationRequest. Sent to the renderer when 171 // Initialized on creation of the NavigationRequest. Sent to the renderer when
171 // the navigation is ready to commit. 172 // the navigation is ready to commit.
172 // Note: When the navigation is ready to commit, the url in |common_params| 173 // Note: When the navigation is ready to commit, the url in |common_params|
173 // will be set to the final navigation url, obtained after following all 174 // will be set to the final navigation url, obtained after following all
174 // redirects. 175 // redirects.
175 // Note: |common_params_| and |begin_params_| are not const as they can be 176 // Note: |common_params_| and |begin_params_| are not const as they can be
176 // modified during redirects. 177 // modified during redirects.
177 // Note: |request_params_| is not const because service_worker_provider_id 178 // Note: |request_params_| is not const because service_worker_provider_id
178 // and should_create_service_worker will be set in OnResponseStarted. 179 // and should_create_service_worker will be set in OnResponseStarted.
179 CommonNavigationParams common_params_; 180 CommonNavigationParams common_params_;
180 BeginNavigationParams begin_params_; 181 BeginNavigationParams begin_params_;
181 RequestNavigationParams request_params_; 182 RequestNavigationParams request_params_;
182 const bool browser_initiated_; 183 const bool browser_initiated_;
183 184
184 NavigationState state_; 185 NavigationState state_;
185 186
187 // Used to store response information during throttle checks in
188 // OnResponseStarted.
189 scoped_refptr<ResourceResponse> response_;
190 scoped_ptr<StreamHandle> body_;
186 191
187 // The parameters to send to the IO thread. |loader_| takes ownership of 192 // The parameters to send to the IO thread. |loader_| takes ownership of
188 // |info_| after calling BeginNavigation. 193 // |info_| after calling BeginNavigation.
189 scoped_ptr<NavigationRequestInfo> info_; 194 scoped_ptr<NavigationRequestInfo> info_;
190 195
191 scoped_ptr<NavigationURLLoader> loader_; 196 scoped_ptr<NavigationURLLoader> loader_;
192 197
193 // These next items are used in browser-initiated navigations to store 198 // These next items are used in browser-initiated navigations to store
194 // information from the NavigationEntryImpl that is required after request 199 // information from the NavigationEntryImpl that is required after request
195 // creation time. 200 // creation time.
196 scoped_refptr<SiteInstanceImpl> source_site_instance_; 201 scoped_refptr<SiteInstanceImpl> source_site_instance_;
197 scoped_refptr<SiteInstanceImpl> dest_site_instance_; 202 scoped_refptr<SiteInstanceImpl> dest_site_instance_;
198 NavigationEntryImpl::RestoreType restore_type_; 203 NavigationEntryImpl::RestoreType restore_type_;
199 bool is_view_source_; 204 bool is_view_source_;
200 int bindings_; 205 int bindings_;
201 206
202 scoped_ptr<NavigationHandleImpl> navigation_handle_; 207 scoped_ptr<NavigationHandleImpl> navigation_handle_;
203 208
204 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); 209 DISALLOW_COPY_AND_ASSIGN(NavigationRequest);
205 }; 210 };
206 211
207 } // namespace content 212 } // namespace content
208 213
209 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ 214 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698