| 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 5580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5591 } | 5591 } |
| 5592 | 5592 |
| 5593 // |navigation_start| must be recorded immediately after dispatching the | 5593 // |navigation_start| must be recorded immediately after dispatching the |
| 5594 // beforeunload event. | 5594 // beforeunload event. |
| 5595 if (pending_navigation_params_) { | 5595 if (pending_navigation_params_) { |
| 5596 pending_navigation_params_->common_params.navigation_start = | 5596 pending_navigation_params_->common_params.navigation_start = |
| 5597 base::TimeTicks::Now(); | 5597 base::TimeTicks::Now(); |
| 5598 } | 5598 } |
| 5599 } | 5599 } |
| 5600 | 5600 |
| 5601 // When an MHTML Archive is present, it should be used to serve iframe content |
| 5602 // instead of doing a network request. |
| 5603 bool use_archive = |
| 5604 (info.archive_status == NavigationPolicyInfo::ArchiveStatus::Present) && |
| 5605 !url.SchemeIs(url::kDataScheme); |
| 5606 |
| 5601 // PlzNavigate: if the navigation is not synchronous, send it to the browser. | 5607 // PlzNavigate: if the navigation is not synchronous, send it to the browser. |
| 5602 // This includes navigations with no request being sent to the network stack. | 5608 // This includes navigations with no request being sent to the network stack. |
| 5603 if (IsBrowserSideNavigationEnabled() && | 5609 if (IsBrowserSideNavigationEnabled() && |
| 5604 info.url_request.CheckForBrowserSideNavigation() && | 5610 info.url_request.CheckForBrowserSideNavigation() && |
| 5605 ShouldMakeNetworkRequestForURL(url)) { | 5611 ShouldMakeNetworkRequestForURL(url) && !use_archive) { |
| 5606 if (info.default_policy == blink::kWebNavigationPolicyCurrentTab) { | 5612 if (info.default_policy == blink::kWebNavigationPolicyCurrentTab) { |
| 5607 // The BeginNavigation() call happens in didStartProvisionalLoad(). We | 5613 // The BeginNavigation() call happens in didStartProvisionalLoad(). We |
| 5608 // need to save information about the navigation here. | 5614 // need to save information about the navigation here. |
| 5609 pending_navigation_info_.reset(new PendingNavigationInfo(info)); | 5615 pending_navigation_info_.reset(new PendingNavigationInfo(info)); |
| 5610 return blink::kWebNavigationPolicyHandledByClient; | 5616 return blink::kWebNavigationPolicyHandledByClient; |
| 5611 } else { | 5617 } else { |
| 5612 LoadURLExternally(info.url_request, info.default_policy); | 5618 LoadURLExternally(info.url_request, info.default_policy); |
| 5613 return blink::kWebNavigationPolicyIgnore; | 5619 return blink::kWebNavigationPolicyIgnore; |
| 5614 } | 5620 } |
| 5615 } | 5621 } |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7040 policy(info.default_policy), | 7046 policy(info.default_policy), |
| 7041 replaces_current_history_item(info.replaces_current_history_item), | 7047 replaces_current_history_item(info.replaces_current_history_item), |
| 7042 history_navigation_in_new_child_frame( | 7048 history_navigation_in_new_child_frame( |
| 7043 info.is_history_navigation_in_new_child_frame), | 7049 info.is_history_navigation_in_new_child_frame), |
| 7044 client_redirect(info.is_client_redirect), | 7050 client_redirect(info.is_client_redirect), |
| 7045 cache_disabled(info.is_cache_disabled), | 7051 cache_disabled(info.is_cache_disabled), |
| 7046 form(info.form), | 7052 form(info.form), |
| 7047 source_location(info.source_location) {} | 7053 source_location(info.source_location) {} |
| 7048 | 7054 |
| 7049 } // namespace content | 7055 } // namespace content |
| OLD | NEW |