| 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" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 SendRegistrationInfo(registration_id, pattern, | 274 SendRegistrationInfo(registration_id, pattern, |
| 275 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); | 275 ServiceWorkerRegistrationInfo::IS_NOT_DELETED); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64_t registration_id, | 278 void ServiceWorkerContextWatcher::OnRegistrationDeleted(int64_t registration_id, |
| 279 const GURL& pattern) { | 279 const GURL& pattern) { |
| 280 SendRegistrationInfo(registration_id, pattern, | 280 SendRegistrationInfo(registration_id, pattern, |
| 281 ServiceWorkerRegistrationInfo::IS_DELETED); | 281 ServiceWorkerRegistrationInfo::IS_DELETED); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void ServiceWorkerContextWatcher::OnForceUpdateOnPageLoadChanged( | |
| 285 int64_t registration_id, | |
| 286 bool force_update_on_page_load) { | |
| 287 ServiceWorkerRegistration* registration = | |
| 288 context_->GetLiveRegistration(registration_id); | |
| 289 if (!registration) | |
| 290 return; | |
| 291 std::vector<ServiceWorkerRegistrationInfo> registrations; | |
| 292 registrations.push_back(registration->GetInfo()); | |
| 293 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | |
| 294 base::Bind(registration_callback_, registrations)); | |
| 295 } | |
| 296 | |
| 297 } // namespace content | 284 } // namespace content |
| OLD | NEW |