OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/app_list_service.h" | 5 #include "chrome/browser/ui/app_list/app_list_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
10 #include "base/process/process_info.h" | 10 #include "base/process/process_info.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 void AppListService::RecordShowTimings(const CommandLine& command_line) { | 40 void AppListService::RecordShowTimings(const CommandLine& command_line) { |
41 // The presence of kOriginalProcessStartTime implies that another process | 41 // The presence of kOriginalProcessStartTime implies that another process |
42 // has sent us its command line to handle, ie: we are already running. | 42 // has sent us its command line to handle, ie: we are already running. |
43 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { | 43 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { |
44 base::TimeDelta elapsed = GetTimeFromOriginalProcessStart(command_line); | 44 base::TimeDelta elapsed = GetTimeFromOriginalProcessStart(command_line); |
45 if (command_line.HasSwitch(switches::kFastStart)) | 45 if (command_line.HasSwitch(switches::kFastStart)) |
46 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStartFast", elapsed); | 46 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStartFast", elapsed); |
47 else | 47 else |
48 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStart", elapsed); | 48 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStart", elapsed); |
49 } else { | 49 } else { |
50 // base::CurrentProcessInfo::CreationTime() is only defined on win/mac. | |
51 #if defined(OS_WIN) || defined(OS_MACOSX) | |
52 UMA_HISTOGRAM_LONG_TIMES( | 50 UMA_HISTOGRAM_LONG_TIMES( |
53 "Startup.ShowAppListColdStart", | 51 "Startup.ShowAppListColdStart", |
54 base::Time::Now() - *base::CurrentProcessInfo::CreationTime()); | 52 base::Time::Now() - *base::CurrentProcessInfo::CreationTime()); |
55 #endif | |
56 } | 53 } |
57 } | 54 } |
OLD | NEW |