Commit 6cefe7a8 authored by nhiroki's avatar nhiroki Committed by Commit bot

AppCache: Remove dead code from AppCacheService

BUG=n/a

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

Cr-Commit-Position: refs/heads/master@{#357031}
parent 7526ea57
......@@ -83,54 +83,6 @@ void AppCacheServiceImpl::AsyncHelper::Cancel() {
service_ = NULL;
}
// CanHandleOfflineHelper -------
class AppCacheServiceImpl::CanHandleOfflineHelper : AsyncHelper {
public:
CanHandleOfflineHelper(
AppCacheServiceImpl* service, const GURL& url,
const GURL& first_party, const net::CompletionCallback& callback)
: AsyncHelper(service, callback),
url_(url),
first_party_(first_party) {
}
void Start() override {
AppCachePolicy* policy = service_->appcache_policy();
if (policy && !policy->CanLoadAppCache(url_, first_party_)) {
CallCallback(net::ERR_FAILED);
delete this;
return;
}
service_->storage()->FindResponseForMainRequest(url_, GURL(), this);
}
private:
// AppCacheStorage::Delegate implementation.
void OnMainResponseFound(const GURL& url,
const AppCacheEntry& entry,
const GURL& fallback_url,
const AppCacheEntry& fallback_entry,
int64 cache_id,
int64 group_id,
const GURL& mainfest_url) override;
GURL url_;
GURL first_party_;
DISALLOW_COPY_AND_ASSIGN(CanHandleOfflineHelper);
};
void AppCacheServiceImpl::CanHandleOfflineHelper::OnMainResponseFound(
const GURL& url, const AppCacheEntry& entry,
const GURL& fallback_url, const AppCacheEntry& fallback_entry,
int64 cache_id, int64 group_id, const GURL& manifest_url) {
bool can = (entry.has_response_id() || fallback_entry.has_response_id());
CallCallback(can ? net::OK : net::ERR_FAILED);
delete this;
}
// DeleteHelper -------
class AppCacheServiceImpl::DeleteHelper : public AsyncHelper {
......@@ -524,15 +476,6 @@ void AppCacheServiceImpl::Reinitialize() {
Initialize(cache_directory_, db_thread_, cache_thread_);
}
void AppCacheServiceImpl::CanHandleMainResourceOffline(
const GURL& url,
const GURL& first_party,
const net::CompletionCallback& callback) {
CanHandleOfflineHelper* helper =
new CanHandleOfflineHelper(this, url, first_party, callback);
helper->Start();
}
void AppCacheServiceImpl::GetAllAppCacheInfo(
AppCacheInfoCollection* collection,
const net::CompletionCallback& callback) {
......
......@@ -99,10 +99,6 @@ class CONTENT_EXPORT AppCacheServiceImpl
void ScheduleReinitialize();
// AppCacheService implementation:
void CanHandleMainResourceOffline(
const GURL& url,
const GURL& first_party,
const net::CompletionCallback& callback) override;
void GetAllAppCacheInfo(AppCacheInfoCollection* collection,
const net::CompletionCallback& callback) override;
void DeleteAppCacheGroup(const GURL& manifest_url,
......@@ -187,7 +183,6 @@ class CONTENT_EXPORT AppCacheServiceImpl
ScheduleReinitialize);
class AsyncHelper;
class CanHandleOfflineHelper;
class DeleteHelper;
class DeleteOriginHelper;
class GetInfoHelper;
......
......@@ -34,13 +34,6 @@ struct CONTENT_EXPORT AppCacheInfoCollection
// Call these methods only on the IO thread.
class CONTENT_EXPORT AppCacheService {
public:
// Determines if a request for 'url' can be satisfied while offline.
// This method always completes asynchronously.
virtual void CanHandleMainResourceOffline(const GURL& url,
const GURL& first_party,
const net::CompletionCallback&
callback) = 0;
// Populates 'collection' with info about all of the appcaches stored
// within the service, 'callback' is invoked upon completion. The service
// acquires a reference to the 'collection' until completion.
......
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