| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/process_util.h" | 12 #include "base/process_util.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "content/common/child_process_info.h" | 14 #include "content/public/common/process_type.h" |
| 15 | 15 |
| 16 // We collect data about each browser process. A browser may | 16 // We collect data about each browser process. A browser may |
| 17 // have multiple processes (of course!). Even IE has multiple | 17 // have multiple processes (of course!). Even IE has multiple |
| 18 // processes these days. | 18 // processes these days. |
| 19 struct ProcessMemoryInformation { | 19 struct ProcessMemoryInformation { |
| 20 // NOTE: Do not remove or reorder the elements in this enum, and only add new | 20 // NOTE: Do not remove or reorder the elements in this enum, and only add new |
| 21 // items at the end. We depend on these specific values in a histogram. | 21 // items at the end. We depend on these specific values in a histogram. |
| 22 enum RendererProcessType { | 22 enum RendererProcessType { |
| 23 RENDERER_UNKNOWN = 0, | 23 RENDERER_UNKNOWN = 0, |
| 24 RENDERER_NORMAL, | 24 RENDERER_NORMAL, |
| 25 RENDERER_CHROME, // WebUI (chrome:// URL) | 25 RENDERER_CHROME, // WebUI (chrome:// URL) |
| 26 RENDERER_EXTENSION, // chrome-extension:// | 26 RENDERER_EXTENSION, // chrome-extension:// |
| 27 RENDERER_DEVTOOLS, // Web inspector | 27 RENDERER_DEVTOOLS, // Web inspector |
| 28 RENDERER_INTERSTITIAL, // malware/phishing interstitial | 28 RENDERER_INTERSTITIAL, // malware/phishing interstitial |
| 29 RENDERER_NOTIFICATION, // HTML notification bubble | 29 RENDERER_NOTIFICATION, // HTML notification bubble |
| 30 RENDERER_BACKGROUND_APP // hosted app background page | 30 RENDERER_BACKGROUND_APP // hosted app background page |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 static std::string GetRendererTypeNameInEnglish(RendererProcessType type); | 33 static std::string GetRendererTypeNameInEnglish(RendererProcessType type); |
| 34 static std::string GetFullTypeNameInEnglish( | 34 static std::string GetFullTypeNameInEnglish( |
| 35 ChildProcessInfo::ProcessType type, | 35 content::ProcessType type, |
| 36 RendererProcessType rtype); | 36 RendererProcessType rtype); |
| 37 | 37 |
| 38 ProcessMemoryInformation(); | 38 ProcessMemoryInformation(); |
| 39 ~ProcessMemoryInformation(); | 39 ~ProcessMemoryInformation(); |
| 40 | 40 |
| 41 // The process id. | 41 // The process id. |
| 42 base::ProcessId pid; | 42 base::ProcessId pid; |
| 43 // The working set information. | 43 // The working set information. |
| 44 base::WorkingSetKBytes working_set; | 44 base::WorkingSetKBytes working_set; |
| 45 // The committed bytes. | 45 // The committed bytes. |
| 46 base::CommittedKBytes committed; | 46 base::CommittedKBytes committed; |
| 47 // The process version | 47 // The process version |
| 48 string16 version; | 48 string16 version; |
| 49 // The process product name. | 49 // The process product name. |
| 50 string16 product_name; | 50 string16 product_name; |
| 51 // The number of processes which this memory represents. | 51 // The number of processes which this memory represents. |
| 52 int num_processes; | 52 int num_processes; |
| 53 // A process is a diagnostics process if it is rendering about:memory. | 53 // A process is a diagnostics process if it is rendering about:memory. |
| 54 // Mark this specially so that it can avoid counting it in its own | 54 // Mark this specially so that it can avoid counting it in its own |
| 55 // results. | 55 // results. |
| 56 bool is_diagnostics; | 56 bool is_diagnostics; |
| 57 // If this is a child process of Chrome, what type (i.e. plugin) it is. | 57 // If this is a child process of Chrome, what type (i.e. plugin) it is. |
| 58 ChildProcessInfo::ProcessType type; | 58 content::ProcessType type; |
| 59 // If this is a renderer process, what type it is. | 59 // If this is a renderer process, what type it is. |
| 60 RendererProcessType renderer_type; | 60 RendererProcessType renderer_type; |
| 61 // A collection of titles used, i.e. for a tab it'll show all the page titles. | 61 // A collection of titles used, i.e. for a tab it'll show all the page titles. |
| 62 std::vector<string16> titles; | 62 std::vector<string16> titles; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 typedef std::vector<ProcessMemoryInformation> ProcessMemoryInformationList; | 65 typedef std::vector<ProcessMemoryInformation> ProcessMemoryInformationList; |
| 66 | 66 |
| 67 // Browser Process Information. | 67 // Browser Process Information. |
| 68 struct ProcessData { | 68 struct ProcessData { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 // Returns a pointer to the ProcessData structure for Chrome. | 163 // Returns a pointer to the ProcessData structure for Chrome. |
| 164 ProcessData* ChromeBrowser(); | 164 ProcessData* ChromeBrowser(); |
| 165 | 165 |
| 166 std::vector<ProcessData> process_data_; | 166 std::vector<ProcessData> process_data_; |
| 167 | 167 |
| 168 DISALLOW_COPY_AND_ASSIGN(MemoryDetails); | 168 DISALLOW_COPY_AND_ASSIGN(MemoryDetails); |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 #endif // CHROME_BROWSER_MEMORY_DETAILS_H_ | 171 #endif // CHROME_BROWSER_MEMORY_DETAILS_H_ |
| OLD | NEW |