| 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_REGISTER_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 119 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 120 | 120 |
| 121 // Associates an installing version to documents matched with a scope of the | 121 // Associates an installing version to documents matched with a scope of the |
| 122 // version. | 122 // version. |
| 123 CONTENT_EXPORT static void AssociateInstallingVersionToDocuments( | 123 CONTENT_EXPORT static void AssociateInstallingVersionToDocuments( |
| 124 base::WeakPtr<ServiceWorkerContextCore> context, | 124 base::WeakPtr<ServiceWorkerContextCore> context, |
| 125 ServiceWorkerVersion* version); | 125 ServiceWorkerVersion* version); |
| 126 | 126 |
| 127 // Associates a waiting version to documents matched with a scope of the | 127 // Associates a waiting version to documents matched with a scope of the |
| 128 // version. | 128 // version. |
| 129 CONTENT_EXPORT static void AssociateWaitingVersionToDocuments( | 129 static void AssociateWaitingVersionToDocuments( |
| 130 base::WeakPtr<ServiceWorkerContextCore> context, | 130 base::WeakPtr<ServiceWorkerContextCore> context, |
| 131 ServiceWorkerVersion* version); | 131 ServiceWorkerVersion* version); |
| 132 | 132 |
| 133 // Associates an active version to documents matched with a scope of the |
| 134 // version. |
| 135 static void AssociateActiveVersionToDocuments( |
| 136 base::WeakPtr<ServiceWorkerContextCore> context, |
| 137 ServiceWorkerVersion* version); |
| 138 |
| 133 // Disassociates a version specified by |version_id| from documents. | 139 // Disassociates a version specified by |version_id| from documents. |
| 134 CONTENT_EXPORT static void DisassociateVersionFromDocuments( | 140 CONTENT_EXPORT static void DisassociateVersionFromDocuments( |
| 135 base::WeakPtr<ServiceWorkerContextCore> context, | 141 base::WeakPtr<ServiceWorkerContextCore> context, |
| 136 ServiceWorkerVersion* version); | 142 ServiceWorkerVersion* version); |
| 137 | 143 |
| 138 // The ServiceWorkerContextCore object should always outlive this. | 144 // The ServiceWorkerContextCore object should always outlive this. |
| 139 base::WeakPtr<ServiceWorkerContextCore> context_; | 145 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 140 | 146 |
| 141 const GURL pattern_; | 147 const GURL pattern_; |
| 142 const GURL script_url_; | 148 const GURL script_url_; |
| 143 std::vector<RegistrationCallback> callbacks_; | 149 std::vector<RegistrationCallback> callbacks_; |
| 144 std::vector<int> pending_process_ids_; | 150 std::vector<int> pending_process_ids_; |
| 145 Phase phase_; | 151 Phase phase_; |
| 146 Internal internal_; | 152 Internal internal_; |
| 147 bool is_promise_resolved_; | 153 bool is_promise_resolved_; |
| 148 ServiceWorkerStatusCode promise_resolved_status_; | 154 ServiceWorkerStatusCode promise_resolved_status_; |
| 149 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; | 155 scoped_refptr<ServiceWorkerRegistration> promise_resolved_registration_; |
| 150 scoped_refptr<ServiceWorkerVersion> promise_resolved_version_; | 156 scoped_refptr<ServiceWorkerVersion> promise_resolved_version_; |
| 151 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; | 157 base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_; |
| 152 | 158 |
| 153 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); | 159 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob); |
| 154 }; | 160 }; |
| 155 | 161 |
| 156 } // namespace content | 162 } // namespace content |
| 157 | 163 |
| 158 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ | 164 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTER_JOB_H_ |
| OLD | NEW |