| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | |
| 6 #define CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | |
| 7 | |
| 8 #include "base/ref_counted.h" | |
| 9 #include "chrome/browser/host_content_settings_map.h" | |
| 10 #include "chrome/common/notification_registrar.h" | |
| 11 #include "webkit/appcache/appcache_policy.h" | |
| 12 #include "webkit/appcache/appcache_service.h" | |
| 13 | |
| 14 class ChromeURLRequestContext; | |
| 15 class FilePath; | |
| 16 | |
| 17 // An AppCacheService subclass used by the chrome. There is an instance | |
| 18 // associated with each Profile. This derivation adds refcounting semantics | |
| 19 // since a profile has multiple URLRequestContexts which refer to the same | |
| 20 // object, and those URLRequestContexts are refcounted independently of the | |
| 21 // owning profile. | |
| 22 // | |
| 23 // All methods, including the ctor and dtor, are expected to be called on | |
| 24 // the IO thread. | |
| 25 class ChromeAppCacheService | |
| 26 : public base::RefCounted<ChromeAppCacheService>, | |
| 27 public appcache::AppCacheService, | |
| 28 public appcache::AppCachePolicy, | |
| 29 public NotificationObserver { | |
| 30 public: | |
| 31 ChromeAppCacheService(const FilePath& profile_path, | |
| 32 ChromeURLRequestContext* request_context); | |
| 33 | |
| 34 static void ClearLocalState(const FilePath& profile_path); | |
| 35 | |
| 36 private: | |
| 37 friend class base::RefCounted<ChromeAppCacheService>; | |
| 38 virtual ~ChromeAppCacheService(); | |
| 39 | |
| 40 // AppCachePolicy overrides | |
| 41 virtual bool CanLoadAppCache(const GURL& manifest_url); | |
| 42 virtual int CanCreateAppCache(const GURL& manifest_url, | |
| 43 net::CompletionCallback* callback); | |
| 44 | |
| 45 // NotificationObserver override | |
| 46 virtual void Observe(NotificationType type, | |
| 47 const NotificationSource& source, | |
| 48 const NotificationDetails& details); | |
| 49 | |
| 50 scoped_refptr<HostContentSettingsMap> host_contents_settings_map_; | |
| 51 NotificationRegistrar registrar_; | |
| 52 }; | |
| 53 | |
| 54 #endif // CHROME_COMMON_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | |
| OLD | NEW |