| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
| 6 #define CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 6 #define CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : public base::RefCountedThreadSafe<ChromeAppCacheService, | 28 : public base::RefCountedThreadSafe<ChromeAppCacheService, |
| 29 BrowserThread::DeleteOnIOThread>, | 29 BrowserThread::DeleteOnIOThread>, |
| 30 public appcache::AppCacheService, | 30 public appcache::AppCacheService, |
| 31 public appcache::AppCachePolicy, | 31 public appcache::AppCachePolicy, |
| 32 public NotificationObserver { | 32 public NotificationObserver { |
| 33 public: | 33 public: |
| 34 ChromeAppCacheService(); | 34 ChromeAppCacheService(); |
| 35 | 35 |
| 36 void InitializeOnIOThread( | 36 void InitializeOnIOThread( |
| 37 const FilePath& profile_path, bool is_incognito, | 37 const FilePath& profile_path, bool is_incognito, |
| 38 scoped_refptr<HostContentSettingsMap> content_settings_map); | 38 scoped_refptr<HostContentSettingsMap> content_settings_map, |
| 39 bool clear_local_state_on_exit); |
| 39 | 40 |
| 40 // Helpers used by the extension service to grant and revoke | 41 // Helpers used by the extension service to grant and revoke |
| 41 // unlimited storage to app extensions. | 42 // unlimited storage to app extensions. |
| 42 void SetOriginQuotaInMemory(const GURL& origin, int64 quota); | 43 void SetOriginQuotaInMemory(const GURL& origin, int64 quota); |
| 43 void ResetOriginQuotaInMemory(const GURL& origin); | 44 void ResetOriginQuotaInMemory(const GURL& origin); |
| 44 | 45 |
| 45 static void ClearLocalState(const FilePath& profile_path); | 46 void SetClearLocalStateOnExit(bool clear_local_state); |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 friend class BrowserThread; | 49 friend class BrowserThread; |
| 49 friend class DeleteTask<ChromeAppCacheService>; | 50 friend class DeleteTask<ChromeAppCacheService>; |
| 50 | 51 |
| 51 virtual ~ChromeAppCacheService(); | 52 virtual ~ChromeAppCacheService(); |
| 52 | 53 |
| 53 // AppCachePolicy overrides | 54 // AppCachePolicy overrides |
| 54 virtual bool CanLoadAppCache(const GURL& manifest_url); | 55 virtual bool CanLoadAppCache(const GURL& manifest_url); |
| 55 virtual int CanCreateAppCache(const GURL& manifest_url, | 56 virtual int CanCreateAppCache(const GURL& manifest_url, |
| 56 net::CompletionCallback* callback); | 57 net::CompletionCallback* callback); |
| 57 | 58 |
| 58 // NotificationObserver override | 59 // NotificationObserver override |
| 59 virtual void Observe(NotificationType type, | 60 virtual void Observe(NotificationType type, |
| 60 const NotificationSource& source, | 61 const NotificationSource& source, |
| 61 const NotificationDetails& details); | 62 const NotificationDetails& details); |
| 62 | 63 |
| 63 scoped_refptr<HostContentSettingsMap> host_contents_settings_map_; | 64 scoped_refptr<HostContentSettingsMap> host_contents_settings_map_; |
| 64 NotificationRegistrar registrar_; | 65 NotificationRegistrar registrar_; |
| 66 // Protects the |clear_local_state_on_exit_| flag. |
| 67 Lock lock_; |
| 68 bool clear_local_state_on_exit_; |
| 69 FilePath cache_path_; |
| 65 }; | 70 }; |
| 66 | 71 |
| 67 #endif // CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 72 #endif // CHROME_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
| OLD | NEW |