| Index: content/browser/appcache/chrome_appcache_service.h
|
| diff --git a/content/browser/appcache/chrome_appcache_service.h b/content/browser/appcache/chrome_appcache_service.h
|
| index d325b376d443b6f575c1dbd627ad168d8aa72df5..b7dad50c1dace333e222fc478f322e2edad26c4e 100644
|
| --- a/content/browser/appcache/chrome_appcache_service.h
|
| +++ b/content/browser/appcache/chrome_appcache_service.h
|
| @@ -7,15 +7,21 @@
|
| #pragma once
|
|
|
| #include "base/memory/ref_counted.h"
|
| +#include "base/synchronization/waitable_event.h"
|
| #include "content/browser/browser_thread.h"
|
| #include "content/common/notification_observer.h"
|
| #include "content/common/notification_registrar.h"
|
| +#include "net/base/completion_callback.h"
|
| #include "webkit/appcache/appcache_policy.h"
|
| #include "webkit/appcache/appcache_service.h"
|
| #include "webkit/quota/special_storage_policy.h"
|
|
|
| class FilePath;
|
|
|
| +namespace appcache {
|
| +class TestableChromeAppCacheService;
|
| +}
|
| +
|
| namespace content {
|
| class ResourceContext;
|
| }
|
| @@ -40,14 +46,18 @@ class ChromeAppCacheService
|
| void InitializeOnIOThread(
|
| const FilePath& cache_path, // may be empty to use in-memory structures
|
| const content::ResourceContext* resource_context,
|
| - scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy,
|
| - bool clear_local_state_on_exit);
|
| + scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy);
|
|
|
| - void SetClearLocalStateOnExit(bool clear_local_state);
|
| + // Safe to call from any thread
|
| + base::WaitableEvent* ClearAppCache(net::CompletionCallback* callback);
|
|
|
| private:
|
| friend class BrowserThread;
|
| friend class DeleteTask<ChromeAppCacheService>;
|
| + // TestableChromeAppService is a subclass of ChromeAppCacheService used in the
|
| + // unit tests
|
| + friend class appcache::TestableChromeAppCacheService;
|
| + FRIEND_TEST_ALL_PREFIXES(BrowsingDataRemoverTest, RemoveAppCacheForever);
|
|
|
| virtual ~ChromeAppCacheService();
|
|
|
| @@ -61,10 +71,23 @@ class ChromeAppCacheService
|
| const NotificationSource& source,
|
| const NotificationDetails& details);
|
|
|
| + // Appcache clearing helpers and callbacks
|
| + void OnGotAppCacheInfo(int rv);
|
| + void OnOriginDeleted(int rv);
|
| + void OnClearedAppCache();
|
| +
|
| const content::ResourceContext* resource_context_;
|
| NotificationRegistrar registrar_;
|
| - bool clear_local_state_on_exit_;
|
| FilePath cache_path_;
|
| + net::CompletionCallbackImpl<ChromeAppCacheService>
|
| + appcache_got_info_callback_;
|
| + net::CompletionCallbackImpl<ChromeAppCacheService>
|
| + origin_deleted_callback_;
|
| + scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_;
|
| + int origins_to_be_deleted_count_;
|
| + scoped_ptr<base::WaitableEvent> appcaches_cleared_event_;
|
| + net::CompletionCallback* appcaches_cleared_callback_;
|
| + bool waiting_for_clear_appcaches_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService);
|
| };
|
|
|