X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fwebkit%2Fbrowser%2Fappcache%2Fappcache_service.h;h=c800e71bdfa54c1ecc31eebf10894b9083f7d920;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=51647d1b46f76153cb6fc509a11099922d0d2782;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/webkit/browser/appcache/appcache_service.h b/src/webkit/browser/appcache/appcache_service.h index 51647d1..c800e71 100644 --- a/src/webkit/browser/appcache/appcache_service.h +++ b/src/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); class AsyncHelper; class CanHandleOfflineHelper; @@ -212,6 +215,8 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheService { typedef std::set PendingAsyncHelpers; typedef std::map BackendMap; + void Reinitialize(); + base::FilePath cache_directory_; scoped_refptr db_thread_; scoped_refptr 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 reinit_timer_; ObserverList observers_; DISALLOW_COPY_AND_ASSIGN(AppCacheService);