Expose the method used for the next URLRequest redirect.
[chromium-blink-merge.git] / base / process_info_win.cc
blob04c6c2f6f4388a0f0d6562b8b5d52d0ac3a88d07
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.
5 #include "base/process_info.h"
7 #include <windows.h>
9 #include "base/basictypes.h"
10 #include "base/time/time.h"
12 namespace {
14 using base::Time;
16 // Returns the process creation time, or NULL if an error occurred.
17 Time* ProcessCreationTimeInternal() {
18 FILETIME creation_time = {};
19 FILETIME ignore = {};
20 if (::GetProcessTimes(::GetCurrentProcess(), &creation_time, &ignore,
21 &ignore, &ignore) == false)
22 return NULL;
24 return new Time(Time::FromFileTime(creation_time));
27 } // namespace
29 namespace base {
31 //static
32 const Time* CurrentProcessInfo::CreationTime() {
33 static Time* process_creation_time = ProcessCreationTimeInternal();
34 return process_creation_time;
37 } // namespace base