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 "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/browser/service_worker/service_worker_context.h" | 11 #include "content/browser/service_worker/service_worker_context_core.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/service_worker_context.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class FilePath; | 16 class FilePath; |
16 } | 17 } |
17 | 18 |
18 namespace quota { | 19 namespace quota { |
19 class QuotaManagerProxy; | 20 class QuotaManagerProxy; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
(...skipping 12 matching lines...) Expand all Loading... |
35 | 36 |
36 // Init and Shutdown are for use on the UI thread when the profile, | 37 // Init and Shutdown are for use on the UI thread when the profile, |
37 // storagepartition is being setup and torn down. | 38 // storagepartition is being setup and torn down. |
38 void Init(const base::FilePath& user_data_directory, | 39 void Init(const base::FilePath& user_data_directory, |
39 quota::QuotaManagerProxy* quota_manager_proxy); | 40 quota::QuotaManagerProxy* quota_manager_proxy); |
40 void Shutdown(); | 41 void Shutdown(); |
41 | 42 |
42 // The core context is only for use on the IO thread. | 43 // The core context is only for use on the IO thread. |
43 ServiceWorkerContextCore* context(); | 44 ServiceWorkerContextCore* context(); |
44 | 45 |
| 46 // ServiceWorkerContext implementation: |
| 47 virtual void RegisterServiceWorker(const GURL& pattern, |
| 48 const GURL& script_url, |
| 49 int source_process_id, |
| 50 const RegistrationCallback& continuation) |
| 51 OVERRIDE; |
| 52 |
| 53 virtual void UnregisterServiceWorker( |
| 54 const GURL& pattern, |
| 55 int source_process_id, |
| 56 const UnregistrationCallback& continuation) OVERRIDE; |
| 57 |
45 private: | 58 private: |
46 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; | 59 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
47 virtual ~ServiceWorkerContextWrapper(); | 60 virtual ~ServiceWorkerContextWrapper(); |
48 | 61 |
| 62 void RegisterServiceWorkerOnIO(const GURL& pattern, |
| 63 const GURL& script_url, |
| 64 int source_process_id, |
| 65 const RegistrationCallback& continuation); |
| 66 void FinishRegistrationOnIO(const RegistrationCallback& continuation, |
| 67 ServiceWorkerStatusCode status, |
| 68 int64 registration_id); |
| 69 void UnregisterServiceWorkerOnIO(const GURL& pattern, |
| 70 int source_process_id, |
| 71 const UnregistrationCallback& continuation); |
| 72 void FinishUnregistrationOnIO(const RegistrationCallback& continuation, |
| 73 ServiceWorkerStatusCode status); |
| 74 |
49 scoped_ptr<ServiceWorkerContextCore> context_core_; | 75 scoped_ptr<ServiceWorkerContextCore> context_core_; |
50 }; | 76 }; |
51 | 77 |
52 } // namespace content | 78 } // namespace content |
53 | 79 |
54 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 80 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
OLD | NEW |