Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Unified Diff: base/process/process_info_win.cc

Issue 21302005: Add CurrentProcessInfo::CreationTime() for Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process/process_info_mac.cc ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_info_win.cc
diff --git a/base/process/process_info_win.cc b/base/process/process_info_win.cc
index 5290b760c8ad62c40724c26185d2c22503ccb380..b930ae6dd8864bd0e9954e2794e68328f204127e 100644
--- a/base/process/process_info_win.cc
+++ b/base/process/process_info_win.cc
@@ -9,29 +9,17 @@
#include "base/basictypes.h"
#include "base/time/time.h"
-namespace {
-
-using base::Time;
+namespace base {
-// Returns the process creation time, or NULL if an error occurred.
-Time* ProcessCreationTimeInternal() {
+//static
+const Time CurrentProcessInfo::CreationTime() {
FILETIME creation_time = {};
FILETIME ignore = {};
if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore,
&ignore, &ignore) == false)
- return NULL;
-
- return new Time(Time::FromFileTime(creation_time));
-}
+ return Time();
-} // namespace
-
-namespace base {
-
-//static
-const Time* CurrentProcessInfo::CreationTime() {
- static Time* process_creation_time = ProcessCreationTimeInternal();
- return process_creation_time;
+ return Time::FromFileTime(creation_time);
}
} // namespace base
« no previous file with comments | « base/process/process_info_mac.cc ('k') | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698