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

Unified Diff: net/http/http_cache_unittest.cc

Issue 1594036: Update about:cache to display cached metadata for an entry.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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/http/http_cache_transaction.cc ('k') | net/url_request/view_cache_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_unittest.cc
===================================================================
--- net/http/http_cache_unittest.cc (revision 44299)
+++ net/http/http_cache_unittest.cc (working copy)
@@ -62,6 +62,8 @@
//-----------------------------------------------------------------------------
// mock disk cache (a very basic memory cache implementation)
+static const int kNumCacheEntryDataIndices = 3;
+
class MockDiskEntry : public disk_cache::Entry,
public base::RefCounted<MockDiskEntry> {
public:
@@ -101,13 +103,13 @@
}
virtual int32 GetDataSize(int index) const {
- DCHECK(index >= 0 && index < 3);
+ DCHECK(index >= 0 && index < kNumCacheEntryDataIndices);
return static_cast<int32>(data_[index].size());
}
virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len,
net::CompletionCallback* callback) {
- DCHECK(index >= 0 && index < 3);
+ DCHECK(index >= 0 && index < kNumCacheEntryDataIndices);
if (fail_requests_)
return net::ERR_CACHE_READ_FAILURE;
@@ -130,7 +132,7 @@
virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len,
net::CompletionCallback* callback, bool truncate) {
- DCHECK(index >= 0 && index < 3);
+ DCHECK(index >= 0 && index < kNumCacheEntryDataIndices);
DCHECK(truncate);
if (fail_requests_)
@@ -338,7 +340,7 @@
}
std::string key_;
- std::vector<char> data_[3];
+ std::vector<char> data_[kNumCacheEntryDataIndices];
int test_mode_;
bool doomed_;
bool sparse_;
« no previous file with comments | « net/http/http_cache_transaction.cc ('k') | net/url_request/view_cache_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698