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

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: remove bad blank line 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
« no previous file with comments | « net/disk_cache/simple/simple_disk_format.h ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b12a72e2dc869d7742fbbd20b2ad4392f5a3eb95..350e59d2f08e6e32f2b0dfc573215aacf267aa3d 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;
@@ -95,9 +97,25 @@ class SimpleEntryImpl : public Entry {
SimpleSynchronousEntry* sync_entry,
int result);
+ // Called on construction and also after the completion of asynchronous IO to
+ // initialize the IO thread copies of data returned by synchronous accessor
+ // functions. Copies data from |synchronous_entry_| into |this|, so that
+ // values can be returned during our next IO operation.
+ void SetSynchronousData();
rvargas (doing something else) 2013/02/13 03:10:36 I would suggest a different name because it's star
+
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_;
+ base::Time last_modified_;
+ int32 data_size_[kSimpleEntryFileCount];
// The |synchronous_entry_| is the worker thread object that performs IO on
// entries.
« no previous file with comments | « net/disk_cache/simple/simple_disk_format.h ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698