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_BROWSER_LOADER_RESOURCE_BUFFER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_BUFFER_H_ |
6 #define CONTENT_BROWSER_LOADER_RESOURCE_BUFFER_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_BUFFER_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/macros.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | 16 |
17 // ResourceBuffer implements a simple "circular buffer" allocation strategy. | 17 // ResourceBuffer implements a simple "circular buffer" allocation strategy. |
18 // Allocations are recycled in FIFO order. | 18 // Allocations are recycled in FIFO order. |
19 // | 19 // |
20 // You can think of the ResourceBuffer as a FIFO. The Allocate method reserves | 20 // You can think of the ResourceBuffer as a FIFO. The Allocate method reserves |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 int alloc_end_; | 119 int alloc_end_; |
120 | 120 |
121 std::queue<int> alloc_sizes_; | 121 std::queue<int> alloc_sizes_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(ResourceBuffer); | 123 DISALLOW_COPY_AND_ASSIGN(ResourceBuffer); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace content | 126 } // namespace content |
127 | 127 |
128 #endif // CONTENT_BROWSER_LOADER_RESOURCE_BUFFER_H_ | 128 #endif // CONTENT_BROWSER_LOADER_RESOURCE_BUFFER_H_ |
OLD | NEW |