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