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

Side by Side Diff: net/disk_cache/v3/eviction_v3.cc

Issue 121643003: Reorganize net/disk_cache into backend specific directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: #define fixes Created 6 years, 10 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
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 // The eviction policy is a very simple pure LRU, so the elements at the end of 5 // The eviction policy is a very simple pure LRU, so the elements at the end of
6 // the list are evicted until kCleanUpMargin free space is available. There is 6 // the list are evicted until kCleanUpMargin free space is available. There is
7 // only one list in use (Rankings::NO_USE), and elements are sent to the front 7 // only one list in use (Rankings::NO_USE), and elements are sent to the front
8 // of the list whenever they are accessed. 8 // of the list whenever they are accessed.
9 9
10 // The new (in-development) eviction policy adds re-use as a factor to evict 10 // The new (in-development) eviction policy adds re-use as a factor to evict
(...skipping 16 matching lines...) Expand all
27 // list. 27 // list.
28 28
29 #include "net/disk_cache/v3/eviction_v3.h" 29 #include "net/disk_cache/v3/eviction_v3.h"
30 30
31 #include "base/bind.h" 31 #include "base/bind.h"
32 #include "base/compiler_specific.h" 32 #include "base/compiler_specific.h"
33 #include "base/logging.h" 33 #include "base/logging.h"
34 #include "base/message_loop/message_loop.h" 34 #include "base/message_loop/message_loop.h"
35 #include "base/strings/string_util.h" 35 #include "base/strings/string_util.h"
36 #include "base/time/time.h" 36 #include "base/time/time.h"
37 #include "net/disk_cache/experiments.h" 37 #include "net/disk_cache/v2/experiments.h"
38 #include "net/disk_cache/trace.h" 38 #include "net/disk_cache/v2/trace.h"
39 #include "net/disk_cache/v3/backend_impl_v3.h" 39 #include "net/disk_cache/v3/backend_impl_v3.h"
40 #include "net/disk_cache/v3/entry_impl_v3.h" 40 #include "net/disk_cache/v3/entry_impl_v3.h"
41 #include "net/disk_cache/v3/histogram_macros.h" 41 #include "net/disk_cache/v3/histogram_macros.h"
42 42
43
44 using base::Time; 43 using base::Time;
45 using base::TimeTicks; 44 using base::TimeTicks;
46 45
47 namespace { 46 namespace {
48 47
49 const int kCleanUpMargin = 1024 * 1024; 48 const int kCleanUpMargin = 1024 * 1024;
50 49
51 #if defined(V3_NOT_JUST_YET_READY) 50 #if defined(V3_NOT_JUST_YET_READY)
52 const int kHighUse = 10; // Reuse count to be on the HIGH_USE list. 51 const int kHighUse = 10; // Reuse count to be on the HIGH_USE list.
53 const int kTargetTime = 24 * 7; // Time to be evicted (hours since last use). 52 const int kTargetTime = 24 * 7; // Time to be evicted (hours since last use).
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 if (last3.get()) 501 if (last3.get())
503 CACHE_UMA(AGE, "HighUseAge", 0, 502 CACHE_UMA(AGE, "HighUseAge", 0,
504 Time::FromInternalValue(last3.get()->Data()->last_used)); 503 Time::FromInternalValue(last3.get()->Data()->last_used));
505 if (last4.get()) 504 if (last4.get())
506 CACHE_UMA(AGE, "DeletedAge", 0, 505 CACHE_UMA(AGE, "DeletedAge", 0,
507 Time::FromInternalValue(last4.get()->Data()->last_used)); 506 Time::FromInternalValue(last4.get()->Data()->last_used));
508 } 507 }
509 #endif // defined(V3_NOT_JUST_YET_READY). 508 #endif // defined(V3_NOT_JUST_YET_READY).
510 509
511 } // namespace disk_cache 510 } // namespace disk_cache
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698