| 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 NET_DISK_CACHE_BITMAP_H_ | 5 #ifndef NET_DISK_CACHE_BITMAP_H_ |
| 6 #define NET_DISK_CACHE_BITMAP_H_ | 6 #define NET_DISK_CACHE_BITMAP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "net/base/net_api.h" | 10 #include "net/base/net_export.h" |
| 11 | 11 |
| 12 namespace disk_cache { | 12 namespace disk_cache { |
| 13 | 13 |
| 14 // This class provides support for simple maps of bits. | 14 // This class provides support for simple maps of bits. |
| 15 class NET_TEST Bitmap { | 15 class NET_EXPORT_PRIVATE Bitmap { |
| 16 public: | 16 public: |
| 17 Bitmap() : map_(NULL), num_bits_(0), array_size_(0), alloc_(false) {} | 17 Bitmap() : map_(NULL), num_bits_(0), array_size_(0), alloc_(false) {} |
| 18 | 18 |
| 19 // This constructor will allocate on a uint32 boundary. If |clear_bits| is | 19 // This constructor will allocate on a uint32 boundary. If |clear_bits| is |
| 20 // false, the bitmap bits will not be initialized. | 20 // false, the bitmap bits will not be initialized. |
| 21 Bitmap(int num_bits, bool clear_bits); | 21 Bitmap(int num_bits, bool clear_bits); |
| 22 | 22 |
| 23 // Constructs a Bitmap with the actual storage provided by the caller. |map| | 23 // Constructs a Bitmap with the actual storage provided by the caller. |map| |
| 24 // has to be valid until this object destruction. |num_bits| is the number of | 24 // has to be valid until this object destruction. |num_bits| is the number of |
| 25 // bits in the bitmap, and |num_words| is the size of |map| in 32-bit words. | 25 // bits in the bitmap, and |num_words| is the size of |map| in 32-bit words. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 int num_bits_; // The upper bound of the bitmap. | 128 int num_bits_; // The upper bound of the bitmap. |
| 129 int array_size_; // The physical size (in uint32s) of the bitmap. | 129 int array_size_; // The physical size (in uint32s) of the bitmap. |
| 130 bool alloc_; // Whether or not we allocated the memory. | 130 bool alloc_; // Whether or not we allocated the memory. |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(Bitmap); | 132 DISALLOW_COPY_AND_ASSIGN(Bitmap); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace disk_cache | 135 } // namespace disk_cache |
| 136 | 136 |
| 137 #endif // NET_DISK_CACHE_BITMAP_H_ | 137 #endif // NET_DISK_CACHE_BITMAP_H_ |
| OLD | NEW |