Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 1136523004: [Sessions] Add detailed logging of SessionRestore events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 5a9cb08035a7b0a18f427b2f8f229a7b2b1c2177..353f37bb6ccdd7b3690b2fefb655ba2a43e693b6 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -35,6 +35,7 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
+#include "content/public/browser/session_restore_uma.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/common/content_client.h"
@@ -1750,8 +1751,24 @@ size_t NavigationControllerImpl::max_entry_count() {
}
void NavigationControllerImpl::SetActive(bool is_active) {
- if (is_active && needs_reload_)
+ if (is_active && needs_reload_) {
+ // If the pending navigation is a session restore entry then it is being
+ // loaded because of user action, and not automatically by the TabLoader.
+ // Consider this a deferred reload that the user then forced to occur.
+ // Better session restore tab prioritization should reduce the number of
+ // times this occurs.
+ NavigationEntryImpl* pending_entry =
+ entries_[last_committed_entry_index_].get();
+ if (pending_entry->restore_type() == RESTORE_LAST_SESSION_EXITED_CLEANLY ||
+ pending_entry->restore_type() == RESTORE_LAST_SESSION_CRASHED) {
+ UMA_HISTOGRAM_ENUMERATION(
+ content::kSessionRestoreTabActions,
+ content::kSessionRestoreTabActionsUma_DeferredTabLoadedByUserAction,
+ content::kSessionRestoreTabActionsUma_Max);
+ }
+
LoadIfNecessary();
+ }
}
void NavigationControllerImpl::LoadIfNecessary() {

Powered by Google App Engine
This is Rietveld 408576698