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

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

Issue 2739007: Disk cache: Update the disk cache tools and tests to use... (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/crash_cache/crash_cache.cc ('k') | net/tools/dump_cache/cache_dumper.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.h
===================================================================
--- net/tools/dump_cache/cache_dumper.h (revision 49603)
+++ net/tools/dump_cache/cache_dumper.h (working copy)
@@ -1,9 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_TOOLS_DUMP_CACHE_DUMPER_H_
-#define NET_TOOLS_DUMP_CACHE_DUMPER_H_
+#ifndef NET_TOOLS_DUMP_CACHE_CACHE_DUMPER_H_
+#define NET_TOOLS_DUMP_CACHE_CACHE_DUMPER_H_
#include <string>
#include "base/file_path.h"
@@ -22,6 +22,8 @@
// An abstract class for writing cache dump data.
class CacheDumpWriter {
public:
+ virtual ~CacheDumpWriter() {}
+
// Creates an entry to be written.
// On success, populates the |entry|.
// Returns true on success, false otherwise.
@@ -30,8 +32,9 @@
// Write to the current entry.
// Returns true on success, false otherwise.
- virtual bool WriteEntry(disk_cache::Entry* entry, int stream, int offset,
- net::IOBuffer* buf, int buf_len) = 0;
+ virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
+ net::IOBuffer* buf, int buf_len,
+ net::CompletionCallback* callback) = 0;
// Close the current entry.
virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
@@ -41,27 +44,29 @@
// Writes data to a cache.
class CacheDumper : public CacheDumpWriter {
public:
- CacheDumper(disk_cache::BackendImpl* cache) : cache_(cache) {};
+ explicit CacheDumper(disk_cache::Backend* cache) : cache_(cache) {}
virtual bool CreateEntry(const std::string& key, disk_cache::Entry** entry);
- virtual bool WriteEntry(disk_cache::Entry* entry, int stream, int offset,
- net::IOBuffer* buf, int buf_len);
+ virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
+ net::IOBuffer* buf, int buf_len,
+ net::CompletionCallback* callback);
virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
base::Time last_modified);
private:
- disk_cache::BackendImpl* cache_;
+ disk_cache::Backend* cache_;
};
// Writes data to a disk.
class DiskDumper : public CacheDumpWriter {
public:
- DiskDumper(const std::wstring& path) : path_(path), entry_(NULL) {
+ explicit DiskDumper(const std::wstring& path) : path_(path), entry_(NULL) {
file_util::CreateDirectory(FilePath(path));
- };
+ }
virtual bool CreateEntry(const std::string& key, disk_cache::Entry** entry);
- virtual bool WriteEntry(disk_cache::Entry* entry, int stream, int offset,
- net::IOBuffer* buf, int buf_len);
+ virtual int WriteEntry(disk_cache::Entry* entry, int stream, int offset,
+ net::IOBuffer* buf, int buf_len,
+ net::CompletionCallback* callback);
virtual void CloseEntry(disk_cache::Entry* entry, base::Time last_used,
base::Time last_modified);
@@ -79,4 +84,4 @@
#endif
};
-#endif // NET_TOOLS_DUMP_CACHE_DUMPER_H_
+#endif // NET_TOOLS_DUMP_CACHE_CACHE_DUMPER_H_
« no previous file with comments | « net/tools/crash_cache/crash_cache.cc ('k') | net/tools/dump_cache/cache_dumper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698