diff options
Diffstat (limited to 'net/http/http_cache.cc')
-rw-r--r-- | net/http/http_cache.cc | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc index 4a2313c..d53d525 100644 --- a/net/http/http_cache.cc +++ b/net/http/http_cache.cc @@ -1,5 +1,4 @@ // Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Copyright (c) 2011, 2012, Code Aurora Forum. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -36,9 +35,6 @@ #include "net/http/http_util.h" #include "net/socket/ssl_host_info.h" -#include "net/disk_cache/stat_hub.h" -#include "net/disk_cache/hostres_plugin_bridge.h" - namespace net { namespace { @@ -89,14 +85,8 @@ HttpCache::BackendFactory* HttpCache::DefaultBackend::InMemory(int max_bytes) { int HttpCache::DefaultBackend::CreateBackend(NetLog* net_log, disk_cache::Backend** backend, - CompletionCallback* callback, - FilePath** stat_db_path) { + CompletionCallback* callback) { DCHECK_GE(max_bytes_, 0); - (*stat_db_path) = NULL; - if (type_ == net::DISK_CACHE) { - std::string dataPath = "/data/data/"; - (*stat_db_path) = new FilePath(dataPath + stat_hub::kEnabledAppName + "/databases"); - } return disk_cache::CreateCacheBackend(type_, path_, max_bytes_, true, thread_, net_log, backend, callback); } @@ -349,8 +339,7 @@ HttpCache::HttpCache(HostResolver* host_resolver, http_auth_handler_factory, network_delegate, net_log))), - ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) - , stat_db_path_(NULL) { + ALLOW_THIS_IN_INITIALIZER_LIST(task_factory_(this)) { } @@ -419,10 +408,6 @@ HttpCache::~HttpCache() { if (delete_pending_op) delete pending_op; } - - if (NULL!=stat_db_path_) { - delete stat_db_path_; - } } int HttpCache::GetBackend(disk_cache::Backend** backend, @@ -533,7 +518,7 @@ int HttpCache::CreateBackend(disk_cache::Backend** backend, pending_op->callback = my_callback; int rv = backend_factory_->CreateBackend(net_log_, &pending_op->backend, - my_callback, &stat_db_path_ ); + my_callback); if (rv != ERR_IO_PENDING) { pending_op->writer->ClearCallback(); my_callback->Run(rv); @@ -1158,21 +1143,8 @@ void HttpCache::OnBackendCreated(int result, PendingOp* pending_op) { } // The cache may be gone when we return from the callback. - if (!item->DoCallback(result, backend)) { + if (!item->DoCallback(result, backend)) item->NotifyTransaction(result, NULL); - if (NULL!=stat_db_path_) { - if(!stat_hub::StatHub::GetInstance()->IsReady()) { - stat_hub::StatProcessor* hp = StatHubCreateHostResPlugin(); - if (NULL!=hp) { - stat_hub::StatHub::GetInstance()->RegisterProcessor(hp); - LOG(INFO) << "HttpCache::OnBackendCreated HostStat created"; - } - if(stat_hub::StatHub::GetInstance()->Init(stat_db_path_->value(), MessageLoop::current(), this)) { - LOG(INFO) << "HttpCache::OnBackendCreated : StatHub is ready."; - } - } - } - } } } // namespace net |