Chromium Code Reviews| Index: webkit/browser/appcache/appcache_service.h |
| diff --git a/webkit/browser/appcache/appcache_service.h b/webkit/browser/appcache/appcache_service.h |
| index 51647d1b46f76153cb6fc509a11099922d0d2782..c800e71bdfa54c1ecc31eebf10894b9083f7d920 100644 |
| --- a/webkit/browser/appcache/appcache_service.h |
| +++ b/webkit/browser/appcache/appcache_service.h |
| @@ -12,6 +12,8 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/observer_list.h" |
| +#include "base/time/time.h" |
| +#include "base/timer/timer.h" |
| #include "net/base/completion_callback.h" |
| #include "net/base/net_errors.h" |
| #include "webkit/browser/appcache/appcache_storage.h" |
| @@ -99,9 +101,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { |
| observers_.RemoveObserver(observer); |
| } |
| - // For use in a very specific failure mode to reboot the appcache system |
| + // For use in catastrophic failure modes to reboot the appcache system |
| // without relaunching the browser. |
| - void Reinitialize(); |
| + void ScheduleReinitialize(); |
| // Purges any memory not needed. |
| void PurgeMemory() { |
| @@ -201,6 +203,7 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { |
| protected: |
| friend class AppCacheStorageImplTest; |
| friend class AppCacheServiceTest; |
| + FRIEND_TEST_ALL_PREFIXES(AppCacheServiceTest, ScheduleReinitialize); |
|
jsbell
2014/01/24 21:13:44
Is this necessary if the AppCacheServiceTest class
michaeln
2014/01/28 22:12:16
Is is, TEST_F declares/defines a subclass and the
|
| class AsyncHelper; |
| class CanHandleOfflineHelper; |
| @@ -212,6 +215,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { |
| typedef std::set<AsyncHelper*> PendingAsyncHelpers; |
| typedef std::map<int, AppCacheBackendImpl*> BackendMap; |
| + void Reinitialize(); |
| + |
| base::FilePath cache_directory_; |
| scoped_refptr<base::MessageLoopProxy> db_thread_; |
| scoped_refptr<base::MessageLoopProxy> cache_thread_; |
| @@ -227,7 +232,9 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { |
| net::URLRequestContext* request_context_; |
| // If true, nothing (not even session-only data) should be deleted on exit. |
| bool force_keep_session_state_; |
| - bool was_reinitialized_; |
| + base::Time last_reinit_time_; |
| + base::TimeDelta next_reinit_delay_; |
| + base::OneShotTimer<AppCacheService> reinit_timer_; |
| ObserverList<Observer> observers_; |
| DISALLOW_COPY_AND_ASSIGN(AppCacheService); |