summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/disk_cache.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 01:19:55 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-23 01:19:55 +0000
commitc67287e61638d3cf598cb68c29133558080f1270 (patch)
tree40f3426ad01efbf096773d523ebec652d96d4316 /net/disk_cache/disk_cache.h
parenta438488ef232fdb3117ada69d8458f1506643633 (diff)
downloadchromium_src-c67287e61638d3cf598cb68c29133558080f1270.zip
chromium_src-c67287e61638d3cf598cb68c29133558080f1270.tar.gz
chromium_src-c67287e61638d3cf598cb68c29133558080f1270.tar.bz2
Disk cache: Fix style and extra net:: specification.
No real code change. BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9812031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_cache.h')
-rw-r--r--net/disk_cache/disk_cache.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/net/disk_cache/disk_cache.h b/net/disk_cache/disk_cache.h
index 4d928e6..f2fbcdd 100644
--- a/net/disk_cache/disk_cache.h
+++ b/net/disk_cache/disk_cache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -58,6 +58,8 @@ NET_EXPORT int CreateCacheBackend(net::CacheType type, const FilePath& path,
// The root interface for a disk cache instance.
class NET_EXPORT Backend {
public:
+ typedef net::CompletionCallback CompletionCallback;
+
// If the backend is destroyed when there are operations in progress (any
// callback that has not been invoked yet), this method cancels said
// operations so the callbacks are not invoked, possibly leaving the work
@@ -76,7 +78,7 @@ class NET_EXPORT Backend {
// will be invoked when the entry is available. The pointer to receive the
// |entry| must remain valid until the operation completes.
virtual int OpenEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Creates a new entry. Upon success, the out param holds a pointer to an
// Entry object representing the newly created disk cache entry. When the
@@ -85,18 +87,18 @@ class NET_EXPORT Backend {
// the |callback| will be invoked when the entry is available. The pointer to
// receive the |entry| must remain valid until the operation completes.
virtual int CreateEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Marks the entry, specified by the given key, for deletion. The return value
// is a net error code. If this method returns ERR_IO_PENDING, the |callback|
// will be invoked after the entry is doomed.
virtual int DoomEntry(const std::string& key,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Marks all entries for deletion. The return value is a net error code. If
// this method returns ERR_IO_PENDING, the |callback| will be invoked when the
// operation completes.
- virtual int DoomAllEntries(const net::CompletionCallback& callback) = 0;
+ virtual int DoomAllEntries(const CompletionCallback& callback) = 0;
// Marks a range of entries for deletion. This supports unbounded deletes in
// either direction by using null Time values for either argument. The return
@@ -104,13 +106,13 @@ class NET_EXPORT Backend {
// |callback| will be invoked when the operation completes.
virtual int DoomEntriesBetween(const base::Time initial_time,
const base::Time end_time,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Marks all entries accessed since |initial_time| for deletion. The return
// value is a net error code. If this method returns ERR_IO_PENDING, the
// |callback| will be invoked when the operation completes.
virtual int DoomEntriesSince(const base::Time initial_time,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Enumerates the cache. Initialize |iter| to NULL before calling this method
// the first time. That will cause the enumeration to start at the head of
@@ -125,7 +127,7 @@ class NET_EXPORT Backend {
// NOTE: This method does not modify the last_used field of the entry, and
// therefore it does not impact the eviction ranking of the entry.
virtual int OpenNextEntry(void** iter, Entry** next_entry,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Releases iter without returning the next entry. Whenever OpenNextEntry()
// returns true, but the caller is not interested in continuing the
@@ -145,6 +147,9 @@ class NET_EXPORT Backend {
// This interface represents an entry in the disk cache.
class NET_EXPORT Entry {
public:
+ typedef net::CompletionCallback CompletionCallback;
+ typedef net::IOBuffer IOBuffer;
+
// Marks this cache entry for deletion.
virtual void Doom() = 0;
@@ -176,8 +181,8 @@ class NET_EXPORT Entry {
// been called; in other words, the caller may close this entry without
// having to wait for all the callbacks, and still rely on the cleanup
// performed from the callback code.
- virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) = 0;
+ virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len,
+ const CompletionCallback& callback) = 0;
// Copies cache data from the given buffer of length |buf_len|. If
// completion_callback is null, then this call blocks until the write
@@ -192,8 +197,8 @@ class NET_EXPORT Entry {
// performed from the callback code.
// If truncate is true, this call will truncate the stored data at the end of
// what we are writing here.
- virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback,
+ virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len,
+ const CompletionCallback& callback,
bool truncate) = 0;
// Sparse entries support:
@@ -240,8 +245,8 @@ class NET_EXPORT Entry {
// Behaves like ReadData() except that this method is used to access sparse
// entries.
- virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) = 0;
+ virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len,
+ const CompletionCallback& callback) = 0;
// Behaves like WriteData() except that this method is used to access sparse
// entries. |truncate| is not part of this interface because a sparse entry
@@ -249,8 +254,8 @@ class NET_EXPORT Entry {
// start again, or to reduce the total size of the stream data (which implies
// that the content has changed), the whole entry should be doomed and
// re-created.
- virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len,
- const net::CompletionCallback& callback) = 0;
+ virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len,
+ const CompletionCallback& callback) = 0;
// Returns information about the currently stored portion of a sparse entry.
// |offset| and |len| describe a particular range that should be scanned to
@@ -262,7 +267,7 @@ class NET_EXPORT Entry {
// this method returns ERR_IO_PENDING, the |callback| will be invoked when the
// operation completes, and |start| must remain valid until that point.
virtual int GetAvailableRange(int64 offset, int len, int64* start,
- const net::CompletionCallback& callback) = 0;
+ const CompletionCallback& callback) = 0;
// Returns true if this entry could be a sparse entry or false otherwise. This
// is a quick test that may return true even if the entry is not really
@@ -292,8 +297,7 @@ class NET_EXPORT Entry {
// Note that CancelSparseIO may have been called on another instance of this
// object that refers to the same physical disk entry.
// Note: This method is deprecated.
- virtual int ReadyForSparseIO(
- const net::CompletionCallback& completion_callback) = 0;
+ virtual int ReadyForSparseIO(const CompletionCallback& callback) = 0;
protected:
virtual ~Entry() {}