summaryrefslogtreecommitdiff
path: root/chromium/net/disk_cache/blockfile/backend_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/disk_cache/blockfile/backend_impl.cc')
-rw-r--r--chromium/net/disk_cache/blockfile/backend_impl.cc48
1 files changed, 22 insertions, 26 deletions
diff --git a/chromium/net/disk_cache/blockfile/backend_impl.cc b/chromium/net/disk_cache/blockfile/backend_impl.cc
index b231b7caa42..365080f7ebe 100644
--- a/chromium/net/disk_cache/blockfile/backend_impl.cc
+++ b/chromium/net/disk_cache/blockfile/backend_impl.cc
@@ -15,7 +15,7 @@
#include "base/hash/hash.h"
#include "base/lazy_instance.h"
#include "base/location.h"
-#include "base/message_loop/message_loop.h"
+#include "base/message_loop/message_pump_type.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/rand_util.h"
@@ -118,7 +118,7 @@ class CacheThread : public base::Thread {
public:
CacheThread() : base::Thread("CacheThread_BlockFile") {
CHECK(
- StartWithOptions(base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
+ StartWithOptions(base::Thread::Options(base::MessagePumpType::IO, 0)));
}
~CacheThread() override {
@@ -1244,31 +1244,29 @@ int32_t BackendImpl::GetEntryCount() const {
return not_deleted;
}
-net::Error BackendImpl::OpenOrCreateEntry(const std::string& key,
- net::RequestPriority request_priority,
- EntryWithOpened* entry_struct,
- CompletionOnceCallback callback) {
+EntryResult BackendImpl::OpenOrCreateEntry(
+ const std::string& key,
+ net::RequestPriority request_priority,
+ EntryResultCallback callback) {
DCHECK(!callback.is_null());
- background_queue_.OpenOrCreateEntry(key, entry_struct, std::move(callback));
- return net::ERR_IO_PENDING;
+ background_queue_.OpenOrCreateEntry(key, std::move(callback));
+ return EntryResult::MakeError(net::ERR_IO_PENDING);
}
-net::Error BackendImpl::OpenEntry(const std::string& key,
- net::RequestPriority request_priority,
- Entry** entry,
- CompletionOnceCallback callback) {
+EntryResult BackendImpl::OpenEntry(const std::string& key,
+ net::RequestPriority request_priority,
+ EntryResultCallback callback) {
DCHECK(!callback.is_null());
- background_queue_.OpenEntry(key, entry, std::move(callback));
- return net::ERR_IO_PENDING;
+ background_queue_.OpenEntry(key, std::move(callback));
+ return EntryResult::MakeError(net::ERR_IO_PENDING);
}
-net::Error BackendImpl::CreateEntry(const std::string& key,
- net::RequestPriority request_priority,
- Entry** entry,
- CompletionOnceCallback callback) {
+EntryResult BackendImpl::CreateEntry(const std::string& key,
+ net::RequestPriority request_priority,
+ EntryResultCallback callback) {
DCHECK(!callback.is_null());
- background_queue_.CreateEntry(key, entry, std::move(callback));
- return net::ERR_IO_PENDING;
+ background_queue_.CreateEntry(key, std::move(callback));
+ return EntryResult::MakeError(net::ERR_IO_PENDING);
}
net::Error BackendImpl::DoomEntry(const std::string& key,
@@ -1324,13 +1322,11 @@ class BackendImpl::IteratorImpl : public Backend::Iterator {
background_queue_->EndEnumeration(std::move(iterator_));
}
- net::Error OpenNextEntry(Entry** next_entry,
- net::CompletionOnceCallback callback) override {
+ EntryResult OpenNextEntry(EntryResultCallback callback) override {
if (!background_queue_)
- return net::ERR_FAILED;
- background_queue_->OpenNextEntry(iterator_.get(), next_entry,
- std::move(callback));
- return net::ERR_IO_PENDING;
+ return EntryResult::MakeError(net::ERR_FAILED);
+ background_queue_->OpenNextEntry(iterator_.get(), std::move(callback));
+ return EntryResult::MakeError(net::ERR_IO_PENDING);
}
private: