| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 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 CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | |
| 7 | |
| 8 #include "base/files/file_path.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "content/common/content_export.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class FilePath; | |
| 14 } | |
| 15 | |
| 16 namespace quota { | |
| 17 class QuotaManagerProxy; | |
| 18 } | |
| 19 | |
| 20 namespace content { | |
| 21 | |
| 22 // This class manages metadata associated with all service workers, | |
| 23 // including: | |
| 24 // - persistent storage of pattern -> service worker scripts | |
| 25 // - initialization and initial installation of service workers | |
| 26 // - dispatching of non-fetch events to service workers | |
| 27 class CONTENT_EXPORT ServiceWorkerContext | |
| 28 : public base::RefCountedThreadSafe<ServiceWorkerContext> { | |
| 29 public: | |
| 30 // This is owned by the StoragePartition, which will supply it with | |
| 31 // the local path on disk. | |
| 32 ServiceWorkerContext(const base::FilePath& path, | |
| 33 quota::QuotaManagerProxy* quota_manager_proxy); | |
| 34 | |
| 35 bool IsEnabled(); | |
| 36 | |
| 37 private: | |
| 38 friend class base::RefCountedThreadSafe<ServiceWorkerContext>; | |
| 39 ~ServiceWorkerContext(); | |
| 40 | |
| 41 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | |
| 42 base::FilePath path_; | |
| 43 | |
| 44 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContext); | |
| 45 }; | |
| 46 | |
| 47 } // namespace content | |
| 48 | |
| 49 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | |
| OLD | NEW |