| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/navigation_handle_impl.h" | 5 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 RenderFrameHostImpl* render_frame_host) { | 708 RenderFrameHostImpl* render_frame_host) { |
| 709 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, | 709 TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, |
| 710 "ReadyToCommitNavigation"); | 710 "ReadyToCommitNavigation"); |
| 711 | 711 |
| 712 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); | 712 DCHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); |
| 713 render_frame_host_ = render_frame_host; | 713 render_frame_host_ = render_frame_host; |
| 714 state_ = READY_TO_COMMIT; | 714 state_ = READY_TO_COMMIT; |
| 715 ready_to_commit_time_ = base::TimeTicks::Now(); | 715 ready_to_commit_time_ = base::TimeTicks::Now(); |
| 716 | 716 |
| 717 // For back-forward navigations, record metrics. | 717 // For back-forward navigations, record metrics. |
| 718 if (transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) { | 718 if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) && !IsSameDocument()) { |
| 719 bool is_same_process = | 719 bool is_same_process = |
| 720 render_frame_host_->GetProcess()->GetID() == | 720 render_frame_host_->GetProcess()->GetID() == |
| 721 frame_tree_node_->current_frame_host()->GetProcess()->GetID(); | 721 frame_tree_node_->current_frame_host()->GetProcess()->GetID(); |
| 722 UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.IsSameProcess", | 722 UMA_HISTOGRAM_BOOLEAN("Navigation.BackForward.IsSameProcess", |
| 723 is_same_process); | 723 is_same_process); |
| 724 UMA_HISTOGRAM_TIMES("Navigation.BackForward.TimeToReadyToCommit", | 724 UMA_HISTOGRAM_TIMES("Navigation.BackForward.TimeToReadyToCommit", |
| 725 ready_to_commit_time_ - navigation_start_); | 725 ready_to_commit_time_ - navigation_start_); |
| 726 } | 726 } |
| 727 | 727 |
| 728 if (IsBrowserSideNavigationEnabled()) | 728 if (IsBrowserSideNavigationEnabled()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 749 transition_ = params.transition; | 749 transition_ = params.transition; |
| 750 should_update_history_ = params.should_update_history; | 750 should_update_history_ = params.should_update_history; |
| 751 render_frame_host_ = render_frame_host; | 751 render_frame_host_ = render_frame_host; |
| 752 previous_url_ = previous_url; | 752 previous_url_ = previous_url; |
| 753 base_url_ = params.base_url; | 753 base_url_ = params.base_url; |
| 754 socket_address_ = params.socket_address; | 754 socket_address_ = params.socket_address; |
| 755 navigation_type_ = navigation_type; | 755 navigation_type_ = navigation_type; |
| 756 | 756 |
| 757 // For back-forward navigations, record metrics. | 757 // For back-forward navigations, record metrics. |
| 758 if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) && | 758 if ((transition_ & ui::PAGE_TRANSITION_FORWARD_BACK) && |
| 759 !ready_to_commit_time_.is_null()) { | 759 !ready_to_commit_time_.is_null() && !IsSameDocument()) { |
| 760 UMA_HISTOGRAM_TIMES("Navigation.BackForward.ReadyToCommitUntilCommit", | 760 UMA_HISTOGRAM_TIMES("Navigation.BackForward.ReadyToCommitUntilCommit", |
| 761 base::TimeTicks::Now() - ready_to_commit_time_); | 761 base::TimeTicks::Now() - ready_to_commit_time_); |
| 762 } | 762 } |
| 763 | 763 |
| 764 DCHECK(!IsInMainFrame() || navigation_entry_committed) | 764 DCHECK(!IsInMainFrame() || navigation_entry_committed) |
| 765 << "Only subframe navigations can get here without changing the " | 765 << "Only subframe navigations can get here without changing the " |
| 766 << "NavigationEntry"; | 766 << "NavigationEntry"; |
| 767 subframe_entry_committed_ = navigation_entry_committed; | 767 subframe_entry_committed_ = navigation_entry_committed; |
| 768 | 768 |
| 769 // If an error page reloads, net_error_code might be 200 but we still want to | 769 // If an error page reloads, net_error_code might be 200 but we still want to |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 if (new_site_url == site_url_) | 1158 if (new_site_url == site_url_) |
| 1159 return; | 1159 return; |
| 1160 | 1160 |
| 1161 // When redirecting cross-site, stop telling the speculative | 1161 // When redirecting cross-site, stop telling the speculative |
| 1162 // RenderProcessHost to expect a navigation commit. | 1162 // RenderProcessHost to expect a navigation commit. |
| 1163 SetExpectedProcess(nullptr); | 1163 SetExpectedProcess(nullptr); |
| 1164 site_url_ = new_site_url; | 1164 site_url_ = new_site_url; |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 } // namespace content | 1167 } // namespace content |
| OLD | NEW |