| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_MEMORY_DETAILS_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_DETAILS_H_ |
| 6 #define CHROME_BROWSER_MEMORY_DETAILS_H_ | 6 #define CHROME_BROWSER_MEMORY_DETAILS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/string16.h" |
| 13 #include "chrome/common/child_process_info.h" | 14 #include "chrome/common/child_process_info.h" |
| 14 | 15 |
| 15 // We collect data about each browser process. A browser may | 16 // We collect data about each browser process. A browser may |
| 16 // have multiple processes (of course!). Even IE has multiple | 17 // have multiple processes (of course!). Even IE has multiple |
| 17 // processes these days. | 18 // processes these days. |
| 18 struct ProcessMemoryInformation { | 19 struct ProcessMemoryInformation { |
| 19 ProcessMemoryInformation(); | 20 ProcessMemoryInformation(); |
| 20 ~ProcessMemoryInformation(); | 21 ~ProcessMemoryInformation(); |
| 21 | 22 |
| 22 // The process id. | 23 // The process id. |
| 23 base::ProcessId pid; | 24 base::ProcessId pid; |
| 24 // The working set information. | 25 // The working set information. |
| 25 base::WorkingSetKBytes working_set; | 26 base::WorkingSetKBytes working_set; |
| 26 // The committed bytes. | 27 // The committed bytes. |
| 27 base::CommittedKBytes committed; | 28 base::CommittedKBytes committed; |
| 28 // The process version | 29 // The process version |
| 29 std::wstring version; | 30 string16 version; |
| 30 // The process product name. | 31 // The process product name. |
| 31 std::wstring product_name; | 32 string16 product_name; |
| 32 // The number of processes which this memory represents. | 33 // The number of processes which this memory represents. |
| 33 int num_processes; | 34 int num_processes; |
| 34 // A process is a diagnostics process if it is rendering | 35 // A process is a diagnostics process if it is rendering |
| 35 // about:xxx information. | 36 // about:xxx information. |
| 36 bool is_diagnostics; | 37 bool is_diagnostics; |
| 37 // If this is a child process of Chrome, what type (i.e. plugin) it is. | 38 // If this is a child process of Chrome, what type (i.e. plugin) it is. |
| 38 ChildProcessInfo::ProcessType type; | 39 ChildProcessInfo::ProcessType type; |
| 39 // A collection of titles used, i.e. for a tab it'll show all the page titles. | 40 // A collection of titles used, i.e. for a tab it'll show all the page titles. |
| 40 std::vector<std::wstring> titles; | 41 std::vector<string16> titles; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 typedef std::vector<ProcessMemoryInformation> ProcessMemoryInformationList; | 44 typedef std::vector<ProcessMemoryInformation> ProcessMemoryInformationList; |
| 44 | 45 |
| 45 // Browser Process Information. | 46 // Browser Process Information. |
| 46 struct ProcessData { | 47 struct ProcessData { |
| 47 ProcessData(); | 48 ProcessData(); |
| 48 ProcessData(const ProcessData& rhs); | 49 ProcessData(const ProcessData& rhs); |
| 49 ~ProcessData(); | 50 ~ProcessData(); |
| 50 ProcessData& operator=(const ProcessData& rhs); | 51 ProcessData& operator=(const ProcessData& rhs); |
| 51 | 52 |
| 52 std::wstring name; | 53 string16 name; |
| 53 std::wstring process_name; | 54 string16 process_name; |
| 54 ProcessMemoryInformationList processes; | 55 ProcessMemoryInformationList processes; |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 #if defined(OS_MACOSX) | 58 #if defined(OS_MACOSX) |
| 58 class ProcessInfoSnapshot; | 59 class ProcessInfoSnapshot; |
| 59 #endif | 60 #endif |
| 60 | 61 |
| 61 // MemoryDetails fetches memory details about current running browsers. | 62 // MemoryDetails fetches memory details about current running browsers. |
| 62 // Because this data can only be fetched asynchronously, callers use | 63 // Because this data can only be fetched asynchronously, callers use |
| 63 // this class via a callback. | 64 // this class via a callback. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 141 |
| 141 // Returns a pointer to the ProcessData structure for Chrome. | 142 // Returns a pointer to the ProcessData structure for Chrome. |
| 142 ProcessData* ChromeBrowser(); | 143 ProcessData* ChromeBrowser(); |
| 143 | 144 |
| 144 std::vector<ProcessData> process_data_; | 145 std::vector<ProcessData> process_data_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(MemoryDetails); | 147 DISALLOW_COPY_AND_ASSIGN(MemoryDetails); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 #endif // CHROME_BROWSER_MEMORY_DETAILS_H_ | 150 #endif // CHROME_BROWSER_MEMORY_DETAILS_H_ |
| OLD | NEW |