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.cc23
-rw-r--r--net/disk_cache/backend_unittest.cc3
-rw-r--r--net/disk_cache/block_files.cc3
-rw-r--r--net/disk_cache/sparse_control.cc5
-rw-r--r--net/disk_cache/stats.cc9
5 files changed, 25 insertions, 18 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 1446711..66c789e 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -11,6 +11,7 @@
#include "base/message_loop.h"
#include "base/rand_util.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "base/time.h"
#include "base/timer.h"
@@ -20,8 +21,8 @@
#include "net/disk_cache/entry_impl.h"
#include "net/disk_cache/errors.h"
#include "net/disk_cache/experiments.h"
-#include "net/disk_cache/hash.h"
#include "net/disk_cache/file.h"
+#include "net/disk_cache/hash.h"
#include "net/disk_cache/mem_backend_impl.h"
// This has to be defined before including histogram_macros.h from this file.
@@ -74,7 +75,8 @@ size_t GetIndexSize(int table_len) {
// will return "/foo/old_bar_005".
FilePath GetPrefixedName(const FilePath& path, const std::string& name,
int index) {
- std::string tmp = StringPrintf("%s%s_%03d", "old_", name.c_str(), index);
+ std::string tmp = base::StringPrintf("%s%s_%03d", "old_",
+ name.c_str(), index);
return path.AppendASCII(tmp);
}
@@ -191,7 +193,7 @@ 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);
- std::string group1 = StringPrintf("CacheSizeGroup_%d", size_group);
+ std::string group1 = base::StringPrintf("CacheSizeGroup_%d", size_group);
trial1->AppendGroup(group1, FieldTrial::kAllRemainingProbability);
scoped_refptr<FieldTrial> trial2 = new FieldTrial("CacheThrottle", 100);
@@ -517,19 +519,19 @@ void BackendImpl::GetStats(StatsItems* stats) {
std::pair<std::string, std::string> item;
item.first = "Entries";
- item.second = StringPrintf("%d", data_->header.num_entries);
+ item.second = base::StringPrintf("%d", data_->header.num_entries);
stats->push_back(item);
item.first = "Pending IO";
- item.second = StringPrintf("%d", num_pending_io_);
+ item.second = base::StringPrintf("%d", num_pending_io_);
stats->push_back(item);
item.first = "Max size";
- item.second = StringPrintf("%d", max_size_);
+ item.second = base::StringPrintf("%d", max_size_);
stats->push_back(item);
item.first = "Current size";
- item.second = StringPrintf("%d", data_->header.num_bytes);
+ item.second = base::StringPrintf("%d", data_->header.num_bytes);
stats->push_back(item);
stats_.GetItems(stats);
@@ -918,7 +920,7 @@ FilePath BackendImpl::GetFileName(Addr address) const {
return FilePath();
}
- std::string tmp = StringPrintf("f_%06x", address.FileNumber());
+ std::string tmp = base::StringPrintf("f_%06x", address.FileNumber());
return path_.AppendASCII(tmp);
}
@@ -1108,8 +1110,9 @@ bool BackendImpl::IsLoaded() const {
std::string BackendImpl::HistogramName(const char* name, int experiment) const {
if (!experiment)
- return StringPrintf("DiskCache.%d.%s", cache_type_, name);
- return StringPrintf("DiskCache.%d.%s_%d", cache_type_, name, experiment);
+ return base::StringPrintf("DiskCache.%d.%s", cache_type_, name);
+ return base::StringPrintf("DiskCache.%d.%s_%d", cache_type_,
+ name, experiment);
}
base::WeakPtr<BackendImpl> BackendImpl::GetWeakPtr() {
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 3f0018c..43b59e8 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -6,6 +6,7 @@
#include "base/file_util.h"
#include "base/platform_thread.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -752,7 +753,7 @@ void DiskCacheBackendTest::BackendTrimInvalidEntry2() {
// Writing 32 entries to this cache chains most of them.
for (int i = 0; i < 32; i++) {
- std::string key(StringPrintf("some key %d", i));
+ std::string key(base::StringPrintf("some key %d", i));
ASSERT_EQ(net::OK, CreateEntry(key, &entry));
EXPECT_EQ(kSize, WriteData(entry, 0, 0, buffer, kSize, false));
entry->Close();
diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc
index b81a868..e0021a8 100644
--- a/net/disk_cache/block_files.cc
+++ b/net/disk_cache/block_files.cc
@@ -7,6 +7,7 @@
#include "base/file_util.h"
#include "base/histogram.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/thread_checker.h"
#include "base/time.h"
#include "net/disk_cache/cache_util.h"
@@ -602,7 +603,7 @@ void BlockFiles::GetFileStats(int index, int* used_count, int* load) {
FilePath BlockFiles::Name(int index) {
// The file format allows for 256 files.
DCHECK(index < 256 || index >= 0);
- std::string tmp = StringPrintf("%s%d", kBlockName, index);
+ std::string tmp = base::StringPrintf("%s%d", kBlockName, index);
return path_.AppendASCII(tmp);
}
diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc
index afd3317..2934184 100644
--- a/net/disk_cache/sparse_control.cc
+++ b/net/disk_cache/sparse_control.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "base/time.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
@@ -41,8 +42,8 @@ const int kBlockSize = 1024;
// number of the particular child.
std::string GenerateChildName(const std::string& base_name, int64 signature,
int64 child_id) {
- return StringPrintf("Range_%s:%" PRIx64 ":%" PRIx64, base_name.c_str(),
- signature, child_id);
+ return base::StringPrintf("Range_%s:%" PRIx64 ":%" PRIx64, base_name.c_str(),
+ signature, child_id);
}
// This class deletes the children of a sparse entry.
diff --git a/net/disk_cache/stats.cc b/net/disk_cache/stats.cc
index b69e70d..f0446fb 100644
--- a/net/disk_cache/stats.cc
+++ b/net/disk_cache/stats.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/stringprintf.h"
#include "net/disk_cache/backend_impl.h"
namespace {
@@ -260,14 +261,14 @@ int64 Stats::GetCounter(Counters counter) const {
void Stats::GetItems(StatsItems* items) {
std::pair<std::string, std::string> item;
for (int i = 0; i < kDataSizesLength; i++) {
- item.first = StringPrintf("Size%02d", i);
- item.second = StringPrintf("0x%08x", data_sizes_[i]);
+ item.first = base::StringPrintf("Size%02d", i);
+ item.second = base::StringPrintf("0x%08x", data_sizes_[i]);
items->push_back(item);
}
for (int i = MIN_COUNTER + 1; i < MAX_COUNTER; i++) {
item.first = kCounterNames[i];
- item.second = StringPrintf("0x%" PRIx64, counters_[i]);
+ item.second = base::StringPrintf("0x%" PRIx64, counters_[i]);
items->push_back(item);
}
}