| 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 #include "content/browser/frame_host/navigation_request.h" | 5 #include "content/browser/frame_host/navigation_request.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" | 9 #include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| 10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 state_ = STARTED; | 201 state_ = STARTED; |
| 202 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get()); | 202 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get()); |
| 203 | 203 |
| 204 if (ShouldMakeNetworkRequestForURL(common_params_.url)) { | 204 if (ShouldMakeNetworkRequestForURL(common_params_.url)) { |
| 205 // It's safe to use base::Unretained because this NavigationRequest owns | 205 // It's safe to use base::Unretained because this NavigationRequest owns |
| 206 // the NavigationHandle where the callback will be stored. | 206 // the NavigationHandle where the callback will be stored. |
| 207 // TODO(clamy): pass the real value for |is_external_protocol| if needed. | 207 // TODO(clamy): pass the real value for |is_external_protocol| if needed. |
| 208 // TODO(clamy): pass the method to the NavigationHandle instead of a | 208 // TODO(clamy): pass the method to the NavigationHandle instead of a |
| 209 // boolean. | 209 // boolean. |
| 210 navigation_handle_->WillStartRequest( | 210 navigation_handle_->WillStartRequest( |
| 211 common_params_.method, Referrer::SanitizeForRequest( | 211 common_params_.method, common_params_.post_data, |
| 212 common_params_.url, common_params_.referrer), | 212 Referrer::SanitizeForRequest(common_params_.url, |
| 213 common_params_.referrer), |
| 213 begin_params_.has_user_gesture, common_params_.transition, false, | 214 begin_params_.has_user_gesture, common_params_.transition, false, |
| 214 base::Bind(&NavigationRequest::OnStartChecksComplete, | 215 base::Bind(&NavigationRequest::OnStartChecksComplete, |
| 215 base::Unretained(this))); | 216 base::Unretained(this))); |
| 216 return; | 217 return; |
| 217 } | 218 } |
| 218 | 219 |
| 219 // There is no need to make a network request for this navigation, so commit | 220 // There is no need to make a network request for this navigation, so commit |
| 220 // it immediately. | 221 // it immediately. |
| 221 state_ = RESPONSE_STARTED; | 222 state_ = RESPONSE_STARTED; |
| 222 | 223 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 browser_context, navigating_frame_host->GetSiteInstance()); | 458 browser_context, navigating_frame_host->GetSiteInstance()); |
| 458 DCHECK(partition); | 459 DCHECK(partition); |
| 459 | 460 |
| 460 ServiceWorkerContextWrapper* service_worker_context = | 461 ServiceWorkerContextWrapper* service_worker_context = |
| 461 static_cast<ServiceWorkerContextWrapper*>( | 462 static_cast<ServiceWorkerContextWrapper*>( |
| 462 partition->GetServiceWorkerContext()); | 463 partition->GetServiceWorkerContext()); |
| 463 navigation_handle_->InitServiceWorkerHandle(service_worker_context); | 464 navigation_handle_->InitServiceWorkerHandle(service_worker_context); |
| 464 } | 465 } |
| 465 | 466 |
| 466 } // namespace content | 467 } // namespace content |
| OLD | NEW |