| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 NavigatorDelegate* NavigatorImpl::GetDelegate() { | 112 NavigatorDelegate* NavigatorImpl::GetDelegate() { |
| 113 return delegate_; | 113 return delegate_; |
| 114 } | 114 } |
| 115 | 115 |
| 116 NavigationController* NavigatorImpl::GetController() { | 116 NavigationController* NavigatorImpl::GetController() { |
| 117 return controller_; | 117 return controller_; |
| 118 } | 118 } |
| 119 | 119 |
| 120 void NavigatorImpl::DidStartProvisionalLoad( | 120 void NavigatorImpl::DidStartProvisionalLoad( |
| 121 RenderFrameHostImpl* render_frame_host, | 121 RenderFrameHostImpl* render_frame_host, |
| 122 const GURL& url) { | 122 const GURL& url, |
| 123 const base::TimeTicks& navigation_start) { |
| 123 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); | 124 bool is_main_frame = render_frame_host->frame_tree_node()->IsMainFrame(); |
| 124 bool is_error_page = (url.spec() == kUnreachableWebDataURL); | 125 bool is_error_page = (url.spec() == kUnreachableWebDataURL); |
| 125 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); | 126 bool is_iframe_srcdoc = (url.spec() == kAboutSrcDocURL); |
| 126 GURL validated_url(url); | 127 GURL validated_url(url); |
| 127 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); | 128 RenderProcessHost* render_process_host = render_frame_host->GetProcess(); |
| 128 render_process_host->FilterURL(false, &validated_url); | 129 render_process_host->FilterURL(false, &validated_url); |
| 129 | 130 |
| 130 if (is_main_frame && !is_error_page) { | 131 if (is_main_frame && !is_error_page) { |
| 131 DidStartMainFrameNavigation(validated_url, | 132 DidStartMainFrameNavigation(validated_url, |
| 132 render_frame_host->GetSiteInstance()); | 133 render_frame_host->GetSiteInstance()); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 153 return; | 154 return; |
| 154 } | 155 } |
| 155 | 156 |
| 156 // This ensures that notifications about the end of the previous | 157 // This ensures that notifications about the end of the previous |
| 157 // navigation are sent before notifications about the start of the | 158 // navigation are sent before notifications about the start of the |
| 158 // new navigation. | 159 // new navigation. |
| 159 render_frame_host->SetNavigationHandle(scoped_ptr<NavigationHandleImpl>()); | 160 render_frame_host->SetNavigationHandle(scoped_ptr<NavigationHandleImpl>()); |
| 160 } | 161 } |
| 161 | 162 |
| 162 render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create( | 163 render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create( |
| 163 validated_url, render_frame_host->frame_tree_node())); | 164 validated_url, render_frame_host->frame_tree_node(), navigation_start)); |
| 164 } | 165 } |
| 165 | 166 |
| 166 void NavigatorImpl::DidFailProvisionalLoadWithError( | 167 void NavigatorImpl::DidFailProvisionalLoadWithError( |
| 167 RenderFrameHostImpl* render_frame_host, | 168 RenderFrameHostImpl* render_frame_host, |
| 168 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { | 169 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 169 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() | 170 VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() |
| 170 << ", error_code: " << params.error_code | 171 << ", error_code: " << params.error_code |
| 171 << ", error_description: " << params.error_description | 172 << ", error_description: " << params.error_description |
| 172 << ", showing_repost_interstitial: " << | 173 << ", showing_repost_interstitial: " << |
| 173 params.showing_repost_interstitial | 174 params.showing_repost_interstitial |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 953 entry->set_should_replace_entry(pending_entry->should_replace_entry()); | 954 entry->set_should_replace_entry(pending_entry->should_replace_entry()); |
| 954 entry->SetRedirectChain(pending_entry->GetRedirectChain()); | 955 entry->SetRedirectChain(pending_entry->GetRedirectChain()); |
| 955 } | 956 } |
| 956 controller_->SetPendingEntry(entry.Pass()); | 957 controller_->SetPendingEntry(entry.Pass()); |
| 957 if (delegate_) | 958 if (delegate_) |
| 958 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); | 959 delegate_->NotifyChangedNavigationState(content::INVALIDATE_TYPE_URL); |
| 959 } | 960 } |
| 960 } | 961 } |
| 961 | 962 |
| 962 } // namespace content | 963 } // namespace content |
| OLD | NEW |