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

Unified Diff: net/disk_cache/in_flight_backend_io.cc

Issue 8832006: Reverts a commit that caused ASAN failures, and 2 dependent commits. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/in_flight_backend_io.h ('k') | net/disk_cache/mem_backend_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/in_flight_backend_io.cc
diff --git a/net/disk_cache/in_flight_backend_io.cc b/net/disk_cache/in_flight_backend_io.cc
index 25d39a5bbf89746aa5a01ec5627b20b53bc083c3..b99d62760a5c29eb4bf40f3e76ff6fec1dacbf32 100644
--- a/net/disk_cache/in_flight_backend_io.cc
+++ b/net/disk_cache/in_flight_backend_io.cc
@@ -16,21 +16,7 @@ namespace disk_cache {
BackendIO::BackendIO(InFlightIO* controller, BackendImpl* backend,
net::OldCompletionCallback* callback)
- : BackgroundIO(controller),
- backend_(backend),
- old_callback_(callback),
- operation_(OP_NONE),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- my_callback_(this, &BackendIO::OnIOComplete)) {
- start_time_ = base::TimeTicks::Now();
-}
-
-BackendIO::BackendIO(InFlightIO* controller, BackendImpl* backend,
- const net::CompletionCallback& callback)
- : BackgroundIO(controller),
- backend_(backend),
- old_callback_(NULL),
- callback_(callback),
+ : BackgroundIO(controller), backend_(backend), callback_(callback),
operation_(OP_NONE),
ALLOW_THIS_IN_INITIALIZER_LIST(
my_callback_(this, &BackendIO::OnIOComplete)) {
@@ -327,13 +313,6 @@ void InFlightBackendIO::OpenEntry(const std::string& key, Entry** entry,
PostOperation(operation);
}
-void InFlightBackendIO::OpenEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->OpenEntry(key, entry);
- PostOperation(operation);
-}
-
void InFlightBackendIO::CreateEntry(const std::string& key, Entry** entry,
OldCompletionCallback* callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
@@ -341,13 +320,6 @@ void InFlightBackendIO::CreateEntry(const std::string& key, Entry** entry,
PostOperation(operation);
}
-void InFlightBackendIO::CreateEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->CreateEntry(key, entry);
- PostOperation(operation);
-}
-
void InFlightBackendIO::DoomEntry(const std::string& key,
OldCompletionCallback* callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
@@ -361,13 +333,6 @@ void InFlightBackendIO::DoomAllEntries(OldCompletionCallback* callback) {
PostOperation(operation);
}
-void InFlightBackendIO::DoomAllEntries(
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->DoomAllEntries();
- PostOperation(operation);
-}
-
void InFlightBackendIO::DoomEntriesBetween(const base::Time initial_time,
const base::Time end_time,
OldCompletionCallback* callback) {
@@ -376,14 +341,6 @@ void InFlightBackendIO::DoomEntriesBetween(const base::Time initial_time,
PostOperation(operation);
}
-void InFlightBackendIO::DoomEntriesBetween(const base::Time initial_time,
- const base::Time end_time,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->DoomEntriesBetween(initial_time, end_time);
- PostOperation(operation);
-}
-
void InFlightBackendIO::DoomEntriesSince(const base::Time initial_time,
OldCompletionCallback* callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
@@ -398,13 +355,6 @@ void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry,
PostOperation(operation);
}
-void InFlightBackendIO::OpenNextEntry(void** iter, Entry** next_entry,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->OpenNextEntry(iter, next_entry);
- PostOperation(operation);
-}
-
void InFlightBackendIO::OpenPrevEntry(void** iter, Entry** prev_entry,
OldCompletionCallback* callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
@@ -456,14 +406,6 @@ void InFlightBackendIO::ReadData(EntryImpl* entry, int index, int offset,
PostOperation(operation);
}
-void InFlightBackendIO::ReadData(EntryImpl* entry, int index, int offset,
- net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->ReadData(entry, index, offset, buf, buf_len);
- PostOperation(operation);
-}
-
void InFlightBackendIO::WriteData(EntryImpl* entry, int index, int offset,
net::IOBuffer* buf, int buf_len,
bool truncate,
@@ -473,15 +415,6 @@ void InFlightBackendIO::WriteData(EntryImpl* entry, int index, int offset,
PostOperation(operation);
}
-void InFlightBackendIO::WriteData(EntryImpl* entry, int index, int offset,
- net::IOBuffer* buf, int buf_len,
- bool truncate,
- const net::CompletionCallback& callback) {
- scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
- operation->WriteData(entry, index, offset, buf, buf_len, truncate);
- PostOperation(operation);
-}
-
void InFlightBackendIO::ReadSparseData(EntryImpl* entry, int64 offset,
net::IOBuffer* buf, int buf_len,
OldCompletionCallback* callback) {
@@ -531,10 +464,8 @@ void InFlightBackendIO::OnOperationComplete(BackgroundIO* operation,
CACHE_UMA(TIMES, "TotalIOTime", 0, op->ElapsedTime());
}
- if (op->old_callback() && (!cancel || op->IsEntryOperation()))
- op->old_callback()->Run(op->result());
- else if (!op->callback().is_null() && (!cancel || op->IsEntryOperation()))
- op->callback().Run(op->result());
+ if (op->callback() && (!cancel || op->IsEntryOperation()))
+ op->callback()->Run(op->result());
}
void InFlightBackendIO::PostOperation(BackendIO* operation) {
« no previous file with comments | « net/disk_cache/in_flight_backend_io.h ('k') | net/disk_cache/mem_backend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698