| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/sequenced_task_runner_helpers.h" | 10 #include "base/sequenced_task_runner_helpers.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // If |cache_path| is empty we will use in-memory structs. | 48 // If |cache_path| is empty we will use in-memory structs. |
| 49 void InitializeOnIOThread( | 49 void InitializeOnIOThread( |
| 50 const base::FilePath& cache_path, | 50 const base::FilePath& cache_path, |
| 51 ResourceContext* resource_context, | 51 ResourceContext* resource_context, |
| 52 net::URLRequestContextGetter* request_context_getter, | 52 net::URLRequestContextGetter* request_context_getter, |
| 53 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy); | 53 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy); |
| 54 | 54 |
| 55 // AppCachePolicy overrides | 55 // AppCachePolicy overrides |
| 56 virtual bool CanLoadAppCache(const GURL& manifest_url, | 56 virtual bool CanLoadAppCache(const GURL& manifest_url, |
| 57 const GURL& first_party) OVERRIDE; | 57 const GURL& first_party) override; |
| 58 virtual bool CanCreateAppCache(const GURL& manifest_url, | 58 virtual bool CanCreateAppCache(const GURL& manifest_url, |
| 59 const GURL& first_party) OVERRIDE; | 59 const GURL& first_party) override; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 virtual ~ChromeAppCacheService(); | 62 virtual ~ChromeAppCacheService(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 friend class base::DeleteHelper<ChromeAppCacheService>; | 65 friend class base::DeleteHelper<ChromeAppCacheService>; |
| 66 friend class base::RefCountedThreadSafe<ChromeAppCacheService, | 66 friend class base::RefCountedThreadSafe<ChromeAppCacheService, |
| 67 ChromeAppCacheServiceDeleter>; | 67 ChromeAppCacheServiceDeleter>; |
| 68 friend struct ChromeAppCacheServiceDeleter; | 68 friend struct ChromeAppCacheServiceDeleter; |
| 69 | 69 |
| 70 void DeleteOnCorrectThread() const; | 70 void DeleteOnCorrectThread() const; |
| 71 | 71 |
| 72 ResourceContext* resource_context_; | 72 ResourceContext* resource_context_; |
| 73 base::FilePath cache_path_; | 73 base::FilePath cache_path_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); | 75 DISALLOW_COPY_AND_ASSIGN(ChromeAppCacheService); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 struct ChromeAppCacheServiceDeleter { | 78 struct ChromeAppCacheServiceDeleter { |
| 79 static void Destruct(const ChromeAppCacheService* service) { | 79 static void Destruct(const ChromeAppCacheService* service) { |
| 80 service->DeleteOnCorrectThread(); | 80 service->DeleteOnCorrectThread(); |
| 81 } | 81 } |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } // namespace content | 84 } // namespace content |
| 85 | 85 |
| 86 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ | 86 #endif // CONTENT_BROWSER_APPCACHE_CHROME_APPCACHE_SERVICE_H_ |
| OLD | NEW |