Chromium Code Reviews| Index: base/process_info_win.cc |
| diff --git a/base/process_info_win.cc b/base/process_info_win.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a41e1d84c48239cf134942563f09a795f4b166b4 |
| --- /dev/null |
| +++ b/base/process_info_win.cc |
| @@ -0,0 +1,32 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/process_info.h" |
| + |
| +#include <windows.h> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/time.h" |
| + |
| +namespace base { |
| + |
| +//static |
| +const Time* CurrentProcessInfo::CreationTime() { |
| + static Time process_creation_time; |
| + static bool process_creation_time_initialized = false; |
| + |
| + if (!process_creation_time_initialized) { |
| + // Calculate the time that has elapsed from our own process creation. |
| + FILETIME creation_time = {}; |
| + FILETIME ignore = {}; |
| + ::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, &ignore, |
| + &ignore); |
| + |
| + process_creation_time = base::Time::FromFileTime(creation_time); |
| + process_creation_time_initialized = true; |
| + } |
| + return &process_creation_time; |
|
Mark Mentovai
2012/06/15 21:18:57
Once again. Looks like you chose a poor interface
|
| +} |
| + |
| +} // namespace base |