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

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

Issue 1729373002: PlzNavigate: fix DevToolsProtocolTest.CrossSitePauseInBeforeUnload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed comments Created 4 years, 9 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 #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/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 11 #include "content/browser/frame_host/frame_tree_node.h"
11 #include "content/browser/frame_host/navigation_controller_impl.h" 12 #include "content/browser/frame_host/navigation_controller_impl.h"
12 #include "content/browser/frame_host/navigation_handle_impl.h" 13 #include "content/browser/frame_host/navigation_handle_impl.h"
13 #include "content/browser/frame_host/navigation_request_info.h" 14 #include "content/browser/frame_host/navigation_request_info.h"
14 #include "content/browser/frame_host/navigator.h" 15 #include "content/browser/frame_host/navigator.h"
15 #include "content/browser/loader/navigation_url_loader.h" 16 #include "content/browser/loader/navigation_url_loader.h"
16 #include "content/browser/service_worker/service_worker_context_wrapper.h" 17 #include "content/browser/service_worker/service_worker_context_wrapper.h"
17 #include "content/browser/service_worker/service_worker_navigation_handle.h" 18 #include "content/browser/service_worker/service_worker_navigation_handle.h"
18 #include "content/browser/site_instance_impl.h" 19 #include "content/browser/site_instance_impl.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 parent_is_main_frame, frame_tree_node->frame_tree_node_id(), body)); 197 parent_is_main_frame, frame_tree_node->frame_tree_node_id(), body));
197 } 198 }
198 199
199 NavigationRequest::~NavigationRequest() { 200 NavigationRequest::~NavigationRequest() {
200 } 201 }
201 202
202 void NavigationRequest::BeginNavigation() { 203 void NavigationRequest::BeginNavigation() {
203 DCHECK(!loader_); 204 DCHECK(!loader_);
204 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE); 205 DCHECK(state_ == NOT_STARTED || state_ == WAITING_FOR_RENDERER_RESPONSE);
205 state_ = STARTED; 206 state_ = STARTED;
207 RenderFrameDevToolsAgentHost::OnBeforeNavigation(navigation_handle_.get());
206 208
207 if (ShouldMakeNetworkRequestForURL(common_params_.url)) { 209 if (ShouldMakeNetworkRequestForURL(common_params_.url)) {
208 // It's safe to use base::Unretained because this NavigationRequest owns 210 // It's safe to use base::Unretained because this NavigationRequest owns
209 // the NavigationHandle where the callback will be stored. 211 // the NavigationHandle where the callback will be stored.
210 // TODO(clamy): pass the real value for |is_external_protocol| if needed. 212 // TODO(clamy): pass the real value for |is_external_protocol| if needed.
211 // TODO(clamy): pass the method to the NavigationHandle instead of a 213 // TODO(clamy): pass the method to the NavigationHandle instead of a
212 // boolean. 214 // boolean.
213 navigation_handle_->WillStartRequest( 215 navigation_handle_->WillStartRequest(
214 common_params_.method == "POST", 216 common_params_.method == "POST",
215 Referrer::SanitizeForRequest(common_params_.url, 217 Referrer::SanitizeForRequest(common_params_.url,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 browser_context, navigating_frame_host->GetSiteInstance()); 367 browser_context, navigating_frame_host->GetSiteInstance());
366 DCHECK(partition); 368 DCHECK(partition);
367 369
368 ServiceWorkerContextWrapper* service_worker_context = 370 ServiceWorkerContextWrapper* service_worker_context =
369 static_cast<ServiceWorkerContextWrapper*>( 371 static_cast<ServiceWorkerContextWrapper*>(
370 partition->GetServiceWorkerContext()); 372 partition->GetServiceWorkerContext());
371 navigation_handle_->InitServiceWorkerHandle(service_worker_context); 373 navigation_handle_->InitServiceWorkerHandle(service_worker_context);
372 } 374 }
373 375
374 } // namespace content 376 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698