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

Side by Side Diff: net/disk_cache/blockfile/entry_impl.h

Issue 1304363013: Add a size estimation mechanism to StoragePartitionHttpCacheDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support null max time. Created 5 years, 3 months 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
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_BLOCKFILE_ENTRY_IMPL_H_ 5 #ifndef NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_
6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ 6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/disk_cache/blockfile/disk_format.h" 9 #include "net/disk_cache/blockfile/disk_format.h"
10 #include "net/disk_cache/blockfile/storage_block-inl.h" 10 #include "net/disk_cache/blockfile/storage_block-inl.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // an end event to be logged on destruction. The EntryImpl must have its key 139 // an end event to be logged on destruction. The EntryImpl must have its key
140 // initialized before this is called. |created| is true if the Entry was 140 // initialized before this is called. |created| is true if the Entry was
141 // created rather than opened. 141 // created rather than opened.
142 void BeginLogging(net::NetLog* net_log, bool created); 142 void BeginLogging(net::NetLog* net_log, bool created);
143 143
144 const net::BoundNetLog& net_log() const; 144 const net::BoundNetLog& net_log() const;
145 145
146 // Returns the number of blocks needed to store an EntryStore. 146 // Returns the number of blocks needed to store an EntryStore.
147 static int NumBlocksForEntry(int key_size); 147 static int NumBlocksForEntry(int key_size);
148 148
149 // The total size of this entry; sum of |GetDataSize| for all streams.
150 int GetEntrySize() const;
151
149 // Entry interface. 152 // Entry interface.
150 void Doom() override; 153 void Doom() override;
151 void Close() override; 154 void Close() override;
152 std::string GetKey() const override; 155 std::string GetKey() const override;
153 base::Time GetLastUsed() const override; 156 base::Time GetLastUsed() const override;
154 base::Time GetLastModified() const override; 157 base::Time GetLastModified() const override;
155 int32 GetDataSize(int index) const override; 158 int32 GetDataSize(int index) const override;
156 int ReadData(int index, 159 int ReadData(int index,
157 int offset, 160 int offset,
158 IOBuffer* buf, 161 IOBuffer* buf,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. 284 scoped_ptr<SparseControl> sparse_; // Support for sparse entries.
282 285
283 net::BoundNetLog net_log_; 286 net::BoundNetLog net_log_;
284 287
285 DISALLOW_COPY_AND_ASSIGN(EntryImpl); 288 DISALLOW_COPY_AND_ASSIGN(EntryImpl);
286 }; 289 };
287 290
288 } // namespace disk_cache 291 } // namespace disk_cache
289 292
290 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ 293 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698