OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
6 #define CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 6 #define CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // to worry about clients calling AppCacheService methods. | 36 // to worry about clients calling AppCacheService methods. |
37 class CONTENT_EXPORT ChromeAppCacheService | 37 class CONTENT_EXPORT ChromeAppCacheService |
38 : public base::RefCountedThreadSafe< | 38 : public base::RefCountedThreadSafe< |
39 ChromeAppCacheService, ChromeAppCacheServiceDeleter>, | 39 ChromeAppCacheService, ChromeAppCacheServiceDeleter>, |
40 NON_EXPORTED_BASE(public appcache::AppCacheService), | 40 NON_EXPORTED_BASE(public appcache::AppCacheService), |
41 NON_EXPORTED_BASE(public appcache::AppCachePolicy) { | 41 NON_EXPORTED_BASE(public appcache::AppCachePolicy) { |
42 public: | 42 public: |
43 explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy); | 43 explicit ChromeAppCacheService(quota::QuotaManagerProxy* proxy); |
44 virtual ~ChromeAppCacheService(); | 44 virtual ~ChromeAppCacheService(); |
45 | 45 |
| 46 // appcache::AppCacheService overrides |
| 47 virtual void InitializeUpdateRequest(net::URLRequest* request) OVERRIDE; |
| 48 |
46 void InitializeOnIOThread( | 49 void InitializeOnIOThread( |
47 const FilePath& cache_path, // may be empty to use in-memory structures | 50 const FilePath& cache_path, // may be empty to use in-memory structures |
48 content::ResourceContext* resource_context, | 51 content::ResourceContext* resource_context, |
49 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); | 52 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy); |
50 | 53 |
51 private: | 54 private: |
52 friend struct ChromeAppCacheServiceDeleter; | 55 friend struct ChromeAppCacheServiceDeleter; |
53 | 56 |
54 void DeleteOnCorrectThread() const; | 57 void DeleteOnCorrectThread() const; |
55 | 58 |
56 // AppCachePolicy overrides | 59 // AppCachePolicy overrides |
57 virtual bool CanLoadAppCache(const GURL& manifest_url, | 60 virtual bool CanLoadAppCache(const GURL& manifest_url, |
58 const GURL& first_party) OVERRIDE; | 61 const GURL& first_party) OVERRIDE; |
59 virtual bool CanCreateAppCache(const GURL& manifest_url, | 62 virtual bool CanCreateAppCache(const GURL& manifest_url, |
60 const GURL& first_party) OVERRIDE; | 63 const GURL& first_party) OVERRIDE; |
61 | 64 |
62 content::ResourceContext* resource_context_; | 65 content::ResourceContext* resource_context_; |
63 FilePath cache_path_; | 66 FilePath cache_path_; |
64 | 67 |
65 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); | 68 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); |
66 }; | 69 }; |
67 | 70 |
68 struct ChromeAppCacheServiceDeleter { | 71 struct ChromeAppCacheServiceDeleter { |
69 static void Destruct(const ChromeAppCacheService* service) { | 72 static void Destruct(const ChromeAppCacheService* service) { |
70 service->DeleteOnCorrectThread(); | 73 service->DeleteOnCorrectThread(); |
71 } | 74 } |
72 }; | 75 }; |
73 | 76 |
74 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 77 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
OLD | NEW |