Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/process_info.h" | |
| 6 | |
| 7 #include <windows.h> | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/time.h" | |
| 11 | |
| 12 namespace base { | |
| 13 | |
| 14 //static | |
| 15 const Time* CurrentProcessInfo::CreationTime() { | |
| 16 static Time process_creation_time; | |
| 17 static bool process_creation_time_initialized = false; | |
| 18 | |
| 19 if (!process_creation_time_initialized) { | |
| 20 // Calculate the time that has elapsed from our own process creation. | |
| 21 FILETIME creation_time = {}; | |
| 22 FILETIME ignore = {}; | |
| 23 ::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, &ignore, | |
| 24 &ignore); | |
| 25 | |
| 26 process_creation_time = base::Time::FromFileTime(creation_time); | |
| 27 process_creation_time_initialized = true; | |
| 28 } | |
| 29 return &process_creation_time; | |
|
Mark Mentovai
2012/06/15 21:18:57
Once again. Looks like you chose a poor interface
| |
| 30 } | |
| 31 | |
| 32 } // namespace base | |
| OLD | NEW |