| Index: net/disk_cache/simple/simple_backend_impl.h
|
| diff --git a/net/disk_cache/simple/simple_backend_impl.h b/net/disk_cache/simple/simple_backend_impl.h
|
| index 462a101f96147cf8dd7b99165a0c78dc96df8cc5..ce6a757e4cf68959d38741614477155130c12a38 100644
|
| --- a/net/disk_cache/simple/simple_backend_impl.h
|
| +++ b/net/disk_cache/simple/simple_backend_impl.h
|
| @@ -34,6 +34,10 @@ namespace disk_cache {
|
| // files.
|
| // See http://www.chromium.org/developers/design-documents/network-stack/disk-cache/very-simple-backend
|
| //
|
| +// The SimpleBackendImpl provides safe iteration; mutating entries during
|
| +// iteration cannot cause a crash. It is undefined whether entries created or
|
| +// destroyed during the iteration will be included in the iteration.
|
| +//
|
| // The non-static functions below must be called on the IO thread unless
|
| // otherwise stated.
|
|
|
| @@ -97,14 +101,15 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
|
| const CompletionCallback& callback) OVERRIDE;
|
| virtual int DoomEntriesSince(base::Time initial_time,
|
| const CompletionCallback& callback) OVERRIDE;
|
| - virtual int OpenNextEntry(void** iter, Entry** next_entry,
|
| - const CompletionCallback& callback) OVERRIDE;
|
| - virtual void EndEnumeration(void** iter) OVERRIDE;
|
| + virtual scoped_ptr<Iterator> CreateIterator() OVERRIDE;
|
| virtual void GetStats(
|
| std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE;
|
| virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
|
|
|
| private:
|
| + class SimpleIterator;
|
| + friend class SimpleIterator;
|
| +
|
| typedef base::hash_map<uint64, SimpleEntryImpl*> EntryMap;
|
|
|
| typedef base::Callback<void(base::Time mtime, uint64 max_size, int result)>
|
| @@ -155,14 +160,6 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
|
| // which is very important to prevent races in DoomEntries() above.
|
| int DoomEntryFromHash(uint64 entry_hash, const CompletionCallback & callback);
|
|
|
| - // Called when the index is initilized to find the next entry in the iterator
|
| - // |iter|. If there are no more hashes in the iterator list, net::ERR_FAILED
|
| - // is returned. Otherwise, calls OpenEntryFromHash.
|
| - void GetNextEntryInIterator(void** iter,
|
| - Entry** next_entry,
|
| - const CompletionCallback& callback,
|
| - int error_code);
|
| -
|
| // Called when we tried to open an entry with hash alone. When a blank entry
|
| // has been created and filled in with information from the disk - based on a
|
| // hash alone - this checks that a duplicate active entry was not created
|
| @@ -181,14 +178,6 @@ class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
|
| const CompletionCallback& callback,
|
| int error_code);
|
|
|
| - // Called at the end of the asynchronous operation triggered by
|
| - // OpenEntryFromHash. Makes sure to continue iterating if the open entry was
|
| - // not a success.
|
| - void CheckIterationReturnValue(void** iter,
|
| - Entry** entry,
|
| - const CompletionCallback& callback,
|
| - int error_code);
|
| -
|
| // A callback thunk used by DoomEntries to clear the |entries_pending_doom_|
|
| // after a mass doom.
|
| void DoomEntriesComplete(scoped_ptr<std::vector<uint64> > entry_hashes,
|
|
|