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

Unified Diff: net/disk_cache/simple/simple_backend_impl.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/disk_cache/blockfile/block_files.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_backend_impl.cc
diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
index 6385a3763c27fe04ffdafd06c043b351393926da..8cf592aa48dddc0a56d81a011c78966ae674a14a 100644
--- a/net/disk_cache/simple/simple_backend_impl.cc
+++ b/net/disk_cache/simple/simple_backend_impl.cc
@@ -271,12 +271,15 @@ int SimpleBackendImpl::Init(const CompletionCallback& completion_callback) {
}
bool SimpleBackendImpl::SetMaxSize(int max_bytes) {
+ if (max_bytes < 0)
+ return false;
orig_max_size_ = max_bytes;
- return index_->SetMaxSize(max_bytes);
+ index_->SetMaxSize(max_bytes);
+ return true;
}
int SimpleBackendImpl::GetMaxFileSize() const {
- return index_->max_size() / kMaxFileRatio;
+ return static_cast<int>(index_->max_size() / kMaxFileRatio);
}
void SimpleBackendImpl::OnDoomStart(uint64 entry_hash) {
« no previous file with comments | « net/disk_cache/blockfile/block_files.cc ('k') | net/disk_cache/simple/simple_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698