| 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 5625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5636 } | 5636 } |
| 5637 | 5637 |
| 5638 // |navigation_start| must be recorded immediately after dispatching the | 5638 // |navigation_start| must be recorded immediately after dispatching the |
| 5639 // beforeunload event. | 5639 // beforeunload event. |
| 5640 if (pending_navigation_params_) { | 5640 if (pending_navigation_params_) { |
| 5641 pending_navigation_params_->common_params.navigation_start = | 5641 pending_navigation_params_->common_params.navigation_start = |
| 5642 base::TimeTicks::Now(); | 5642 base::TimeTicks::Now(); |
| 5643 } | 5643 } |
| 5644 } | 5644 } |
| 5645 | 5645 |
| 5646 // When an MHTML Archive is present, it should be used to serve iframe content |
| 5647 // instead of doing a network request. |
| 5648 bool use_archive = |
| 5649 (info.archive_status == NavigationPolicyInfo::ArchiveStatus::Present) && |
| 5650 !url.SchemeIs(url::kDataScheme); |
| 5651 |
| 5646 // PlzNavigate: if the navigation is not synchronous, send it to the browser. | 5652 // PlzNavigate: if the navigation is not synchronous, send it to the browser. |
| 5647 // This includes navigations with no request being sent to the network stack. | 5653 // This includes navigations with no request being sent to the network stack. |
| 5648 if (IsBrowserSideNavigationEnabled() && | 5654 if (IsBrowserSideNavigationEnabled() && |
| 5649 info.url_request.CheckForBrowserSideNavigation() && | 5655 info.url_request.CheckForBrowserSideNavigation() && |
| 5650 ShouldMakeNetworkRequestForURL(url)) { | 5656 ShouldMakeNetworkRequestForURL(url) && !use_archive) { |
| 5651 if (info.default_policy == blink::kWebNavigationPolicyCurrentTab) { | 5657 if (info.default_policy == blink::kWebNavigationPolicyCurrentTab) { |
| 5652 // The BeginNavigation() call happens in didStartProvisionalLoad(). We | 5658 // The BeginNavigation() call happens in didStartProvisionalLoad(). We |
| 5653 // need to save information about the navigation here. | 5659 // need to save information about the navigation here. |
| 5654 pending_navigation_info_.reset(new PendingNavigationInfo(info)); | 5660 pending_navigation_info_.reset(new PendingNavigationInfo(info)); |
| 5655 return blink::kWebNavigationPolicyHandledByClient; | 5661 return blink::kWebNavigationPolicyHandledByClient; |
| 5656 } else { | 5662 } else { |
| 5657 LoadURLExternally(info.url_request, info.default_policy); | 5663 LoadURLExternally(info.url_request, info.default_policy); |
| 5658 return blink::kWebNavigationPolicyIgnore; | 5664 return blink::kWebNavigationPolicyIgnore; |
| 5659 } | 5665 } |
| 5660 } | 5666 } |
| (...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7107 policy(info.default_policy), | 7113 policy(info.default_policy), |
| 7108 replaces_current_history_item(info.replaces_current_history_item), | 7114 replaces_current_history_item(info.replaces_current_history_item), |
| 7109 history_navigation_in_new_child_frame( | 7115 history_navigation_in_new_child_frame( |
| 7110 info.is_history_navigation_in_new_child_frame), | 7116 info.is_history_navigation_in_new_child_frame), |
| 7111 client_redirect(info.is_client_redirect), | 7117 client_redirect(info.is_client_redirect), |
| 7112 cache_disabled(info.is_cache_disabled), | 7118 cache_disabled(info.is_cache_disabled), |
| 7113 form(info.form), | 7119 form(info.form), |
| 7114 source_location(info.source_location) {} | 7120 source_location(info.source_location) {} |
| 7115 | 7121 |
| 7116 } // namespace content | 7122 } // namespace content |
| OLD | NEW |