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 4ebff8daef383ec5703d7e78965ba44c39cb409a..68616f45a9bff5956895bbbea05de5b6b397db48 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,28 @@ 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 |
michaeln
2011/07/02 00:29:09
i'd nuke this comment, i think it's stating the ob
marja(google)
2011/07/13 11:06:59
Done.
|
+ friend class appcache::TestableChromeAppCacheService; |
+ |
+ class ClearAppcacheHelper { |
michaeln
2011/07/02 00:29:09
This class seems heavier weight than it needs to b
marja(google)
2011/07/13 11:06:59
Done.
|
+ public: |
+ ClearAppcacheHelper(ChromeAppCacheService* parent, |
+ net::CompletionCallback* callback); |
+ ~ClearAppcacheHelper(); |
+ void OnClearedAppCache(); |
+ private: |
+ scoped_refptr<ChromeAppCacheService> parent_; |
+ net::CompletionCallback* callback_; |
+ }; |
virtual ~ChromeAppCacheService(); |
@@ -61,10 +81,21 @@ class ChromeAppCacheService |
const NotificationSource& source, |
const NotificationDetails& details); |
+ // Appcache clearing helpers and callbacks |
michaeln
2011/07/02 00:29:09
AppCache with an upper 'C' is more in keeping with
marja(google)
2011/07/13 11:06:59
Done.
|
+ void OnGotAppCacheInfo(int rv); |
+ void OnAppCacheDeleted(int rv); |
+ |
const content::ResourceContext* resource_context_; |
NotificationRegistrar registrar_; |
- bool clear_local_state_on_exit_; |
FilePath cache_path_; |
+ ClearAppcacheHelper* clear_appcache_helper_; |
+ 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_; |
DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); |
}; |