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

Side by Side Diff: net/disk_cache/backend_impl.cc

Issue 10854230: Revert 152360 - Disk cache: Disable checking the lists on start-up. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/disk_cache/backend_impl.h" 5 #include "net/disk_cache/backend_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 479
480 eviction_.Init(this); 480 eviction_.Init(this);
481 481
482 // stats_ and rankings_ may end up calling back to us so we better be enabled. 482 // stats_ and rankings_ may end up calling back to us so we better be enabled.
483 disabled_ = false; 483 disabled_ = false;
484 if (!stats_.Init(this, &data_->header.stats)) 484 if (!stats_.Init(this, &data_->header.stats))
485 return net::ERR_FAILED; 485 return net::ERR_FAILED;
486 486
487 disabled_ = !rankings_.Init(this, new_eviction_); 487 disabled_ = !rankings_.Init(this, new_eviction_);
488 488
489 if (!disabled_ && !(user_flags_ & kNoRandom) && base::RandInt(0, 99) < 2)
490 rankings_.SelfCheck(); // Ignore return value for now.
491
489 #if defined(STRESS_CACHE_EXTENDED_VALIDATION) 492 #if defined(STRESS_CACHE_EXTENDED_VALIDATION)
490 trace_object_->EnableTracing(false); 493 trace_object_->EnableTracing(false);
491 int sc = SelfCheck(); 494 int sc = SelfCheck();
492 if (sc < 0 && sc != ERR_NUM_ENTRIES_MISMATCH) 495 if (sc < 0 && sc != ERR_NUM_ENTRIES_MISMATCH)
493 NOTREACHED(); 496 NOTREACHED();
494 trace_object_->EnableTracing(true); 497 trace_object_->EnableTracing(true);
495 #endif 498 #endif
496 499
497 if (previous_crash) { 500 if (previous_crash) {
498 ReportError(ERR_PREVIOUS_CRASH); 501 ReportError(ERR_PREVIOUS_CRASH);
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2199 if (total_memory > kMaxBuffersSize || total_memory <= 0) 2202 if (total_memory > kMaxBuffersSize || total_memory <= 0)
2200 total_memory = kMaxBuffersSize; 2203 total_memory = kMaxBuffersSize;
2201 2204
2202 done = true; 2205 done = true;
2203 } 2206 }
2204 2207
2205 return static_cast<int>(total_memory); 2208 return static_cast<int>(total_memory);
2206 } 2209 }
2207 2210
2208 } // namespace disk_cache 2211 } // namespace disk_cache
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698