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

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

Issue 2857213005: PlzNavigate: implement process reuse for ServiceWorkers (Closed)
Patch Set: Addressed comments + fixed tests Created 3 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 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 "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "content/browser/appcache/appcache_navigation_handle.h" 10 #include "content/browser/appcache/appcache_navigation_handle.h"
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // Use the SiteInstance of the navigating RenderFrameHost to get access to 722 // Use the SiteInstance of the navigating RenderFrameHost to get access to
723 // the StoragePartition. Using the url of the navigation will result in a 723 // the StoragePartition. Using the url of the navigation will result in a
724 // wrong StoragePartition being picked when a WebView is navigating. 724 // wrong StoragePartition being picked when a WebView is navigating.
725 DCHECK_NE(AssociatedSiteInstanceType::NONE, associated_site_instance_type_); 725 DCHECK_NE(AssociatedSiteInstanceType::NONE, associated_site_instance_type_);
726 RenderFrameHostImpl* navigating_frame_host = 726 RenderFrameHostImpl* navigating_frame_host =
727 associated_site_instance_type_ == AssociatedSiteInstanceType::SPECULATIVE 727 associated_site_instance_type_ == AssociatedSiteInstanceType::SPECULATIVE
728 ? frame_tree_node_->render_manager()->speculative_frame_host() 728 ? frame_tree_node_->render_manager()->speculative_frame_host()
729 : frame_tree_node_->current_frame_host(); 729 : frame_tree_node_->current_frame_host();
730 DCHECK(navigating_frame_host); 730 DCHECK(navigating_frame_host);
731 731
732 navigation_handle_->SetExpectedProcess(navigating_frame_host->GetProcess());
733
732 BrowserContext* browser_context = 734 BrowserContext* browser_context =
733 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); 735 frame_tree_node_->navigator()->GetController()->GetBrowserContext();
734 StoragePartition* partition = BrowserContext::GetStoragePartition( 736 StoragePartition* partition = BrowserContext::GetStoragePartition(
735 browser_context, navigating_frame_host->GetSiteInstance()); 737 browser_context, navigating_frame_host->GetSiteInstance());
736 DCHECK(partition); 738 DCHECK(partition);
737 739
738 // Only initialize the ServiceWorkerNavigationHandle if it can be created for 740 // Only initialize the ServiceWorkerNavigationHandle if it can be created for
739 // this frame. 741 // this frame.
740 bool can_create_service_worker = 742 bool can_create_service_worker =
741 (frame_tree_node_->pending_sandbox_flags() & 743 (frame_tree_node_->pending_sandbox_flags() &
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); 878 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture);
877 879
878 render_frame_host->CommitNavigation(response_.get(), std::move(body_), 880 render_frame_host->CommitNavigation(response_.get(), std::move(body_),
879 std::move(handle_), common_params_, 881 std::move(handle_), common_params_,
880 request_params_, is_view_source_); 882 request_params_, is_view_source_);
881 883
882 frame_tree_node_->ResetNavigationRequest(true, true); 884 frame_tree_node_->ResetNavigationRequest(true, true);
883 } 885 }
884 886
885 } // namespace content 887 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_handle_impl.cc ('k') | content/browser/frame_host/navigator_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698