| OLD | NEW |
| 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 #ifndef CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ | 6 #define CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ |
| 7 | 7 |
| 8 // Provides access to the GPU information for the system | 8 // Provides access to the GPU information for the system |
| 9 // on which chrome is currently running. | 9 // on which chrome is currently running. |
| 10 | 10 |
| 11 #include <stddef.h> | 11 #include <stddef.h> |
| 12 | 12 |
| 13 #include <map> | 13 #include <map> |
| 14 | 14 |
| 15 #include "base/process/process.h" | 15 #include "base/process/process.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 struct CONTENT_EXPORT GPUVideoMemoryUsageStats { | 20 struct CONTENT_EXPORT GPUVideoMemoryUsageStats { |
| 21 GPUVideoMemoryUsageStats(); | 21 GPUVideoMemoryUsageStats(); |
| 22 ~GPUVideoMemoryUsageStats(); | 22 ~GPUVideoMemoryUsageStats(); |
| 23 | 23 |
| 24 struct CONTENT_EXPORT ProcessStats { | 24 struct CONTENT_EXPORT ProcessStats { |
| 25 ProcessStats(); | 25 ProcessStats(); |
| 26 ~ProcessStats(); | 26 ~ProcessStats(); |
| 27 | 27 |
| 28 // The bytes of GPU resources accessible by this process | 28 // The bytes of GPU resources accessible by this process |
| 29 size_t video_memory; | 29 uint32_t video_memory; |
| 30 | 30 |
| 31 // Set to true if this process' GPU resource count is inflated because | 31 // Set to true if this process' GPU resource count is inflated because |
| 32 // it is counting other processes' resources (e.g, the GPU process has | 32 // it is counting other processes' resources (e.g, the GPU process has |
| 33 // duplicate set to true because it is the aggregate of all processes) | 33 // duplicate set to true because it is the aggregate of all processes) |
| 34 bool has_duplicates; | 34 bool has_duplicates; |
| 35 }; | 35 }; |
| 36 typedef std::map<base::ProcessId, ProcessStats> ProcessMap; | 36 typedef std::map<base::ProcessId, ProcessStats> ProcessMap; |
| 37 | 37 |
| 38 // A map of processes to their GPU resource consumption | 38 // A map of processes to their GPU resource consumption |
| 39 ProcessMap process_map; | 39 ProcessMap process_map; |
| 40 | 40 |
| 41 // The total amount of GPU memory allocated at the time of the request. | 41 // The total amount of GPU memory allocated at the time of the request. |
| 42 size_t bytes_allocated; | 42 uint32_t bytes_allocated; |
| 43 | 43 |
| 44 // The maximum amount of GPU memory ever allocated at once. | 44 // The maximum amount of GPU memory ever allocated at once. |
| 45 size_t bytes_allocated_historical_max; | 45 uint32_t bytes_allocated_historical_max; |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace content | 48 } // namespace content |
| 49 | 49 |
| 50 #endif // CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ | 50 #endif // CONTENT_PUBLIC_COMMON_GPU_MEMORY_STATS_H_ |
| OLD | NEW |