OLD | NEW |
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...) Loading... |
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); |
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 |
| 185 // Used to store the response information during asynchronous throttle checks |
| 186 // in OnResponseStarted. |
| 187 scoped_refptr<ResourceResponse> response_; |
| 188 scoped_ptr<StreamHandle> body_; |
| 189 |
184 NavigationState state_; | 190 NavigationState state_; |
185 | 191 |
186 | 192 |
187 // The parameters to send to the IO thread. |loader_| takes ownership of | 193 // The parameters to send to the IO thread. |loader_| takes ownership of |
188 // |info_| after calling BeginNavigation. | 194 // |info_| after calling BeginNavigation. |
189 scoped_ptr<NavigationRequestInfo> info_; | 195 scoped_ptr<NavigationRequestInfo> info_; |
190 | 196 |
191 scoped_ptr<NavigationURLLoader> loader_; | 197 scoped_ptr<NavigationURLLoader> loader_; |
192 | 198 |
193 // These next items are used in browser-initiated navigations to store | 199 // These next items are used in browser-initiated navigations to store |
194 // information from the NavigationEntryImpl that is required after request | 200 // information from the NavigationEntryImpl that is required after request |
195 // creation time. | 201 // creation time. |
196 scoped_refptr<SiteInstanceImpl> source_site_instance_; | 202 scoped_refptr<SiteInstanceImpl> source_site_instance_; |
197 scoped_refptr<SiteInstanceImpl> dest_site_instance_; | 203 scoped_refptr<SiteInstanceImpl> dest_site_instance_; |
198 NavigationEntryImpl::RestoreType restore_type_; | 204 NavigationEntryImpl::RestoreType restore_type_; |
199 bool is_view_source_; | 205 bool is_view_source_; |
200 int bindings_; | 206 int bindings_; |
201 | 207 |
202 scoped_ptr<NavigationHandleImpl> navigation_handle_; | 208 scoped_ptr<NavigationHandleImpl> navigation_handle_; |
203 | 209 |
204 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); | 210 DISALLOW_COPY_AND_ASSIGN(NavigationRequest); |
205 }; | 211 }; |
206 | 212 |
207 } // namespace content | 213 } // namespace content |
208 | 214 |
209 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ | 215 #endif // CONTENT_BROWSER_FRAME_HOST_NAVIGATION_REQUEST_H_ |
OLD | NEW |