Chromium Code Reviews| 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..b5c6cd285cdd67b02afaa0b3228c985d25aaa7f6 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,15 @@ 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); |
|
michaeln
2011/07/14 22:53:16
If we don't make the changes to the BDR in this CL
marja(google)
2011/07/15 11:03:42
Done.
|
| private: |
| friend class BrowserThread; |
| friend class DeleteTask<ChromeAppCacheService>; |
| + friend class appcache::TestableChromeAppCacheService; |
| virtual ~ChromeAppCacheService(); |
| @@ -61,10 +68,23 @@ class ChromeAppCacheService |
| const NotificationSource& source, |
| const NotificationDetails& details); |
| + // AppCache clearing helpers and callbacks |
| + void OnGotAppCacheInfo(int rv); |
| + void OnAppCacheDeleted(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> |
| + appcache_deleted_callback_; |
| + scoped_refptr<appcache::AppCacheInfoCollection> appcache_info_; |
| + int appcaches_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); |
| }; |