Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: net/disk_cache/flash/segment.h

Issue 11269008: Cache backend for devices with flash storage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: test Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.cc ('k') | net/disk_cache/flash/segment.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 NET_DISK_CACHE_FLASH_SEGMENT_H_ 5 #ifndef NET_DISK_CACHE_FLASH_SEGMENT_H_
6 #define NET_DISK_CACHE_FLASH_SEGMENT_H_ 6 #define NET_DISK_CACHE_FLASH_SEGMENT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 bool ReadData(void* buffer, int32 size, int32 offset) const; 90 bool ReadData(void* buffer, int32 size, int32 offset) const;
91 91
92 // Closes the segment, returns true on success and false on failure. Closing 92 // Closes the segment, returns true on success and false on failure. Closing
93 // a segment makes it immutable. 93 // a segment makes it immutable.
94 bool Close(); 94 bool Close();
95 95
96 // Returns true if segment can accommodate an entry of |size| bytes. 96 // Returns true if segment can accommodate an entry of |size| bytes.
97 bool CanHold(int32 size) const; 97 bool CanHold(int32 size) const;
98 98
99 private: 99 private:
100 FRIEND_TEST_ALL_PREFIXES(SegmentTest, CreateDestroy);
101
102 bool read_only_; // Indicates whether the segment can be written to. 100 bool read_only_; // Indicates whether the segment can be written to.
103 bool init_; // Indicates whether segment was initialized. 101 bool init_; // Indicates whether segment was initialized.
104 Storage* storage_; // Storage on which the segment resides. 102 Storage* storage_; // Storage on which the segment resides.
105 const int32 offset_; // Offset of the segment on |storage_|. 103 const int32 offset_; // Offset of the segment on |storage_|.
106 const int32 summary_offset_; // Offset of the segment summary. 104 const int32 summary_offset_; // Offset of the segment summary.
107 int32 write_offset_; // Current write offset. 105 int32 write_offset_; // Current write offset.
108 std::vector<int32> header_offsets_; 106 std::vector<int32> header_offsets_;
109 107
110 DISALLOW_COPY_AND_ASSIGN(Segment); 108 DISALLOW_COPY_AND_ASSIGN(Segment);
111 }; 109 };
112 110
113 } // namespace disk_cache 111 } // namespace disk_cache
114 112
115 #endif // NET_DISK_CACHE_FLASH_SEGMENT_H_ 113 #endif // NET_DISK_CACHE_FLASH_SEGMENT_H_
OLDNEW
« no previous file with comments | « net/disk_cache/flash/flash_cache_test_base.cc ('k') | net/disk_cache/flash/segment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698