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

Unified Diff: net/tools/dump_cache/cache_dumper.cc

Issue 2869005: Disk Cache: Remove deprecated methods from the disk cache interface.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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/tools/dump_cache/cache_dumper.h ('k') | net/tools/dump_cache/upgrade.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/dump_cache/cache_dumper.cc
===================================================================
--- net/tools/dump_cache/cache_dumper.cc (revision 49819)
+++ net/tools/dump_cache/cache_dumper.cc (working copy)
@@ -5,15 +5,17 @@
#include "net/tools/dump_cache/cache_dumper.h"
#include "net/base/io_buffer.h"
+#include "net/base/net_errors.h"
#include "net/disk_cache/entry_impl.h"
#include "net/http/http_cache.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/tools/dump_cache/url_to_filename_encoder.h"
-bool CacheDumper::CreateEntry(const std::string& key,
- disk_cache::Entry** entry) {
- return cache_->CreateEntry(key, entry);
+int CacheDumper::CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ net::CompletionCallback* callback) {
+ return cache_->CreateEntry(key, entry, callback);
}
int CacheDumper::WriteEntry(disk_cache::Entry* entry, int index, int offset,
@@ -61,8 +63,9 @@
#endif
}
-bool DiskDumper::CreateEntry(const std::string& key,
- disk_cache::Entry** entry) {
+int DiskDumper::CreateEntry(const std::string& key,
+ disk_cache::Entry** entry,
+ net::CompletionCallback* callback) {
FilePath path(path_);
// The URL may not start with a valid protocol; search for it.
int urlpos = key.find("http");
@@ -94,10 +97,10 @@
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
if (entry_ == INVALID_HANDLE_VALUE)
wprintf(L"CreateFileW (%s) failed: %d\n", file.c_str(), GetLastError());
- return entry_ != INVALID_HANDLE_VALUE;
+ return (entry_ != INVALID_HANDLE_VALUE) ? net::OK : net::ERR_FAILED;
#else
entry_ = file_util::OpenFile(entry_path_, "w+");
- return entry_ != NULL;
+ return (entry_ != NULL) ? net::OK : net::ERR_FAILED;
#endif
}
« no previous file with comments | « net/tools/dump_cache/cache_dumper.h ('k') | net/tools/dump_cache/upgrade.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698