| // 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 "base/basictypes.h" |
| // Returns the process creation time, or NULL if an error occurred. |
| Time* ProcessCreationTimeInternal() { |
| FILETIME creation_time = {}; |
| if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, |
| &ignore, &ignore) == false) |
| return new Time(Time::FromFileTime(creation_time)); |
| const Time* CurrentProcessInfo::CreationTime() { |
| static Time* process_creation_time = ProcessCreationTimeInternal(); |
| return process_creation_time; |