| 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" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 NavigatorDelegate* NavigatorImpl::GetDelegate() { | 110 NavigatorDelegate* NavigatorImpl::GetDelegate() { |
| 111 return delegate_; | 111 return delegate_; |
| 112 } | 112 } |
| 113 | 113 |
| 114 NavigationController* NavigatorImpl::GetController() { | 114 NavigationController* NavigatorImpl::GetController() { |
| 115 return controller_; | 115 return controller_; |
| 116 } | 116 } |
| 117 | 117 |
| 118 void NavigatorImpl::DidStartProvisionalLoad( | 118 void NavigatorImpl::DidStartProvisionalLoad( |
| 119 RenderFrameHostImpl* render_frame_host, | 119 RenderFrameHostImpl* render_frame_host, |
| 120 const GURL& url, | 120 const GURL& url) { |
| 121 bool is_transition_navigation) { | |
| 122 bool is_error_page = (url.spec() == kUnreachableWebDataURL); | 121 bool is_error_page = (url.spec() == kUnreachableWebDataURL); |
| 123 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); | 122 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); |
| 124 GURL validated_url(url); | 123 GURL validated_url(url); |
| 125 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | 124 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); |
| 126 render_process_host->FilterURL(false, &validated_url); | 125 render_process_host->FilterURL(false, &validated_url); |
| 127 | 126 |
| 128 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); | 127 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); |
| 129 NavigationEntryImpl* pending_entry = controller_->GetPendingEntry(); | 128 NavigationEntryImpl* pending_entry = controller_->GetPendingEntry(); |
| 130 if (is_main_frame) { | 129 if (is_main_frame) { |
| 131 // If there is no browser-initiated pending entry for this navigation and it | 130 // If there is no browser-initiated pending entry for this navigation and it |
| (...skipping 17 matching lines...) Expand all Loading... |
| 149 if (pending_entry) { | 148 if (pending_entry) { |
| 150 entry->set_transferred_global_request_id( | 149 entry->set_transferred_global_request_id( |
| 151 pending_entry->transferred_global_request_id()); | 150 pending_entry->transferred_global_request_id()); |
| 152 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 151 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 153 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 152 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 154 } | 153 } |
| 155 controller_->SetPendingEntry(entry); | 154 controller_->SetPendingEntry(entry); |
| 156 if (delegate_) | 155 if (delegate_) |
| 157 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 156 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 158 } | 157 } |
| 159 | |
| 160 if (delegate_ && is_transition_navigation) | |
| 161 delegate_->DidStartNavigationTransition(render_frame_host); | |
| 162 } | 158 } |
| 163 | 159 |
| 164 if (delegate_) { | 160 if (delegate_) { |
| 165 // Notify the observer about the start of the provisional load. | 161 // Notify the observer about the start of the provisional load. |
| 166 delegate_->DidStartProvisionalLoad( | 162 delegate_->DidStartProvisionalLoad( |
| 167 render_frame_host, validated_url, is_error_page, is_iframe_srcdoc); | 163 render_frame_host, validated_url, is_error_page, is_iframe_srcdoc); |
| 168 } | 164 } |
| 169 } | 165 } |
| 170 | 166 |
| 171 | 167 |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", | 892 "Navigation.TimeToCommit_ExistingRenderer_BeforeUnloadDiscounted", |
| 897 time_to_commit); | 893 time_to_commit); |
| 898 UMA_HISTOGRAM_TIMES( | 894 UMA_HISTOGRAM_TIMES( |
| 899 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", | 895 "Navigation.TimeToURLJobStart_ExistingRenderer_BeforeUnloadDiscounted", |
| 900 time_to_network); | 896 time_to_network); |
| 901 } | 897 } |
| 902 navigation_data_.reset(); | 898 navigation_data_.reset(); |
| 903 } | 899 } |
| 904 | 900 |
| 905 } // namespace content | 901 } // namespace content |
| OLD | NEW |