| 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 16 matching lines...) Expand all Loading... |
| 27 command_line.GetSwitchValueASCII(switches::kOriginalProcessStartTime); | 27 command_line.GetSwitchValueASCII(switches::kOriginalProcessStartTime); |
| 28 int64 remote_start_time; | 28 int64 remote_start_time; |
| 29 base::StringToInt64(start_time_string, &remote_start_time); | 29 base::StringToInt64(start_time_string, &remote_start_time); |
| 30 return base::Time::FromInternalValue(remote_start_time); | 30 return base::Time::FromInternalValue(remote_start_time); |
| 31 } | 31 } |
| 32 | 32 |
| 33 // base::CurrentProcessInfo::CreationTime() is only defined on some | 33 // base::CurrentProcessInfo::CreationTime() is only defined on some |
| 34 // platforms. | 34 // platforms. |
| 35 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) | 35 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 36 return base::CurrentProcessInfo::CreationTime(); | 36 return base::CurrentProcessInfo::CreationTime(); |
| 37 #else |
| 38 return base::Time(); |
| 37 #endif | 39 #endif |
| 38 return base::Time(); | |
| 39 } | 40 } |
| 40 | 41 |
| 41 StartupType GetStartupType(const CommandLine& command_line) { | 42 StartupType GetStartupType(const CommandLine& command_line) { |
| 42 // The presence of kOriginalProcessStartTime implies that another process | 43 // The presence of kOriginalProcessStartTime implies that another process |
| 43 // has sent us its command line to handle, ie: we are already running. | 44 // has sent us its command line to handle, ie: we are already running. |
| 44 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { | 45 if (command_line.HasSwitch(switches::kOriginalProcessStartTime)) { |
| 45 return command_line.HasSwitch(switches::kFastStart) ? | 46 return command_line.HasSwitch(switches::kFastStart) ? |
| 46 WARM_START_FAST : WARM_START; | 47 WARM_START_FAST : WARM_START; |
| 47 } | 48 } |
| 48 return COLD_START; | 49 return COLD_START; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 break; | 123 break; |
| 123 case WARM_START_FAST: | 124 case WARM_START_FAST: |
| 124 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStartFast", elapsed); | 125 UMA_HISTOGRAM_LONG_TIMES("Startup.ShowAppListWarmStartFast", elapsed); |
| 125 break; | 126 break; |
| 126 } | 127 } |
| 127 | 128 |
| 128 RecordStartupInfo(startup, start_time); | 129 RecordStartupInfo(startup, start_time); |
| 129 Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->SetAppListNextPaintCallback( | 130 Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->SetAppListNextPaintCallback( |
| 130 RecordFirstPaintTiming); | 131 RecordFirstPaintTiming); |
| 131 } | 132 } |
| OLD | NEW |