| 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_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| 7 | 7 |
| 8 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "content/common/gpu/gpu_memory_manager.h" | 11 #include "content/common/gpu/gpu_memory_manager.h" |
| 12 | 12 |
| 13 namespace content { |
| 14 |
| 13 // All decoders in a context group point to a single GpuMemoryTrackingGroup, | 15 // All decoders in a context group point to a single GpuMemoryTrackingGroup, |
| 14 // which tracks GPU resource consumption for the entire context group. | 16 // which tracks GPU resource consumption for the entire context group. |
| 15 class GpuMemoryTrackingGroup { | 17 class GpuMemoryTrackingGroup { |
| 16 public: | 18 public: |
| 17 GpuMemoryTrackingGroup(base::ProcessId pid, GpuMemoryManager* memory_manager) | 19 GpuMemoryTrackingGroup(base::ProcessId pid, GpuMemoryManager* memory_manager) |
| 18 : pid_(pid), | 20 : pid_(pid), |
| 19 size_(0), | 21 size_(0), |
| 20 memory_manager_(memory_manager) { | 22 memory_manager_(memory_manager) { |
| 21 memory_manager_->AddTrackingGroup(this); | 23 memory_manager_->AddTrackingGroup(this); |
| 22 } | 24 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 size_t GetSize() const { | 43 size_t GetSize() const { |
| 42 return size_; | 44 return size_; |
| 43 } | 45 } |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 base::ProcessId pid_; | 48 base::ProcessId pid_; |
| 47 size_t size_; | 49 size_t size_; |
| 48 GpuMemoryManager* memory_manager_; | 50 GpuMemoryManager* memory_manager_; |
| 49 }; | 51 }; |
| 50 | 52 |
| 53 } // namespace content |
| 54 |
| 51 #endif | 55 #endif |
| 52 | 56 |
| 53 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ | 57 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_ |
| OLD | NEW |