summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/backend_impl.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 23:02:11 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 23:02:11 +0000
commit4b3c95dd199586b4c540800be8cd223e948e5e3f (patch)
treec97ef865a3c85f09e920d8b1bc4024a56bb8e8cf /net/disk_cache/backend_impl.cc
parentd160ec0e875e98829684f040d843e6a292dbb3ba (diff)
downloadchromium_src-4b3c95dd199586b4c540800be8cd223e948e5e3f.zip
chromium_src-4b3c95dd199586b4c540800be8cd223e948e5e3f.tar.gz
chromium_src-4b3c95dd199586b4c540800be8cd223e948e5e3f.tar.bz2
Start reordering the methods in headers in net/.
This patch also starts reordering some of the cc files to match their headers. More of both cleanups will be done in future patches. BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/backend_impl.cc')
-rw-r--r--net/disk_cache/backend_impl.cc192
1 files changed, 96 insertions, 96 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 223c970..31320a78 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -435,102 +435,6 @@ BackendImpl::~BackendImpl() {
// ------------------------------------------------------------------------
-int32 BackendImpl::GetEntryCount() const {
- if (!index_ || disabled_)
- return 0;
- // num_entries includes entries already evicted.
- int32 not_deleted = data_->header.num_entries -
- data_->header.lru.sizes[Rankings::DELETED];
-
- if (not_deleted < 0) {
- NOTREACHED();
- not_deleted = 0;
- }
-
- return not_deleted;
-}
-
-int BackendImpl::OpenEntry(const std::string& key, Entry** entry,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.OpenEntry(key, entry, callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::CreateEntry(const std::string& key, Entry** entry,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.CreateEntry(key, entry, callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::DoomEntry(const std::string& key,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.DoomEntry(key, callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::DoomAllEntries(CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.DoomAllEntries(callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::DoomEntriesBetween(const base::Time initial_time,
- const base::Time end_time,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.DoomEntriesBetween(initial_time, end_time, callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::DoomEntriesSince(const base::Time initial_time,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.DoomEntriesSince(initial_time, callback);
- return net::ERR_IO_PENDING;
-}
-
-int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
- CompletionCallback* callback) {
- DCHECK(callback);
- background_queue_.OpenNextEntry(iter, next_entry, callback);
- return net::ERR_IO_PENDING;
-}
-
-void BackendImpl::EndEnumeration(void** iter) {
- background_queue_.EndEnumeration(*iter);
- *iter = NULL;
-}
-
-void BackendImpl::GetStats(StatsItems* stats) {
- if (disabled_)
- return;
-
- std::pair<std::string, std::string> item;
-
- item.first = "Entries";
- item.second = base::StringPrintf("%d", data_->header.num_entries);
- stats->push_back(item);
-
- item.first = "Pending IO";
- item.second = base::StringPrintf("%d", num_pending_io_);
- stats->push_back(item);
-
- item.first = "Max size";
- item.second = base::StringPrintf("%d", max_size_);
- stats->push_back(item);
-
- item.first = "Current size";
- item.second = base::StringPrintf("%d", data_->header.num_bytes);
- stats->push_back(item);
-
- stats_.GetItems(stats);
-}
-
-// ------------------------------------------------------------------------
-
int BackendImpl::SyncInit() {
DCHECK(!init_);
if (init_)
@@ -1355,6 +1259,102 @@ int BackendImpl::SelfCheck() {
// ------------------------------------------------------------------------
+int32 BackendImpl::GetEntryCount() const {
+ if (!index_ || disabled_)
+ return 0;
+ // num_entries includes entries already evicted.
+ int32 not_deleted = data_->header.num_entries -
+ data_->header.lru.sizes[Rankings::DELETED];
+
+ if (not_deleted < 0) {
+ NOTREACHED();
+ not_deleted = 0;
+ }
+
+ return not_deleted;
+}
+
+int BackendImpl::OpenEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.OpenEntry(key, entry, callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::CreateEntry(const std::string& key, Entry** entry,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.CreateEntry(key, entry, callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::DoomEntry(const std::string& key,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.DoomEntry(key, callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::DoomAllEntries(CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.DoomAllEntries(callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::DoomEntriesBetween(const base::Time initial_time,
+ const base::Time end_time,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.DoomEntriesBetween(initial_time, end_time, callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::DoomEntriesSince(const base::Time initial_time,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.DoomEntriesSince(initial_time, callback);
+ return net::ERR_IO_PENDING;
+}
+
+int BackendImpl::OpenNextEntry(void** iter, Entry** next_entry,
+ CompletionCallback* callback) {
+ DCHECK(callback);
+ background_queue_.OpenNextEntry(iter, next_entry, callback);
+ return net::ERR_IO_PENDING;
+}
+
+void BackendImpl::EndEnumeration(void** iter) {
+ background_queue_.EndEnumeration(*iter);
+ *iter = NULL;
+}
+
+void BackendImpl::GetStats(StatsItems* stats) {
+ if (disabled_)
+ return;
+
+ std::pair<std::string, std::string> item;
+
+ item.first = "Entries";
+ item.second = base::StringPrintf("%d", data_->header.num_entries);
+ stats->push_back(item);
+
+ item.first = "Pending IO";
+ item.second = base::StringPrintf("%d", num_pending_io_);
+ stats->push_back(item);
+
+ item.first = "Max size";
+ item.second = base::StringPrintf("%d", max_size_);
+ stats->push_back(item);
+
+ item.first = "Current size";
+ item.second = base::StringPrintf("%d", data_->header.num_bytes);
+ stats->push_back(item);
+
+ stats_.GetItems(stats);
+}
+
+// ------------------------------------------------------------------------
+
// We just created a new file so we're going to write the header and set the
// file length to include the hash table (zero filled).
bool BackendImpl::CreateBackingStore(disk_cache::File* file) {