Chromium Code Reviews| Index: base/process/process_info_linux.cc |
| diff --git a/base/process/process_info_win.cc b/base/process/process_info_linux.cc |
| similarity index 58% |
| copy from base/process/process_info_win.cc |
| copy to base/process/process_info_linux.cc |
| index 5290b760c8ad62c40724c26185d2c22503ccb380..23998ce0632613972bfa3c795aa6a16182a3d6dd 100644 |
| --- a/base/process/process_info_win.cc |
| +++ b/base/process/process_info_linux.cc |
| @@ -1,27 +1,28 @@ |
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Copyright 2013 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/process_info.h" |
| -#include <windows.h> |
| +#include <sys/stat.h> |
| +#include <sys/types.h> |
| +#include <unistd.h> |
| #include "base/basictypes.h" |
| +#include "base/logging.h" |
| #include "base/time/time.h" |
| namespace { |
| using base::Time; |
| -// Returns the process creation time, or NULL if an error occurred. |
| Time* ProcessCreationTimeInternal() { |
| - FILETIME creation_time = {}; |
| - FILETIME ignore = {}; |
| - if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore, |
| - &ignore, &ignore) == false) |
| + struct stat result; |
| + int rv = stat("/proc/self", &result); |
| + DCHECK(!rv); |
| + if (rv) |
| return NULL; |
| - |
| - return new Time(Time::FromFileTime(creation_time)); |
| + return new Time(Time::FromTimeT(result.st_ctime)); |
|
willchan no longer on Chromium
2013/07/31 05:01:07
Uh, what's freeing this memory?
James Simonsen
2013/08/02 01:31:40
Nobody. It's a singleton.
Are you implying I chan
willchan no longer on Chromium
2013/08/02 05:51:53
No, I screwed up. I thought ProcessCreationTimeInt
|
| } |
| } // namespace |