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

Unified Diff: net/disk_cache/sparse_control.h

Issue 256090: Disk cache: Add a method to cancel pending sparse operations.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/mem_entry_impl.cc ('k') | net/disk_cache/sparse_control.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/sparse_control.h
===================================================================
--- net/disk_cache/sparse_control.h (revision 28049)
+++ net/disk_cache/sparse_control.h (working copy)
@@ -6,6 +6,7 @@
#define NET_DISK_CACHE_SPARSE_CONTROL_H_
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -63,6 +64,14 @@
// Implements Entry::GetAvailableRange().
int GetAvailableRange(int64 offset, int len, int64* start);
+ // Cancels the current sparse operation (if any).
+ void CancelIO();
+
+ // Returns OK if the entry can be used for new IO or ERR_IO_PENDING if we are
+ // busy. If the entry is busy, we'll invoke the callback when we are ready
+ // again. See disk_cache::Entry::ReadyToUse() for more info.
+ int ReadyToUse(net::CompletionCallback* completion_callback);
+
// Deletes the children entries of |entry|.
static void DeleteChildren(EntryImpl* entry);
@@ -134,6 +143,7 @@
// Reports to the user that we are done.
void DoUserCallback();
+ void DoAbortCallbacks();
EntryImpl* entry_; // The sparse entry.
Entry* child_; // The current child entry.
@@ -142,6 +152,7 @@
bool finished_;
bool init_;
bool range_found_; // True if GetAvailableRange found something.
+ bool abort_; // True if we should abort the current operation ASAP.
SparseHeader sparse_header_; // Data about the children of entry_.
Bitmap children_map_; // The actual bitmap of children.
@@ -150,6 +161,7 @@
net::CompletionCallbackImpl<SparseControl> child_callback_;
net::CompletionCallback* user_callback_;
+ std::vector<net::CompletionCallback*> abort_callbacks_;
int64 offset_; // Current sparse offset.
scoped_refptr<net::ReusedIOBuffer> user_buf_;
int buf_len_; // Bytes to read or write.
« no previous file with comments | « net/disk_cache/mem_entry_impl.cc ('k') | net/disk_cache/sparse_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698