summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/in_flight_backend_io.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 22:15:27 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-04 22:15:27 +0000
commit9ee9cd8145136bfa422c1213eaeecb4882581698 (patch)
treeae38220e2f4416ef0af1faa01653d44b05214e7b /net/disk_cache/in_flight_backend_io.h
parent60a50ad4551779947cf53f80d33d3da27e51e04b (diff)
downloadchromium_src-9ee9cd8145136bfa422c1213eaeecb4882581698.zip
chromium_src-9ee9cd8145136bfa422c1213eaeecb4882581698.tar.gz
chromium_src-9ee9cd8145136bfa422c1213eaeecb4882581698.tar.bz2
Disk cache: Remove the queue for backend operations and
change the queue of entry operations so that the operation that is posted is kept on the list. BUG=54338 TEST=net_unittests Review URL: http://codereview.chromium.org/3744007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65118 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/in_flight_backend_io.h')
-rw-r--r--net/disk_cache/in_flight_backend_io.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/net/disk_cache/in_flight_backend_io.h b/net/disk_cache/in_flight_backend_io.h
index 5eba131..ca239dd 100644
--- a/net/disk_cache/in_flight_backend_io.h
+++ b/net/disk_cache/in_flight_backend_io.h
@@ -37,7 +37,8 @@ class BackendIO : public BackgroundIO {
net::CompletionCallback* callback() { return callback_; }
- void ReleaseEntry();
+ // Grabs an extra reference of entry_.
+ void ReferenceEntry();
// Returns the time that has passed since the operation was created.
base::TimeDelta ElapsedTime() const;
@@ -72,12 +73,10 @@ class BackendIO : public BackgroundIO {
private:
// There are two types of operations to proxy: regular backend operations are
- // queued so that we don't have more than one operation going on at the same
- // time (for instance opening an entry and creating the same entry). On the
- // other hand, operations targeted to a given entry can be long lived and
- // support multiple simultaneous users (multiple reads or writes to the same
- // entry), so they are not queued, just posted to the worker thread as they
- // come.
+ // executed sequentially (queued by the message loop). On the other hand,
+ // operations targeted to a given entry can be long lived and support multiple
+ // simultaneous users (multiple reads or writes to the same entry), and they
+ // are subject to throttling, so we keep an explicit queue.
enum Operation {
OP_NONE = 0,
OP_INIT,
@@ -200,13 +199,13 @@ class InFlightBackendIO : public InFlightIO {
typedef std::list<scoped_refptr<BackendIO> > OperationList;
void QueueOperation(BackendIO* operation);
void PostOperation(BackendIO* operation);
- void PostQueuedOperation(OperationList* from_list);
- void QueueOperationToList(BackendIO* operation, OperationList* list);
+ void PostQueuedOperation();
+ void PostAllQueuedOperations();
+ bool RemoveFirstQueuedOperation(BackendIO* operation);
BackendImpl* backend_;
scoped_refptr<base::MessageLoopProxy> background_thread_;
- OperationList pending_ops_; // The list of operations to be posted.
- OperationList pending_entry_ops_; // Entry (async) operations to be posted.
+ OperationList pending_ops_; // Entry (async) operations to be posted.
bool queue_entry_ops_; // True if we are queuing entry (async) operations.
DISALLOW_COPY_AND_ASSIGN(InFlightBackendIO);