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_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "content/browser/service_worker/service_worker_context_core.h" | 13 #include "content/browser/service_worker/service_worker_context_core.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/service_worker_context.h" | 15 #include "content/public/browser/service_worker_context.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 class FilePath; | 18 class FilePath; |
| 19 class SequencedTaskRunner; |
19 } | 20 } |
20 | 21 |
21 namespace quota { | 22 namespace quota { |
22 class QuotaManagerProxy; | 23 class QuotaManagerProxy; |
23 } | 24 } |
24 | 25 |
25 namespace content { | 26 namespace content { |
26 | 27 |
27 class BrowserContext; | 28 class BrowserContext; |
28 class ServiceWorkerContextCore; | 29 class ServiceWorkerContextCore; |
(...skipping 25 matching lines...) Expand all Loading... |
54 const ResultCallback& continuation) OVERRIDE; | 55 const ResultCallback& continuation) OVERRIDE; |
55 virtual void UnregisterServiceWorker(const GURL& pattern, | 56 virtual void UnregisterServiceWorker(const GURL& pattern, |
56 const ResultCallback& continuation) | 57 const ResultCallback& continuation) |
57 OVERRIDE; | 58 OVERRIDE; |
58 | 59 |
59 void AddObserver(ServiceWorkerContextObserver* observer); | 60 void AddObserver(ServiceWorkerContextObserver* observer); |
60 void RemoveObserver(ServiceWorkerContextObserver* observer); | 61 void RemoveObserver(ServiceWorkerContextObserver* observer); |
61 | 62 |
62 private: | 63 private: |
63 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; | 64 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
| 65 friend class EmbeddedWorkerTestHelper; |
64 friend class ServiceWorkerProcessManager; | 66 friend class ServiceWorkerProcessManager; |
65 virtual ~ServiceWorkerContextWrapper(); | 67 virtual ~ServiceWorkerContextWrapper(); |
66 | 68 |
| 69 void InitForTesting(const base::FilePath& user_data_directory, |
| 70 base::SequencedTaskRunner* database_task_runner, |
| 71 quota::QuotaManagerProxy* quota_manager_proxy); |
| 72 void InitInternal(const base::FilePath& user_data_directory, |
| 73 base::SequencedTaskRunner* database_task_runner, |
| 74 quota::QuotaManagerProxy* quota_manager_proxy); |
| 75 |
67 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > | 76 const scoped_refptr<ObserverListThreadSafe<ServiceWorkerContextObserver> > |
68 observer_list_; | 77 observer_list_; |
69 // Cleared in Shutdown(): | 78 // Cleared in Shutdown(): |
70 BrowserContext* browser_context_; | 79 BrowserContext* browser_context_; |
71 scoped_ptr<ServiceWorkerContextCore> context_core_; | 80 scoped_ptr<ServiceWorkerContextCore> context_core_; |
72 }; | 81 }; |
73 | 82 |
74 } // namespace content | 83 } // namespace content |
75 | 84 |
76 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 85 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
OLD | NEW |