summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/backend_impl.cc17
-rw-r--r--net/disk_cache/block_files.cc2
-rw-r--r--net/disk_cache/entry_impl.cc2
-rw-r--r--net/disk_cache/histogram_macros.h25
-rw-r--r--net/disk_cache/rankings.cc2
-rw-r--r--net/disk_cache/stats_histogram.cc3
-rw-r--r--net/disk_cache/stats_histogram.h6
7 files changed, 31 insertions, 26 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 5086e2b..2ad91e0 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -4,11 +4,11 @@
#include "net/disk_cache/backend_impl.h"
-#include "base/field_trial.h"
#include "base/file_path.h"
#include "base/file_util.h"
-#include "base/histogram.h"
#include "base/message_loop.h"
+#include "base/metrics/field_trial.h"
+#include "base/metrics/histogram.h"
#include "base/rand_util.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
@@ -192,11 +192,12 @@ bool SetFieldTrialInfo(int size_group) {
// Field trials involve static objects so we have to do this only once.
first = false;
- scoped_refptr<FieldTrial> trial1 = new FieldTrial("CacheSize", 10);
+ scoped_refptr<base::FieldTrial> trial1 =
+ new base::FieldTrial("CacheSize", 10);
std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group);
- trial1->AppendGroup(group1, FieldTrial::kAllRemainingProbability);
+ trial1->AppendGroup(group1, base::FieldTrial::kAllRemainingProbability);
- scoped_refptr<FieldTrial> trial2 = new FieldTrial("CacheThrottle", 100);
+ scoped_refptr<base::FieldTrial> trial2 = new base::FieldTrial("CacheThrottle", 100);
int group2a = trial2->AppendGroup("CacheThrottle_On", 10); // 10 % in.
trial2->AppendGroup("CacheThrottle_Off", 10); // 10 % control.
@@ -1235,9 +1236,9 @@ void BackendImpl::OnOperationCompleted(base::TimeDelta elapsed_time) {
if (cache_type() != net::DISK_CACHE)
return;
- UMA_HISTOGRAM_TIMES(
- FieldTrial::MakeName("DiskCache.TotalIOTime", "CacheThrottle").data(),
- elapsed_time);
+ UMA_HISTOGRAM_TIMES(base::FieldTrial::MakeName("DiskCache.TotalIOTime",
+ "CacheThrottle").data(),
+ elapsed_time);
if (!throttle_requests_)
return;
diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc
index 2b849fc..9d5de62 100644
--- a/net/disk_cache/block_files.cc
+++ b/net/disk_cache/block_files.cc
@@ -5,7 +5,7 @@
#include "net/disk_cache/block_files.h"
#include "base/file_util.h"
-#include "base/histogram.h"
+#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/thread_checker.h"
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 24796ea..7fabbe5 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -4,8 +4,8 @@
#include "net/disk_cache/entry_impl.h"
-#include "base/histogram.h"
#include "base/message_loop.h"
+#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
diff --git a/net/disk_cache/histogram_macros.h b/net/disk_cache/histogram_macros.h
index 2505a8a..044302c 100644
--- a/net/disk_cache/histogram_macros.h
+++ b/net/disk_cache/histogram_macros.h
@@ -20,10 +20,11 @@
#define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
do { \
- static scoped_refptr<Histogram> counter; \
+ static scoped_refptr<base::Histogram> counter; \
if (!counter || name != counter->histogram_name()) \
- counter = Histogram::FactoryGet(name, min, max, bucket_count, \
- Histogram::kUmaTargetedHistogramFlag); \
+ counter = base::Histogram::FactoryGet( \
+ name, min, max, bucket_count, \
+ base::Histogram::kUmaTargetedHistogramFlag); \
counter->Add(sample); \
} while (0)
@@ -38,10 +39,11 @@
#define CACHE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
do { \
- static scoped_refptr<Histogram> counter; \
+ static scoped_refptr<base::Histogram> counter; \
if (!counter || name != counter->histogram_name()) \
- counter = Histogram::FactoryTimeGet(name, min, max, bucket_count, \
- Histogram::kUmaTargetedHistogramFlag); \
+ counter = base::Histogram::FactoryTimeGet( \
+ name, min, max, bucket_count, \
+ base::Histogram::kUmaTargetedHistogramFlag); \
counter->AddTime(sample); \
} while (0)
@@ -50,11 +52,11 @@
base::TimeDelta::FromSeconds(10), 50)
#define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) do { \
- static scoped_refptr<Histogram> counter; \
+ static scoped_refptr<base::Histogram> counter; \
if (!counter || name != counter->histogram_name()) \
- counter = LinearHistogram::FactoryGet( \
+ counter = base::LinearHistogram::FactoryGet( \
name, 1, boundary_value, boundary_value + 1, \
- Histogram::kUmaTargetedHistogramFlag); \
+ base::Histogram::kUmaTargetedHistogramFlag); \
counter->Add(sample); \
} while (0)
@@ -70,12 +72,13 @@
// HISTOGRAM_AGE will collect time elapsed since |initial_time|, with a
// granularity of hours and normal values of a few months.
#define CACHE_HISTOGRAM_AGE(name, initial_time) \
- CACHE_HISTOGRAM_COUNTS_10000(name, (Time::Now() - initial_time).InHours())
+ CACHE_HISTOGRAM_COUNTS_10000(name, \
+ (base::Time::Now() - initial_time).InHours())
// HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the
// normal resolution of the UMA_HISTOGRAM_TIMES.
#define CACHE_HISTOGRAM_AGE_MS(name, initial_time)\
- CACHE_HISTOGRAM_TIMES(name, TimeTicks::Now() - initial_time)
+ CACHE_HISTOGRAM_TIMES(name, base::TimeTicks::Now() - initial_time)
#define CACHE_HISTOGRAM_CACHE_ERROR(name, sample) \
CACHE_HISTOGRAM_ENUMERATION(name, sample, 50)
diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc
index 5c0313b..1e9e06b 100644
--- a/net/disk_cache/rankings.cc
+++ b/net/disk_cache/rankings.cc
@@ -4,7 +4,7 @@
#include "net/disk_cache/rankings.h"
-#include "base/histogram.h"
+#include "base/metrics/histogram.h"
#include "net/disk_cache/backend_impl.h"
#include "net/disk_cache/entry_impl.h"
#include "net/disk_cache/errors.h"
diff --git a/net/disk_cache/stats_histogram.cc b/net/disk_cache/stats_histogram.cc
index e6eaf90..06ed1b3 100644
--- a/net/disk_cache/stats_histogram.cc
+++ b/net/disk_cache/stats_histogram.cc
@@ -9,6 +9,9 @@
namespace disk_cache {
+using base::Histogram;
+using base::StatisticsRecorder;
+
// Static.
const Stats* StatsHistogram::stats_ = NULL;
diff --git a/net/disk_cache/stats_histogram.h b/net/disk_cache/stats_histogram.h
index 1c2e15a..cbd8f03 100644
--- a/net/disk_cache/stats_histogram.h
+++ b/net/disk_cache/stats_histogram.h
@@ -8,7 +8,7 @@
#include <string>
-#include "base/histogram.h"
+#include "base/metrics/histogram.h"
namespace disk_cache {
@@ -21,7 +21,7 @@ class Stats;
// Class derivation of Histogram "deprecated," and should not be copied, and
// may eventually go away.
//
-class StatsHistogram : public Histogram {
+class StatsHistogram : public base::Histogram {
public:
class StatsSamples : public SampleSet {
public:
@@ -46,8 +46,6 @@ class StatsHistogram : public Histogram {
virtual void SnapshotSample(SampleSet* sample) const;
private:
- friend class Histogram;
-
bool init_;
static const Stats* stats_;
DISALLOW_COPY_AND_ASSIGN(StatsHistogram);