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

Unified Diff: chrome/browser/sessions/session_restore.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
« no previous file with comments | « no previous file | chrome/browser/sessions/tab_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore.cc
diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc
index 840219227c5bc0ea450d9c93b37108a94e77b5ac..07ac111def570b93c1f8e44420911f95f2125138 100644
--- a/chrome/browser/sessions/session_restore.cc
+++ b/chrome/browser/sessions/session_restore.cc
@@ -48,6 +48,7 @@
#include "content/public/browser/render_process_host.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/session_storage_namespace.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
@@ -181,6 +182,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
// Always create in a new window.
FinishedTabCreation(true, true, created_contents);
+ // Record the number of tabs associated with this session restore.
+ UMA_HISTOGRAM_COUNTS_100(content::kSessionRestoreTabCount,
sky 2015/05/07 20:23:45 Please try to keep all stats collection in Session
+ created_contents.size());
+
on_session_restored_callbacks_->Notify(
static_cast<int>(created_contents.size()));
@@ -224,6 +229,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
tab.pinned, true, nullptr, tab.user_agent_override);
// Start loading the tab immediately.
web_contents->GetController().LoadIfNecessary();
+ UMA_HISTOGRAM_ENUMERATION(
+ content::kSessionRestoreTabActions,
+ content::kSessionRestoreTabActionsUma_ForegroundTabLoaded,
+ content::kSessionRestoreTabActionsUma_Max);
}
if (use_new_window) {
@@ -522,6 +531,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
restored_tab.contents = contents;
restored_tab.is_active = is_selected_tab;
created_contents->push_back(restored_tab);
+ UMA_HISTOGRAM_ENUMERATION(
+ content::kSessionRestoreTabActions,
+ content::kSessionRestoreTabActionsUma_TabCreated,
+ content::kSessionRestoreTabActionsUma_Max);
// If this isn't the selected tab, there's nothing else to do.
if (!is_selected_tab)
@@ -547,6 +560,10 @@ class SessionRestoreImpl : public content::NotificationObserver {
restored_tab.contents = contents;
restored_tab.is_active = false;
created_contents->push_back(restored_tab);
+ UMA_HISTOGRAM_ENUMERATION(
+ content::kSessionRestoreTabActions,
+ content::kSessionRestoreTabActionsUma_TabCreated,
+ content::kSessionRestoreTabActionsUma_Max);
}
}
}
@@ -721,6 +738,10 @@ Browser* SessionRestore::RestoreSession(
chromeos::BootTimesRecorder::Get()->AddLoginTimeMarker(
"SessionRestore-Start", false);
#endif
+ UMA_HISTOGRAM_ENUMERATION(
+ content::kSessionRestoreActions,
+ content::kSessionRestoreActionsUma_Initiated,
+ content::kSessionRestoreActionsUma_Max);
DCHECK(profile);
// Always restore from the original profile (incognito profiles have no
// session service).
« no previous file with comments | « no previous file | chrome/browser/sessions/tab_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698