| Index: content/browser/frame_host/navigator_impl.cc
|
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
|
| index 93063b600cffe3aa9c0ea574b67ebeebd58a6a09..8ec2dc19173d35f3eda5416fe9a5ccc687973889 100644
|
| --- a/content/browser/frame_host/navigator_impl.cc
|
| +++ b/content/browser/frame_host/navigator_impl.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram_macros.h"
|
| +#include "base/strings/string_util.h"
|
| #include "base/time/time.h"
|
| #include "content/browser/frame_host/debug_urls.h"
|
| #include "content/browser/frame_host/frame_tree.h"
|
| @@ -444,7 +445,8 @@ bool NavigatorImpl::NavigateToPendingEntry(
|
| }
|
|
|
| bool NavigatorImpl::NavigateNewChildFrame(
|
| - RenderFrameHostImpl* render_frame_host) {
|
| + RenderFrameHostImpl* render_frame_host,
|
| + const GURL& default_url) {
|
| NavigationEntryImpl* entry =
|
| controller_->GetEntryWithUniqueID(render_frame_host->nav_entry_id());
|
| if (!entry)
|
| @@ -455,6 +457,26 @@ bool NavigatorImpl::NavigateNewChildFrame(
|
| if (!frame_entry)
|
| return false;
|
|
|
| + // Track how often history navigations load a different URL into a subframe
|
| + // than the frame's default URL.
|
| + bool restoring_different_url = frame_entry->url() != default_url;
|
| + UMA_HISTOGRAM_BOOLEAN("SessionRestore.RestoredSubframeURL",
|
| + restoring_different_url);
|
| + // If this frame's unique name uses a frame path, record the name length.
|
| + // If these names are long in practice, then a proposed plan to truncate
|
| + // unique names might affect restore behavior, since it is complex to deal
|
| + // with truncated names inside frame paths.
|
| + if (restoring_different_url) {
|
| + const std::string& unique_name =
|
| + render_frame_host->frame_tree_node()->unique_name();
|
| + const char kFramePathPrefix[] = "<!--framePath ";
|
| + if (base::StartsWith(unique_name, kFramePathPrefix,
|
| + base::CompareCase::SENSITIVE)) {
|
| + UMA_HISTOGRAM_COUNTS("SessionRestore.RestoreSubframeFramePathLength",
|
| + unique_name.size());
|
| + }
|
| + }
|
| +
|
| return NavigateToEntry(render_frame_host->frame_tree_node(), *frame_entry,
|
| *entry, ReloadType::NONE, false, true, false, nullptr);
|
| }
|
|
|