Android: Store language .pak files in res/raw rather than assets
[chromium-blink-merge.git] / content / browser / service_worker / service_worker_disk_cache.h
blob19cb531fd2b0d469d6cfc4f7aeb8b3197b0c30ee
1 // Copyright 2014 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.
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_
8 #include "content/browser/appcache/appcache_disk_cache.h"
9 #include "content/common/content_export.h"
11 namespace content {
13 // Wholesale reusage of the appcache code for response reading,
14 // writing, and storage. See the corresponding class in that
15 // library for doc comments and other details.
16 // TODO(michaeln): If this reuse sticks, refactor/move the
17 // resused classes to a more common location.
19 class CONTENT_EXPORT ServiceWorkerDiskCache
20 : public AppCacheDiskCache {
21 public:
22 static scoped_ptr<ServiceWorkerDiskCache> CreateWithBlockFileBackend();
23 static scoped_ptr<ServiceWorkerDiskCache> CreateWithSimpleBackend();
25 private:
26 friend class ServiceWorkerDiskCacheMigrator;
27 friend class ServiceWorkerDiskCacheMigratorTest;
28 explicit ServiceWorkerDiskCache(bool use_simple_cache);
31 class CONTENT_EXPORT ServiceWorkerResponseReader
32 : public AppCacheResponseReader {
33 protected:
34 // Should only be constructed by the storage class.
35 friend class ServiceWorkerDiskCacheMigrator;
36 friend class ServiceWorkerDiskCacheMigratorTest;
37 friend class ServiceWorkerStorage;
38 ServiceWorkerResponseReader(
39 int64 response_id,
40 ServiceWorkerDiskCache* disk_cache);
43 class CONTENT_EXPORT ServiceWorkerResponseWriter
44 : public AppCacheResponseWriter {
45 protected:
46 // Should only be constructed by the storage class.
47 friend class ServiceWorkerDiskCacheMigrator;
48 friend class ServiceWorkerDiskCacheMigratorTest;
49 friend class ServiceWorkerStorage;
50 ServiceWorkerResponseWriter(
51 int64 response_id,
52 ServiceWorkerDiskCache* disk_cache);
55 class CONTENT_EXPORT ServiceWorkerResponseMetadataWriter
56 : public AppCacheResponseMetadataWriter {
57 protected:
58 // Should only be constructed by the storage class.
59 friend class ServiceWorkerDiskCacheMigrator;
60 friend class ServiceWorkerDiskCacheMigratorTest;
61 friend class ServiceWorkerStorage;
62 ServiceWorkerResponseMetadataWriter(int64 response_id,
63 ServiceWorkerDiskCache* disk_cache);
66 } // namespace content
68 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISK_CACHE_H_