Chromium Code Reviews| 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). |