| Index: chrome/browser/ui/app_list/app_list_service.cc
|
| diff --git a/chrome/browser/ui/app_list/app_list_service.cc b/chrome/browser/ui/app_list/app_list_service.cc
|
| index 7d686ef3b20be9485802ce1389a1d37b86b14d63..5c15a85ee53da764c6b7e0c5a4b04be7dbe19b6e 100644
|
| --- a/chrome/browser/ui/app_list/app_list_service.cc
|
| +++ b/chrome/browser/ui/app_list/app_list_service.cc
|
| @@ -50,10 +50,24 @@ StartupType GetStartupType(const CommandLine& command_line) {
|
| return COLD_START;
|
| }
|
|
|
| -void RecordFirstPaintTiming(StartupType startup_type,
|
| - const base::Time& start_time) {
|
| +// The time the process that caused the app list to be shown started. This isn't
|
| +// necessarily the currently executing process as we may be processing a command
|
| +// line given to a short-lived Chrome instance.
|
| +int64 g_original_process_start_time;
|
| +
|
| +// The type of startup the the current app list show has gone through.
|
| +StartupType g_app_show_startup_type;
|
| +
|
| +void RecordStartupInfo(StartupType startup_type, const base::Time& start_time) {
|
| + g_original_process_start_time = start_time.ToInternalValue();
|
| + g_app_show_startup_type = startup_type;
|
| +}
|
| +
|
| +void RecordFirstPaintTiming() {
|
| + base::Time start_time(
|
| + base::Time::FromInternalValue(g_original_process_start_time));
|
| base::TimeDelta elapsed = base::Time::Now() - start_time;
|
| - switch (startup_type) {
|
| + switch (g_app_show_startup_type) {
|
| case COLD_START:
|
| UMA_HISTOGRAM_LONG_TIMES("Startup.AppListFirstPaintColdStart", elapsed);
|
| break;
|
| @@ -110,6 +124,7 @@ void AppListService::RecordShowTimings(const CommandLine& command_line) {
|
| break;
|
| }
|
|
|
| + RecordStartupInfo(startup, start_time);
|
| Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->SetAppListNextPaintCallback(
|
| - base::Bind(RecordFirstPaintTiming, startup, start_time));
|
| + RecordFirstPaintTiming);
|
| }
|
|
|