summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/sparse_control.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 18:00:56 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-13 18:00:56 +0000
commitfb2622f6816ed20ffd8a35994f7372b67613ba92 (patch)
tree2aa33016e72361032264904916c4374e4784fd11 /net/disk_cache/sparse_control.cc
parentea9a4ee67732b90e834def1cf98be1d047a93063 (diff)
downloadchromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.zip
chromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.tar.gz
chromium_src-fb2622f6816ed20ffd8a35994f7372b67613ba92.tar.bz2
Disk cache: Switch the disk cache to use the cache_thread.
Add an InFlightBackendIO class that handles posting of cacheoperations back and forth between the IO thread and the cachethread. BUG=26730 TEST=unit tests Review URL: http://codereview.chromium.org/2945002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52185 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/sparse_control.cc')
-rw-r--r--net/disk_cache/sparse_control.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc
index 2d9d3c1..884a1b7 100644
--- a/net/disk_cache/sparse_control.cc
+++ b/net/disk_cache/sparse_control.cc
@@ -126,7 +126,7 @@ void ChildrenDeleter::DeleteChildren() {
return Release();
}
std::string child_name = GenerateChildName(name_, signature_, child_id);
- backend_->DoomEntry(child_name);
+ backend_->SyncDoomEntry(child_name);
children_map_.Set(child_id, false);
// Post a task to delete the next child.
@@ -373,7 +373,7 @@ bool SparseControl::OpenChild() {
CloseChild();
}
- // Se if we are tracking this child.
+ // See if we are tracking this child.
if (!ChildPresent())
return ContinueWithoutChild(key);
@@ -418,7 +418,7 @@ void SparseControl::CloseChild() {
NULL, false);
if (rv != sizeof(child_data_))
DLOG(ERROR) << "Failed to save child data";
- child_->Close();
+ child_->Release();
child_ = NULL;
}
@@ -430,8 +430,8 @@ std::string SparseControl::GenerateChildKey() {
// We are deleting the child because something went wrong.
bool SparseControl::KillChildAndContinue(const std::string& key, bool fatal) {
SetChildBit(false);
- child_->Doom();
- child_->Close();
+ child_->DoomImpl();
+ child_->Release();
child_ = NULL;
if (fatal) {
result_ = net::ERR_CACHE_READ_FAILURE;
@@ -617,12 +617,12 @@ bool SparseControl::DoChildIO() {
int rv = 0;
switch (operation_) {
case kReadOperation:
- rv = child_->ReadData(kSparseData, child_offset_, user_buf_, child_len_,
- callback);
+ rv = child_->ReadDataImpl(kSparseData, child_offset_, user_buf_,
+ child_len_, callback);
break;
case kWriteOperation:
- rv = child_->WriteData(kSparseData, child_offset_, user_buf_, child_len_,
- callback, false);
+ rv = child_->WriteDataImpl(kSparseData, child_offset_, user_buf_,
+ child_len_, callback, false);
break;
case kGetRangeOperation:
rv = DoGetAvailableRange();