| 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 "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 Loading... |
| 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_->SetSpeculativeProcess( |
| 733 navigating_frame_host->GetProcess()); |
| 734 |
| 732 BrowserContext* browser_context = | 735 BrowserContext* browser_context = |
| 733 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); | 736 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); |
| 734 StoragePartition* partition = BrowserContext::GetStoragePartition( | 737 StoragePartition* partition = BrowserContext::GetStoragePartition( |
| 735 browser_context, navigating_frame_host->GetSiteInstance()); | 738 browser_context, navigating_frame_host->GetSiteInstance()); |
| 736 DCHECK(partition); | 739 DCHECK(partition); |
| 737 | 740 |
| 738 // Only initialize the ServiceWorkerNavigationHandle if it can be created for | 741 // Only initialize the ServiceWorkerNavigationHandle if it can be created for |
| 739 // this frame. | 742 // this frame. |
| 740 bool can_create_service_worker = | 743 bool can_create_service_worker = |
| 741 (frame_tree_node_->pending_sandbox_flags() & | 744 (frame_tree_node_->pending_sandbox_flags() & |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); | 879 DCHECK_EQ(request_params_.has_user_gesture, begin_params_.has_user_gesture); |
| 877 | 880 |
| 878 render_frame_host->CommitNavigation(response_.get(), std::move(body_), | 881 render_frame_host->CommitNavigation(response_.get(), std::move(body_), |
| 879 std::move(handle_), common_params_, | 882 std::move(handle_), common_params_, |
| 880 request_params_, is_view_source_); | 883 request_params_, is_view_source_); |
| 881 | 884 |
| 882 frame_tree_node_->ResetNavigationRequest(true, true); | 885 frame_tree_node_->ResetNavigationRequest(true, true); |
| 883 } | 886 } |
| 884 | 887 |
| 885 } // namespace content | 888 } // namespace content |
| OLD | NEW |