OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/navigator_impl.h" | 5 #include "content/browser/frame_host/navigator_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
11 #include "content/browser/frame_host/frame_tree_node.h" | 11 #include "content/browser/frame_host/frame_tree_node.h" |
12 #include "content/browser/frame_host/navigation_controller_impl.h" | 12 #include "content/browser/frame_host/navigation_controller_impl.h" |
13 #include "content/browser/frame_host/navigation_entry_impl.h" | 13 #include "content/browser/frame_host/navigation_entry_impl.h" |
14 #include "content/browser/frame_host/navigation_handle_impl.h" | 14 #include "content/browser/frame_host/navigation_handle_impl.h" |
15 #include "content/browser/frame_host/navigation_request.h" | 15 #include "content/browser/frame_host/navigation_request.h" |
16 #include "content/browser/frame_host/navigation_request_info.h" | 16 #include "content/browser/frame_host/navigation_request_info.h" |
17 #include "content/browser/frame_host/navigator_delegate.h" | 17 #include "content/browser/frame_host/navigator_delegate.h" |
18 #include "content/browser/frame_host/render_frame_host_impl.h" | 18 #include "content/browser/frame_host/render_frame_host_impl.h" |
19 #include "content/browser/renderer_host/render_view_host_impl.h" | 19 #include "content/browser/renderer_host/render_view_host_impl.h" |
20 #include "content/browser/site_instance_impl.h" | 20 #include "content/browser/site_instance_impl.h" |
21 #include "content/browser/webui/web_ui_controller_factory_registry.h" | 21 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
22 #include "content/browser/webui/web_ui_impl.h" | 22 #include "content/browser/webui/web_ui_impl.h" |
23 #include "content/common/frame_messages.h" | 23 #include "content/common/frame_messages.h" |
24 #include "content/common/navigation_params.h" | 24 #include "content/common/navigation_params.h" |
| 25 #include "content/common/service_worker/service_worker_types.h" |
25 #include "content/common/site_isolation_policy.h" | 26 #include "content/common/site_isolation_policy.h" |
26 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
27 #include "content/public/browser/browser_context.h" | 28 #include "content/public/browser/browser_context.h" |
28 #include "content/public/browser/content_browser_client.h" | 29 #include "content/public/browser/content_browser_client.h" |
29 #include "content/public/browser/global_request_id.h" | 30 #include "content/public/browser/global_request_id.h" |
30 #include "content/public/browser/invalidate_type.h" | 31 #include "content/public/browser/invalidate_type.h" |
31 #include "content/public/browser/navigation_controller.h" | 32 #include "content/public/browser/navigation_controller.h" |
32 #include "content/public/browser/navigation_details.h" | 33 #include "content/public/browser/navigation_details.h" |
33 #include "content/public/browser/page_navigator.h" | 34 #include "content/public/browser/page_navigator.h" |
34 #include "content/public/browser/render_view_host.h" | 35 #include "content/public/browser/render_view_host.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 entry.transferred_global_request_id().child_id == | 329 entry.transferred_global_request_id().child_id == |
329 dest_render_frame_host->GetProcess()->GetID(); | 330 dest_render_frame_host->GetProcess()->GetID(); |
330 if (!is_transfer_to_same) { | 331 if (!is_transfer_to_same) { |
331 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url, | 332 navigation_data_.reset(new NavigationMetricsData(navigation_start, dest_url, |
332 entry.restore_type())); | 333 entry.restore_type())); |
333 // Create the navigation parameters. | 334 // Create the navigation parameters. |
334 FrameMsg_Navigate_Type::Value navigation_type = | 335 FrameMsg_Navigate_Type::Value navigation_type = |
335 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); | 336 GetNavigationType(controller_->GetBrowserContext(), entry, reload_type); |
336 dest_render_frame_host->Navigate( | 337 dest_render_frame_host->Navigate( |
337 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, | 338 entry.ConstructCommonNavigationParams(dest_url, dest_referrer, |
338 frame_entry, navigation_type), | 339 frame_entry, navigation_type, |
| 340 kInvalidServiceWorkerProviderId), |
339 entry.ConstructStartNavigationParams(), | 341 entry.ConstructStartNavigationParams(), |
340 entry.ConstructRequestNavigationParams( | 342 entry.ConstructRequestNavigationParams( |
341 frame_entry, navigation_start, is_same_document_history_load, | 343 frame_entry, navigation_start, is_same_document_history_load, |
342 frame_tree_node->has_committed_real_load(), | 344 frame_tree_node->has_committed_real_load(), |
343 controller_->GetPendingEntryIndex() == -1, | 345 controller_->GetPendingEntryIndex() == -1, |
344 controller_->GetIndexOfEntry(&entry), | 346 controller_->GetIndexOfEntry(&entry), |
345 controller_->GetLastCommittedEntryIndex(), | 347 controller_->GetLastCommittedEntryIndex(), |
346 controller_->GetEntryCount())); | 348 controller_->GetEntryCount())); |
347 } else { | 349 } else { |
348 // No need to navigate again. Just resume the deferred request. | 350 // No need to navigate again. Just resume the deferred request. |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 render_frame_host->render_view_host()->GetRoutingID())); | 737 render_frame_host->render_view_host()->GetRoutingID())); |
736 } | 738 } |
737 | 739 |
738 CheckWebUIRendererDoesNotDisplayNormalURL( | 740 CheckWebUIRendererDoesNotDisplayNormalURL( |
739 render_frame_host, navigation_request->common_params().url); | 741 render_frame_host, navigation_request->common_params().url); |
740 | 742 |
741 navigation_request->TransferNavigationHandleOwnership(render_frame_host); | 743 navigation_request->TransferNavigationHandleOwnership(render_frame_host); |
742 render_frame_host->CommitNavigation(response, body.Pass(), | 744 render_frame_host->CommitNavigation(response, body.Pass(), |
743 navigation_request->common_params(), | 745 navigation_request->common_params(), |
744 navigation_request->request_params()); | 746 navigation_request->request_params()); |
745 | |
746 } | 747 } |
747 | 748 |
748 // PlzNavigate | 749 // PlzNavigate |
749 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, | 750 void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node, |
750 bool has_stale_copy_in_cache, | 751 bool has_stale_copy_in_cache, |
751 int error_code) { | 752 int error_code) { |
752 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 753 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
753 switches::kEnableBrowserSideNavigation)); | 754 switches::kEnableBrowserSideNavigation)); |
754 | 755 |
755 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); | 756 NavigationRequest* navigation_request = frame_tree_node->navigation_request(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 945 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
945 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 946 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
946 } | 947 } |
947 controller_->SetPendingEntry(entry.Pass()); | 948 controller_->SetPendingEntry(entry.Pass()); |
948 if (delegate_) | 949 if (delegate_) |
949 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 950 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
950 } | 951 } |
951 } | 952 } |
952 | 953 |
953 } // namespace content | 954 } // namespace content |
OLD | NEW |