OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "content/browser/service_worker/service_worker_context_watcher.h" | 5 #include "content/browser/service_worker/service_worker_context_watcher.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
11 #include "content/browser/service_worker/service_worker_context_observer.h" | 11 #include "content/browser/service_worker/service_worker_context_observer.h" |
12 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 12 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
13 #include "content/browser/service_worker/service_worker_version.h" | 13 #include "content/browser/service_worker/service_worker_version.h" |
14 #include "content/common/service_worker/service_worker_types.h" | 14 #include "content/common/service_worker/service_worker_types.h" |
15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
16 #include "content/public/common/console_message_level.h" | 16 #include "content/public/common/console_message_level.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 namespace { | 20 namespace { |
21 | 21 |
22 bool IsStoppedAndRedundant(const ServiceWorkerVersionInfo& version_info) { | 22 bool IsStoppedAndRedundant(const ServiceWorkerVersionInfo& version_info) { |
23 return version_info.running_status == | 23 return version_info.running_status == |
24 content::ServiceWorkerVersion::STOPPED && | 24 content::ServiceWorkerVersion::RunningStatus::STOPPED && |
25 version_info.status == content::ServiceWorkerVersion::REDUNDANT; | 25 version_info.status == content::ServiceWorkerVersion::REDUNDANT; |
26 } | 26 } |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 ServiceWorkerContextWatcher::ServiceWorkerContextWatcher( | 30 ServiceWorkerContextWatcher::ServiceWorkerContextWatcher( |
31 scoped_refptr<ServiceWorkerContextWrapper> context, | 31 scoped_refptr<ServiceWorkerContextWrapper> context, |
32 const WorkerRegistrationUpdatedCallback& registration_callback, | 32 const WorkerRegistrationUpdatedCallback& registration_callback, |
33 const WorkerVersionUpdatedCallback& version_callback, | 33 const WorkerVersionUpdatedCallback& version_callback, |
34 const WorkerErrorReportedCallback& error_callback) | 34 const WorkerErrorReportedCallback& error_callback) |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); | 278 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); |
279 } | 279 } |
280 | 280 |
281 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64_t registration_id, | 281 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64_t registration_id, |
282 const GURL& pattern) { | 282 const GURL& pattern) { |
283 SendRegistrationInfo(registration_id, pattern, | 283 SendRegistrationInfo(registration_id, pattern, |
284 ServiceWorkerRegistrationInfo::IS_DELETED); | 284 ServiceWorkerRegistrationInfo::IS_DELETED); |
285 } | 285 } |
286 | 286 |
287 } // namespace content | 287 } // namespace content |
OLD | NEW |