Chromium Code Reviews| Index: gpu/command_buffer/client/mapped_memory.h |
| diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h |
| index ec70c430de5969f66e652242b8554254e6c932b0..d42299ee11b99e5c10d5033d01745a765c917833 100644 |
| --- a/gpu/command_buffer/client/mapped_memory.h |
| +++ b/gpu/command_buffer/client/mapped_memory.h |
| @@ -79,7 +79,7 @@ class GPU_EXPORT MemoryChunk { |
| allocator_.FreePendingToken(pointer, token); |
| } |
| - // Frees any blocks who's tokens have passed. |
| + // Frees any blocks whose tokens have passed. |
| void FreeUnused() { |
| allocator_.FreeUnused(); |
| } |
| @@ -90,7 +90,7 @@ class GPU_EXPORT MemoryChunk { |
| pointer < reinterpret_cast<const int8*>(shm_.ptr) + shm_.size; |
| } |
| - // Returns true of any memory in this chuck is in use. |
| + // Returns true of any memory in this chunk is in use. |
| bool InUse() { |
| return allocator_.InUse(); |
| } |
| @@ -103,10 +103,12 @@ class GPU_EXPORT MemoryChunk { |
| DISALLOW_COPY_AND_ASSIGN(MemoryChunk); |
| }; |
| -// Manages MemoryChucks. |
| +// Manages MemoryChunks. |
| class GPU_EXPORT MappedMemoryManager { |
| public: |
| explicit MappedMemoryManager(CommandBufferHelper* helper); |
| + explicit MappedMemoryManager(CommandBufferHelper* helper, |
|
piman
2013/08/15 02:49:03
No explicit. Do we really need 2 constructors? Can
kaanb
2013/08/16 22:50:44
Removed the explicit. I'd prefer to keep this patc
|
| + size_t memory_limit); |
| ~MappedMemoryManager(); |
| @@ -151,12 +153,17 @@ class GPU_EXPORT MappedMemoryManager { |
| } |
| private: |
| + enum MemoryLimit { |
| + kNoLimit = 0, |
| + }; |
| typedef ScopedVector<MemoryChunk> MemoryChunkVector; |
| // size a chunk is rounded up to. |
| unsigned int chunk_size_multiple_; |
| CommandBufferHelper* helper_; |
| MemoryChunkVector chunks_; |
| + size_t allocated_memory_; |
| + size_t memory_limit_; |
| DISALLOW_COPY_AND_ASSIGN(MappedMemoryManager); |
| }; |