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

Unified Diff: net/disk_cache/eviction.cc

Issue 15203004: Disk cache: Reference CL for the implementation of file format version 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: IndexTable review Created 7 years, 1 month 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/eviction.h ('k') | net/disk_cache/file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/eviction.cc
===================================================================
--- net/disk_cache/eviction.cc (revision 199883)
+++ net/disk_cache/eviction.cc (working copy)
@@ -35,6 +35,7 @@
#include "base/string_util.h"
#include "base/time.h"
#include "net/disk_cache/backend_impl.h"
+#include "net/disk_cache/disk_format.h"
#include "net/disk_cache/entry_impl.h"
#include "net/disk_cache/experiments.h"
#include "net/disk_cache/histogram_macros.h"
@@ -142,8 +143,9 @@
}
if (!empty && (deleted_entries > 20 ||
(TimeTicks::Now() - start).InMilliseconds() > 20)) {
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- &Eviction::TrimCache, ptr_factory_.GetWeakPtr(), false));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&Eviction::TrimCache, ptr_factory_.GetWeakPtr(), false));
break;
}
}
@@ -209,7 +211,8 @@
return;
delay_trim_ = true;
trim_delays_++;
- MessageLoop::current()->PostDelayedTask(FROM_HERE,
+ base::MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
base::Bind(&Eviction::DelayedTrim, ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromMilliseconds(1000));
}
@@ -297,13 +300,9 @@
entry->entry()->Store();
rankings_->Insert(entry->rankings(), true, Rankings::DELETED);
}
- if (!empty) {
+ if (!empty)
backend_->OnEvent(Stats::TRIM_ENTRY);
- static const char gajs[] = "http://www.google-analytics.com/ga.js";
- if (!entry->GetKey().compare(gajs))
- backend_->OnEvent(Stats::GAJS_EVICTED);
- }
entry->Release();
return true;
@@ -365,8 +364,9 @@
}
if (!empty && (deleted_entries > 20 ||
(TimeTicks::Now() - start).InMilliseconds() > 20)) {
- MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
- &Eviction::TrimCache, ptr_factory_.GetWeakPtr(), false));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&Eviction::TrimCache, ptr_factory_.GetWeakPtr(), false));
break;
}
}
@@ -377,7 +377,8 @@
if (empty) {
TrimDeleted(true);
} else if (ShouldTrimDeleted()) {
- MessageLoop::current()->PostTask(FROM_HERE,
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
base::Bind(&Eviction::TrimDeleted, ptr_factory_.GetWeakPtr(), empty));
}
@@ -509,7 +510,8 @@
}
if (deleted_entries && !empty && ShouldTrimDeleted()) {
- MessageLoop::current()->PostTask(FROM_HERE,
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
base::Bind(&Eviction::TrimDeleted, ptr_factory_.GetWeakPtr(), false));
}
« no previous file with comments | « net/disk_cache/eviction.h ('k') | net/disk_cache/file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698