| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 5 #ifndef CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
| 6 #define CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 6 #define CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/process_util.h" | 14 #include "base/process/process_handle.h" |
| 15 #include "base/process/process_metrics.h" |
| 15 | 16 |
| 16 // A class which captures process information at a given point in time when its | 17 // A class which captures process information at a given point in time when its |
| 17 // |Sample()| method is called. This information can then be probed by PID. | 18 // |Sample()| method is called. This information can then be probed by PID. |
| 18 // |Sample()| may take a while to complete, so if calling from the browser | 19 // |Sample()| may take a while to complete, so if calling from the browser |
| 19 // process, only do so from the file thread. | 20 // process, only do so from the file thread. |
| 20 // TODO(viettrungluu): This is currently only implemented and used on Mac, so | 21 // TODO(viettrungluu): This is currently only implemented and used on Mac, so |
| 21 // things are very Mac-specific. If this is ever implemented for other | 22 // things are very Mac-specific. If this is ever implemented for other |
| 22 // platforms, we should subclass and add opaqueness (probably |ProcInfoEntry| | 23 // platforms, we should subclass and add opaqueness (probably |ProcInfoEntry| |
| 23 // should be considered opaque). | 24 // should be considered opaque). |
| 24 class ProcessInfoSnapshot { | 25 class ProcessInfoSnapshot { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // size_t GetWorkingSetSizeOfPID(int pid) const; | 104 // size_t GetWorkingSetSizeOfPID(int pid) const; |
| 104 // size_t GetPeakWorkingSetSizeOfPID(int pid) const; | 105 // size_t GetPeakWorkingSetSizeOfPID(int pid) const; |
| 105 // size_t GetPrivateBytesOfPID(int pid) const; | 106 // size_t GetPrivateBytesOfPID(int pid) const; |
| 106 | 107 |
| 107 private: | 108 private: |
| 108 // map from |int| (PID) to |ProcInfoEntry| | 109 // map from |int| (PID) to |ProcInfoEntry| |
| 109 std::map<int,ProcInfoEntry> proc_info_entries_; | 110 std::map<int,ProcInfoEntry> proc_info_entries_; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 #endif // CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ | 113 #endif // CHROME_BROWSER_PROCESS_INFO_SNAPSHOT_H_ |
| OLD | NEW |