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

Unified Diff: net/disk_cache/simple/simple_entry_impl.h

Issue 12226095: Make synchronous methods on disk_cache::SimpleEntryImpl() reentrant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: net/disk_cache/simple/simple_entry_impl.h
diff --git a/net/disk_cache/simple/simple_entry_impl.h b/net/disk_cache/simple/simple_entry_impl.h
index a6f642eb10c83d048fdb2a6c68f310d3287155e6..579b608ccd6ecedef771ef9275c001eb6bfd180d 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -7,9 +7,11 @@
#include <string>
+#include "base/file_path.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "net/disk_cache/disk_cache.h"
+#include "net/disk_cache/simple/simple_disk_format.h"
namespace net {
class IOBuffer;
@@ -90,12 +92,22 @@ class SimpleEntryImpl : public Entry {
SimpleSynchronousEntry* ReleaseSynchronousEntry();
// Sets the current |synchronous_entry_|. Called on completion of worker pool
- // IO to permit new operations to be launched.
+ // IO to permit new operations to be launched. Must be called on construction.
void SetSynchronousEntry(SimpleSynchronousEntry* synchronous_entry);
base::ThreadChecker thread_checker_;
base::WeakPtrFactory<SimpleEntryImpl> weak_ptr_factory_;
- std::string key_;
+
+ // |path_| and |key_| are copied from the synchronous entry on construction,
+ // and never updated as they are const.
+ const base::FilePath path_;
+ const std::string key_;
+
+ // |last_used_|, |last_modified_| and |data_size_| are copied from the
+ // synchronous entry at the completion of each item of asynchronous IO.
+ base::Time last_used_;
felipeg 2013/02/12 14:47:48 I don't like the fact that we are keeping a copy o
+ base::Time last_modified_;
+ int32 data_size_[kSimpleEntryFileCount];
// The |synchronous_entry_| is the worker thread object that performs IO on
// entries. It is set to NULL while operations are pending to prevent unsafe

Powered by Google App Engine
This is Rietveld 408576698