| 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 #include "content/browser/service_worker/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 ServiceWorkerMsg_SyncEvent(request_id)); | 453 ServiceWorkerMsg_SyncEvent(request_id)); |
| 454 if (status != SERVICE_WORKER_OK) { | 454 if (status != SERVICE_WORKER_OK) { |
| 455 sync_callbacks_.Remove(request_id); | 455 sync_callbacks_.Remove(request_id); |
| 456 RunSoon(base::Bind(callback, status)); | 456 RunSoon(base::Bind(callback, status)); |
| 457 } | 457 } |
| 458 } | 458 } |
| 459 | 459 |
| 460 void ServiceWorkerVersion::DispatchNotificationClickEvent( | 460 void ServiceWorkerVersion::DispatchNotificationClickEvent( |
| 461 const StatusCallback& callback, | 461 const StatusCallback& callback, |
| 462 const std::string& notification_id, | 462 const std::string& notification_id, |
| 463 const ShowDesktopNotificationHostMsgParams& notification_data) { | 463 const PlatformNotificationData& notification_data) { |
| 464 DCHECK_EQ(ACTIVATED, status()) << status(); | 464 DCHECK_EQ(ACTIVATED, status()) << status(); |
| 465 | 465 |
| 466 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 466 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 467 switches::kEnableExperimentalWebPlatformFeatures)) { | 467 switches::kEnableExperimentalWebPlatformFeatures)) { |
| 468 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 468 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
| 469 return; | 469 return; |
| 470 } | 470 } |
| 471 | 471 |
| 472 if (running_status() != RUNNING) { | 472 if (running_status() != RUNNING) { |
| 473 // Schedule calling this method after starting the worker. | 473 // Schedule calling this method after starting the worker. |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 SetStatus(REDUNDANT); | 1021 SetStatus(REDUNDANT); |
| 1022 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 1022 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
| 1023 if (!context_) | 1023 if (!context_) |
| 1024 return; | 1024 return; |
| 1025 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; | 1025 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; |
| 1026 script_cache_map_.GetResources(&resources); | 1026 script_cache_map_.GetResources(&resources); |
| 1027 context_->storage()->PurgeResources(resources); | 1027 context_->storage()->PurgeResources(resources); |
| 1028 } | 1028 } |
| 1029 | 1029 |
| 1030 } // namespace content | 1030 } // namespace content |
| OLD | NEW |