Commit b8af58ec authored by gavinp's avatar gavinp Committed by Commit bot

Remove the tracing cache backend.

While working on issue 410276, in particular in
https://codereview.chromium.org/542733002/ , I had to update the
tracing cache backend. Why? Does anyone use it?

Let's remove it instead.

R=pasko@chromium.org,clamy@chromium.org
BUG=None

Review URL: https://codereview.chromium.org/544923002

Cr-Commit-Position: refs/heads/master@{#293505}
parent 827189d0
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "net/disk_cache/simple/simple_entry_format.h" #include "net/disk_cache/simple/simple_entry_format.h"
#include "net/disk_cache/simple/simple_test_util.h" #include "net/disk_cache/simple/simple_test_util.h"
#include "net/disk_cache/simple/simple_util.h" #include "net/disk_cache/simple/simple_util.h"
#include "net/disk_cache/tracing/tracing_cache_backend.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -127,7 +126,6 @@ class DiskCacheBackendTest : public DiskCacheTestWithCache { ...@@ -127,7 +126,6 @@ class DiskCacheBackendTest : public DiskCacheTestWithCache {
void BackendDisable2(); void BackendDisable2();
void BackendDisable3(); void BackendDisable3();
void BackendDisable4(); void BackendDisable4();
void TracingBackendBasics();
}; };
int DiskCacheBackendTest::GeneratePendingIO(net::TestCompletionCallback* cb) { int DiskCacheBackendTest::GeneratePendingIO(net::TestCompletionCallback* cb) {
...@@ -3150,40 +3148,6 @@ TEST_F(DiskCacheBackendTest, ShaderCacheUpdateRankForExternalCacheHit) { ...@@ -3150,40 +3148,6 @@ TEST_F(DiskCacheBackendTest, ShaderCacheUpdateRankForExternalCacheHit) {
entry->Close(); entry->Close();
} }
void DiskCacheBackendTest::TracingBackendBasics() {
InitCache();
cache_.reset(new disk_cache::TracingCacheBackend(cache_.Pass()));
cache_impl_ = NULL;
EXPECT_EQ(net::DISK_CACHE, cache_->GetCacheType());
if (!simple_cache_mode_) {
EXPECT_EQ(0, cache_->GetEntryCount());
}
net::TestCompletionCallback cb;
disk_cache::Entry* entry = NULL;
EXPECT_NE(net::OK, OpenEntry("key", &entry));
EXPECT_TRUE(NULL == entry);
ASSERT_EQ(net::OK, CreateEntry("key", &entry));
EXPECT_TRUE(NULL != entry);
disk_cache::Entry* same_entry = NULL;
ASSERT_EQ(net::OK, OpenEntry("key", &same_entry));
EXPECT_TRUE(NULL != same_entry);
if (!simple_cache_mode_) {
EXPECT_EQ(1, cache_->GetEntryCount());
}
entry->Close();
entry = NULL;
same_entry->Close();
same_entry = NULL;
}
TEST_F(DiskCacheBackendTest, TracingBackendBasics) {
TracingBackendBasics();
}
// The Simple Cache backend requires a few guarantees from the filesystem like // The Simple Cache backend requires a few guarantees from the filesystem like
// atomic renaming of recently open files. Those guarantees are not provided in // atomic renaming of recently open files. Those guarantees are not provided in
// general on Windows. // general on Windows.
...@@ -3271,13 +3235,6 @@ TEST_F(DiskCacheBackendTest, SimpleCacheAppCacheOnlyDoomAll) { ...@@ -3271,13 +3235,6 @@ TEST_F(DiskCacheBackendTest, SimpleCacheAppCacheOnlyDoomAll) {
BackendDoomAll(); BackendDoomAll();
} }
TEST_F(DiskCacheBackendTest, SimpleCacheTracingBackendBasics) {
SetSimpleCacheMode();
TracingBackendBasics();
// TODO(pasko): implement integrity checking on the Simple Backend.
DisableIntegrityCheck();
}
TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) { TEST_F(DiskCacheBackendTest, SimpleCacheOpenMissingFile) {
SetSimpleCacheMode(); SetSimpleCacheMode();
InitCache(); InitCache();
......
...@@ -14,10 +14,6 @@ ...@@ -14,10 +14,6 @@
#include "net/disk_cache/memory/mem_backend_impl.h" #include "net/disk_cache/memory/mem_backend_impl.h"
#include "net/disk_cache/simple/simple_backend_impl.h" #include "net/disk_cache/simple/simple_backend_impl.h"
#ifdef USE_TRACING_CACHE_BACKEND
#include "net/disk_cache/tracing_cache_backend.h"
#endif
namespace { namespace {
// Builds an instance of the backend depending on platform, type, experiments // Builds an instance of the backend depending on platform, type, experiments
......
This diff is collapsed.
// Copyright (c) 2013 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.
#ifndef NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_
#define NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_
#include <map>
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "net/disk_cache/blockfile/stats.h"
#include "net/disk_cache/disk_cache.h"
namespace disk_cache {
class EntryProxy;
// The TracingCacheBackend implements the Cache Backend interface. It intercepts
// all backend operations from the IO thread and records the time from the start
// of the operation until the result is delivered.
class NET_EXPORT TracingCacheBackend : public Backend,
public base::SupportsWeakPtr<TracingCacheBackend> {
public:
explicit TracingCacheBackend(scoped_ptr<Backend> backend);
virtual net::CacheType GetCacheType() const OVERRIDE;
virtual int32 GetEntryCount() const OVERRIDE;
virtual int OpenEntry(const std::string& key, Entry** entry,
const CompletionCallback& callback) OVERRIDE;
virtual int CreateEntry(const std::string& key, Entry** entry,
const CompletionCallback& callback) OVERRIDE;
virtual int DoomEntry(const std::string& key,
const CompletionCallback& callback) OVERRIDE;
virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
virtual int DoomEntriesBetween(base::Time initial_time,
base::Time end_time,
const CompletionCallback& callback) OVERRIDE;
virtual int DoomEntriesSince(base::Time initial_time,
const CompletionCallback& callback) OVERRIDE;
virtual int OpenNextEntry(void** iter, Entry** next_entry,
const CompletionCallback& callback) OVERRIDE;
virtual void EndEnumeration(void** iter) OVERRIDE;
virtual void GetStats(StatsItems* stats) OVERRIDE;
virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
private:
friend class EntryProxy;
enum Operation {
OP_OPEN,
OP_CREATE,
OP_DOOM_ENTRY,
OP_READ,
OP_WRITE
};
virtual ~TracingCacheBackend();
EntryProxy* FindOrCreateEntryProxy(Entry* entry);
void OnDeleteEntry(Entry* e);
void RecordEvent(base::TimeTicks start_time, Operation op, std::string key,
Entry* entry, int result);
void BackendOpComplete(base::TimeTicks start_time, Operation op,
std::string key, Entry** entry,
const CompletionCallback& callback, int result);
net::CompletionCallback BindCompletion(Operation op,
base::TimeTicks start_time,
const std::string& key, Entry **entry,
const net::CompletionCallback& cb);
scoped_ptr<Backend> backend_;
typedef std::map<Entry*, EntryProxy*> EntryToProxyMap;
EntryToProxyMap open_entries_;
DISALLOW_COPY_AND_ASSIGN(TracingCacheBackend);
};
} // namespace disk_cache
#endif // NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
'chromium_code': 1, 'chromium_code': 1,
'linux_link_kerberos%': 0, 'linux_link_kerberos%': 0,
'use_tracing_cache_backend%': 0,
'conditions': [ 'conditions': [
['chromeos==1 or embedded==1 or OS=="android" or OS=="ios"', { ['chromeos==1 or embedded==1 or OS=="android" or OS=="ios"', {
# Disable Kerberos on ChromeOS, Android and iOS, at least for now. # Disable Kerberos on ChromeOS, Android and iOS, at least for now.
...@@ -203,11 +202,6 @@ ...@@ -203,11 +202,6 @@
'dns/dns_client.cc', 'dns/dns_client.cc',
], ],
}], }],
['use_tracing_cache_backend==1', {
'defines': [
'USE_TRACING_CACHE_BACKEND'
],
}],
['use_openssl==1', { ['use_openssl==1', {
'sources!': [ 'sources!': [
'base/crypto_module_nss.cc', 'base/crypto_module_nss.cc',
......
...@@ -474,8 +474,6 @@ ...@@ -474,8 +474,6 @@
'disk_cache/simple/simple_util.h', 'disk_cache/simple/simple_util.h',
'disk_cache/simple/simple_version_upgrade.cc', 'disk_cache/simple/simple_version_upgrade.cc',
'disk_cache/simple/simple_version_upgrade.h', 'disk_cache/simple/simple_version_upgrade.h',
'disk_cache/tracing/tracing_cache_backend.cc',
'disk_cache/tracing/tracing_cache_backend.h',
'dns/address_sorter.h', 'dns/address_sorter.h',
'dns/address_sorter_posix.cc', 'dns/address_sorter_posix.cc',
'dns/address_sorter_posix.h', 'dns/address_sorter_posix.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment