| OLD | NEW |
| 1 // Copyright (c) 2011 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 // See net/disk_cache/disk_cache.h for the public interface. | 5 // See net/disk_cache/disk_cache.h for the public interface. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_STORAGE_BLOCK_H__ | 7 #ifndef NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| 8 #define NET_DISK_CACHE_STORAGE_BLOCK_H__ | 8 #define NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 #include "net/disk_cache/addr.h" | 11 #include "net/disk_cache/addr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // Deletes the data, even if it was modified and not saved. This object must | 48 // Deletes the data, even if it was modified and not saved. This object must |
| 49 // own the memory buffer (it cannot be shared). | 49 // own the memory buffer (it cannot be shared). |
| 50 void Discard(); | 50 void Discard(); |
| 51 | 51 |
| 52 // Stops sharing the data with another object. | 52 // Stops sharing the data with another object. |
| 53 void StopSharingData(); | 53 void StopSharingData(); |
| 54 | 54 |
| 55 // Sets the object to lazily save the in-memory data on destruction. | 55 // Sets the object to lazily save the in-memory data on destruction. |
| 56 void set_modified(); | 56 void set_modified(); |
| 57 | 57 |
| 58 // Forgets that the data was modified, so it's not lazily saved. |
| 59 void clear_modified(); |
| 60 |
| 58 // Gets a pointer to the internal storage (allocates storage if needed). | 61 // Gets a pointer to the internal storage (allocates storage if needed). |
| 59 T* Data(); | 62 T* Data(); |
| 60 | 63 |
| 61 // Returns true if there is data associated with this object. | 64 // Returns true if there is data associated with this object. |
| 62 bool HasData() const; | 65 bool HasData() const; |
| 63 | 66 |
| 64 // Returns true if the internal hash is correct. | 67 // Returns true if the internal hash is correct. |
| 65 bool VerifyHash() const; | 68 bool VerifyHash() const; |
| 66 | 69 |
| 67 // Returns true if this object owns the data buffer, false if it is shared. | 70 // Returns true if this object owns the data buffer, false if it is shared. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 87 | 90 |
| 88 DISALLOW_COPY_AND_ASSIGN(StorageBlock); | 91 DISALLOW_COPY_AND_ASSIGN(StorageBlock); |
| 89 }; | 92 }; |
| 90 | 93 |
| 91 typedef StorageBlock<EntryStore> CacheEntryBlock; | 94 typedef StorageBlock<EntryStore> CacheEntryBlock; |
| 92 typedef StorageBlock<RankingsNode> CacheRankingsBlock; | 95 typedef StorageBlock<RankingsNode> CacheRankingsBlock; |
| 93 | 96 |
| 94 } // namespace disk_cache | 97 } // namespace disk_cache |
| 95 | 98 |
| 96 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ | 99 #endif // NET_DISK_CACHE_STORAGE_BLOCK_H__ |
| OLD | NEW |