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

Side by Side Diff: base/process_info_mac.cc

Issue 18119002: Use a direct include of time headers in base/, part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process_info_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process_info.h" 5 #include "base/process_info.h"
6 6
7 #include <sys/sysctl.h> 7 #include <sys/sysctl.h>
8 #include <sys/time.h> 8 #include <sys/time.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/time.h" 13 #include "base/time/time.h"
14 14
15 namespace { 15 namespace {
16 16
17 using base::Time; 17 using base::Time;
18 18
19 // Returns the process creation time, or NULL if an error occurred. 19 // Returns the process creation time, or NULL if an error occurred.
20 Time* ProcessCreationTimeInternal() { 20 Time* ProcessCreationTimeInternal() {
21 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() }; 21 int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid() };
22 size_t len = 0; 22 size_t len = 0;
23 if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0) 23 if (sysctl(mib, arraysize(mib), NULL, &len, NULL, 0) < 0)
(...skipping 10 matching lines...) Expand all
34 34
35 namespace base { 35 namespace base {
36 36
37 //static 37 //static
38 const Time* CurrentProcessInfo::CreationTime() { 38 const Time* CurrentProcessInfo::CreationTime() {
39 static Time* process_creation_time = ProcessCreationTimeInternal(); 39 static Time* process_creation_time = ProcessCreationTimeInternal();
40 return process_creation_time; 40 return process_creation_time;
41 } 41 }
42 42
43 } // namespace base 43 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_metrics.h ('k') | base/process_info_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698