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

Unified Diff: net/disk_cache/simple/simple_entry_operation.cc

Issue 22859060: Fix race condition for non-open/create operations happening after a doom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 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/simple/simple_entry_operation.h ('k') | net/disk_cache/simple/simple_synchronous_entry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_entry_operation.cc
diff --git a/net/disk_cache/simple/simple_entry_operation.cc b/net/disk_cache/simple/simple_entry_operation.cc
index 81d5f7c888b1d020bfa23d601e89dae0e4aa8f56..d4e76082084d80183f5baf55176b6313e17d89f3 100644
--- a/net/disk_cache/simple/simple_entry_operation.cc
+++ b/net/disk_cache/simple/simple_entry_operation.cc
@@ -28,7 +28,7 @@ SimpleEntryOperation::SimpleEntryOperation(const SimpleEntryOperation& other)
SimpleEntryOperation::~SimpleEntryOperation() {}
-// Static.
+// static
SimpleEntryOperation SimpleEntryOperation::OpenOperation(
SimpleEntryImpl* entry,
bool have_index,
@@ -48,7 +48,7 @@ SimpleEntryOperation SimpleEntryOperation::OpenOperation(
false);
}
-// Static.
+// static
SimpleEntryOperation SimpleEntryOperation::CreateOperation(
SimpleEntryImpl* entry,
bool have_index,
@@ -68,7 +68,7 @@ SimpleEntryOperation SimpleEntryOperation::CreateOperation(
false);
}
-// Static.
+// static
SimpleEntryOperation SimpleEntryOperation::CloseOperation(
SimpleEntryImpl* entry) {
return SimpleEntryOperation(entry,
@@ -85,7 +85,7 @@ SimpleEntryOperation SimpleEntryOperation::CloseOperation(
false);
}
-// Static.
+// static
SimpleEntryOperation SimpleEntryOperation::ReadOperation(
SimpleEntryImpl* entry,
int index,
@@ -108,7 +108,7 @@ SimpleEntryOperation SimpleEntryOperation::ReadOperation(
alone_in_queue);
}
-// Static.
+// static
SimpleEntryOperation SimpleEntryOperation::WriteOperation(
SimpleEntryImpl* entry,
int index,
@@ -132,6 +132,33 @@ SimpleEntryOperation SimpleEntryOperation::WriteOperation(
false);
}
+// static
+SimpleEntryOperation SimpleEntryOperation::DoomOperation(
+ SimpleEntryImpl* entry,
+ const CompletionCallback& callback) {
+ net::IOBuffer* const buf = NULL;
+ Entry** const out_entry = NULL;
+ const int offset = 0;
+ const int length = 0;
+ const bool have_index = false;
+ const int index = 0;
+ const bool truncate = false;
+ const bool optimistic = false;
+ const bool alone_in_queue = false;
+ return SimpleEntryOperation(entry,
+ buf,
+ callback,
+ out_entry,
+ offset,
+ length,
+ TYPE_DOOM,
+ have_index,
+ index,
+ truncate,
+ optimistic,
+ alone_in_queue);
+}
+
bool SimpleEntryOperation::ConflictsWith(
const SimpleEntryOperation& other_op) const {
if (type_ != TYPE_READ && type_ != TYPE_WRITE)
« no previous file with comments | « net/disk_cache/simple/simple_entry_operation.h ('k') | net/disk_cache/simple/simple_synchronous_entry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698