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

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

Issue 14130015: Support overlapping operations on the SimpleEntryImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a bug in GetDataSize() Created 7 years, 8 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 7b898cf4881f68f2c019ccd14c065c7261b18796..3a4040a8df56d273727cdbe2c3794491a063b56b 100644
--- a/net/disk_cache/simple/simple_entry_impl.h
+++ b/net/disk_cache/simple/simple_entry_impl.h
@@ -5,6 +5,7 @@
#ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_
#define NET_DISK_CACHE_SIMPLE_SIMPLE_ENTRY_IMPL_H_
+#include <queue>
#include <string>
#include "base/files/file_path.h"
@@ -45,6 +46,9 @@ class SimpleEntryImpl : public Entry {
const std::string& key,
const CompletionCallback& callback);
+ std::string key() const { return key_; }
+ void RunNextOperationIfNeeded();
+
// From Entry:
virtual void Doom() OVERRIDE;
virtual void Close() OVERRIDE;
@@ -57,6 +61,7 @@ class SimpleEntryImpl : public Entry {
net::IOBuffer* buf,
int buf_len,
const CompletionCallback& callback) OVERRIDE;
+
virtual int WriteData(int index,
int offset,
net::IOBuffer* buf,
@@ -85,6 +90,22 @@ class SimpleEntryImpl : public Entry {
virtual ~SimpleEntryImpl();
+ void DoomInternal();
+
+ void ReadDataInternal(int index,
+ int offset,
+ scoped_refptr<net::IOBuffer> buf,
+ int buf_len,
+ const CompletionCallback& callback);
+ void WriteDataInternal(int index,
+ int offset,
+ scoped_refptr<net::IOBuffer> buf,
+ int buf_len,
+ const CompletionCallback& callback,
+ bool truncate);
+
+
+
// Called after a SimpleSynchronousEntry has completed CreateEntry() or
// OpenEntry(). Constructs the new SimpleEntryImpl (if |result| is net::OK)
// and passes it back to the caller via |out_entry|. Also runs
@@ -141,6 +162,10 @@ class SimpleEntryImpl : public Entry {
// threads to access the |synchronous_entry_| simultaneously.
bool synchronous_entry_in_use_by_worker_;
+ bool read_only_operation_;
+ std::queue<base::Closure> operations_;
+
+
base::WeakPtr<SimpleIndex> index_;
};
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_entry_impl.cc » ('j') | net/disk_cache/simple/simple_entry_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698