| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 
| 7 | 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 { | 8 namespace content { | 
| 21 | 9 | 
| 22 // This class manages metadata associated with all service workers, | 10 // Represents the per-BrowserContext ServiceWorker data. | 
| 23 // including: | 11 class ServiceWorkerContext { | 
| 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: | 12  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 | 13 | 
| 35   bool IsEnabled(); | 14   // TODO(michaeln): This class is a place holder for content/public api | 
|  | 15   // which will come later. Promote this class when we get there. | 
| 36 | 16 | 
| 37  private: | 17  protected: | 
| 38   friend class base::RefCountedThreadSafe<ServiceWorkerContext>; | 18   ServiceWorkerContext() {} | 
| 39   ~ServiceWorkerContext(); | 19   virtual ~ServiceWorkerContext() {} | 
| 40 |  | 
| 41   scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |  | 
| 42   base::FilePath path_; |  | 
| 43 |  | 
| 44   DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContext); |  | 
| 45 }; | 20 }; | 
| 46 | 21 | 
| 47 }  // namespace content | 22 }  // namespace content | 
| 48 | 23 | 
| 49 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 24 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_H_ | 
| OLD | NEW | 
|---|