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

Unified Diff: net/disk_cache/v3/sparse_control_v3.h

Issue 14991008: Disk cache: Add base files for implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: rebase Created 7 years, 6 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/v3/eviction_v3.cc ('k') | net/disk_cache/v3/sparse_control_v3.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/v3/sparse_control_v3.h
===================================================================
--- net/disk_cache/v3/sparse_control_v3.h (revision 0)
+++ net/disk_cache/v3/sparse_control_v3.h (working copy)
@@ -44,11 +44,6 @@
explicit SparseControl(EntryImpl* entry);
~SparseControl();
- // Initializes the object for the current entry. If this entry already stores
- // sparse data, or can be used to do it, it updates the relevant information
- // on disk and returns net::OK. Otherwise it returns a net error code.
- int Init();
-
// Performs a quick test to see if the entry is sparse or not, without
// generating disk IO (so the answer provided is only a best effort).
bool CouldBeSparse() const;
@@ -77,6 +72,11 @@
static void DeleteChildren(EntryImpl* entry);
private:
+ // Initializes the object for the current entry. If this entry already stores
+ // sparse data, or can be used to do it, it updates the relevant information
+ // on disk and returns net::OK. Otherwise it returns a net error code.
+ int Init();
+
// Creates a new sparse entry or opens an aready created entry from disk.
// These methods just read / write the required info from disk for the current
// entry, and verify that everything is correct. The return value is a net
@@ -89,14 +89,26 @@
// stored by that child.
bool OpenChild();
void CloseChild();
+
+ // Continues the current operation (open) without a current child.
+ bool ContinueWithoutChild(const std::string& key);
+
+ // Writes to disk the tracking information for this entry.
+ void WriteSparseData();
+
+ // Performs a single operation with the current child. Returns true when we
+ // should move on to the next child and false when we should interrupt our
+ // work.
+ bool DoChildIO();
+
+ // Performs the required work after a single IO operations finishes.
+ void DoChildIOCompleted(int result);
+
std::string GenerateChildKey();
// Deletes the current child and continues the current operation (open).
bool KillChildAndContinue(const std::string& key, bool fatal);
- // Continues the current operation (open) without a current child.
- bool ContinueWithoutChild(const std::string& key);
-
// Returns true if the required child is tracked by the parent entry, i.e. it
// was already created.
bool ChildPresent();
@@ -105,9 +117,6 @@
// starts or stops tracking this child.
void SetChildBit(bool value);
- // Writes to disk the tracking information for this entry.
- void WriteSparseData();
-
// Verify that the range to be accessed for the current child is appropriate.
// Returns false if an error is detected or there is no need to perform the
// current IO operation (for instance if the required range is not stored by
@@ -125,27 +134,16 @@
// Initializes the sparse info for the current child.
void InitChildData();
- // Iterates through all the children needed to complete the current operation.
- void DoChildrenIO();
-
- // Performs a single operation with the current child. Returns true when we
- // should move on to the next child and false when we should interrupt our
- // work.
- bool DoChildIO();
-
// Performs the required work for GetAvailableRange for one child.
int DoGetAvailableRange();
- // Performs the required work after a single IO operations finishes.
- void DoChildIOCompleted(int result);
-
- // Invoked by the callback of asynchronous operations.
- void OnChildIOCompleted(int result);
-
// Reports to the user that we are done.
void DoUserCallback();
void DoAbortCallbacks();
+ // Invoked by the callback of asynchronous operations.
+ void OnChildIOCompleted(int result);
+
EntryImpl* entry_; // The sparse entry.
EntryImpl* child_; // The current child entry.
SparseOperation operation_;
« no previous file with comments | « net/disk_cache/v3/eviction_v3.cc ('k') | net/disk_cache/v3/sparse_control_v3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698