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/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "content/browser/message_port_message_filter.h" | 10 #include "content/browser/message_port_message_filter.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 ServiceWorkerMsg_SyncEvent(request_id)); | 390 ServiceWorkerMsg_SyncEvent(request_id)); |
391 if (status != SERVICE_WORKER_OK) { | 391 if (status != SERVICE_WORKER_OK) { |
392 sync_callbacks_.Remove(request_id); | 392 sync_callbacks_.Remove(request_id); |
393 RunSoon(base::Bind(callback, status)); | 393 RunSoon(base::Bind(callback, status)); |
394 } | 394 } |
395 } | 395 } |
396 | 396 |
397 void ServiceWorkerVersion::DispatchNotificationClickEvent( | 397 void ServiceWorkerVersion::DispatchNotificationClickEvent( |
398 const StatusCallback& callback, | 398 const StatusCallback& callback, |
399 const std::string& notification_id, | 399 const std::string& notification_id, |
400 const ShowDesktopNotificationHostMsgParams& notification_data) { | 400 const PlatformNotificationData& notification_data) { |
401 DCHECK_EQ(ACTIVATED, status()) << status(); | 401 DCHECK_EQ(ACTIVATED, status()) << status(); |
402 | 402 |
403 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 403 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
404 switches::kEnableExperimentalWebPlatformFeatures)) { | 404 switches::kEnableExperimentalWebPlatformFeatures)) { |
405 callback.Run(SERVICE_WORKER_ERROR_ABORT); | 405 callback.Run(SERVICE_WORKER_ERROR_ABORT); |
406 return; | 406 return; |
407 } | 407 } |
408 | 408 |
409 if (running_status() != RUNNING) { | 409 if (running_status() != RUNNING) { |
410 // Schedule calling this method after starting the worker. | 410 // Schedule calling this method after starting the worker. |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 SetStatus(REDUNDANT); | 898 SetStatus(REDUNDANT); |
899 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 899 StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
900 if (!context_) | 900 if (!context_) |
901 return; | 901 return; |
902 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; | 902 std::vector<ServiceWorkerDatabase::ResourceRecord> resources; |
903 script_cache_map_.GetResources(&resources); | 903 script_cache_map_.GetResources(&resources); |
904 context_->storage()->PurgeResources(resources); | 904 context_->storage()->PurgeResources(resources); |
905 } | 905 } |
906 | 906 |
907 } // namespace content | 907 } // namespace content |
OLD | NEW |