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

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

Issue 2045383002: PlzNavigate: detect when a ServiceWorker is present (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_handle_impl.h" 5 #include "content/browser/frame_host/navigation_handle_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "content/browser/frame_host/frame_tree_node.h" 10 #include "content/browser/frame_host/frame_tree_node.h"
11 #include "content/browser/frame_host/navigator.h" 11 #include "content/browser/frame_host/navigator.h"
12 #include "content/browser/frame_host/navigator_delegate.h" 12 #include "content/browser/frame_host/navigator_delegate.h"
13 #include "content/browser/service_worker/service_worker_context_wrapper.h" 13 #include "content/browser/service_worker/service_worker_context_wrapper.h"
14 #include "content/browser/service_worker/service_worker_navigation_handle.h"
15 #include "content/common/frame_messages.h" 14 #include "content/common/frame_messages.h"
16 #include "content/common/resource_request_body_impl.h" 15 #include "content/common/resource_request_body_impl.h"
17 #include "content/public/browser/content_browser_client.h" 16 #include "content/public/browser/content_browser_client.h"
18 #include "content/public/common/browser_side_navigation_policy.h" 17 #include "content/public/common/browser_side_navigation_policy.h"
19 #include "content/public/common/content_client.h" 18 #include "content/public/common/content_client.h"
20 #include "net/url_request/redirect_info.h" 19 #include "net/url_request/redirect_info.h"
21 #include "url/gurl.h" 20 #include "url/gurl.h"
22 #include "url/url_constants.h" 21 #include "url/url_constants.h"
23 22
24 namespace content { 23 namespace content {
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 287
289 // Reset the callback to ensure it will not be called later. 288 // Reset the callback to ensure it will not be called later.
290 complete_callback_.Reset(); 289 complete_callback_.Reset();
291 return result; 290 return result;
292 } 291 }
293 292
294 NavigationData* NavigationHandleImpl::GetNavigationData() { 293 NavigationData* NavigationHandleImpl::GetNavigationData() {
295 return navigation_data_.get(); 294 return navigation_data_.get();
296 } 295 }
297 296
298 void NavigationHandleImpl::InitServiceWorkerHandle(
299 ServiceWorkerContextWrapper* service_worker_context) {
300 DCHECK(IsBrowserSideNavigationEnabled());
301 service_worker_handle_.reset(
302 new ServiceWorkerNavigationHandle(service_worker_context));
303 }
304
305 void NavigationHandleImpl::WillStartRequest( 297 void NavigationHandleImpl::WillStartRequest(
306 const std::string& method, 298 const std::string& method,
307 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body, 299 scoped_refptr<content::ResourceRequestBodyImpl> resource_request_body,
308 const Referrer& sanitized_referrer, 300 const Referrer& sanitized_referrer,
309 bool has_user_gesture, 301 bool has_user_gesture,
310 ui::PageTransition transition, 302 ui::PageTransition transition,
311 bool is_external_protocol, 303 bool is_external_protocol,
312 const ThrottleChecksFinishedCallback& callback) { 304 const ThrottleChecksFinishedCallback& callback) {
313 // |method != "POST"| should imply absence of |resource_request_body|. 305 // |method != "POST"| should imply absence of |resource_request_body|.
314 if (method != "POST" && resource_request_body) { 306 if (method != "POST" && resource_request_body) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 complete_callback_.Reset(); 524 complete_callback_.Reset();
533 525
534 if (!callback.is_null()) 526 if (!callback.is_null())
535 callback.Run(result); 527 callback.Run(result);
536 528
537 // No code after running the callback, as it might have resulted in our 529 // No code after running the callback, as it might have resulted in our
538 // destruction. 530 // destruction.
539 } 531 }
540 532
541 } // namespace content 533 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698