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_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 bad_message::ReceivedBadMessage( | 824 bad_message::ReceivedBadMessage( |
825 this, bad_message::SWDH_SET_HOSTED_VERSION_NO_HOST); | 825 this, bad_message::SWDH_SET_HOSTED_VERSION_NO_HOST); |
826 return; | 826 return; |
827 } | 827 } |
828 if (!provider_host->IsContextAlive()) | 828 if (!provider_host->IsContextAlive()) |
829 return; | 829 return; |
830 | 830 |
831 // We might not be STARTING if the stop sequence was entered (STOPPING) or | 831 // We might not be STARTING if the stop sequence was entered (STOPPING) or |
832 // ended up being detached (STOPPED). | 832 // ended up being detached (STOPPED). |
833 ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id); | 833 ServiceWorkerVersion* version = GetContext()->GetLiveVersion(version_id); |
834 if (!version || version->running_status() != ServiceWorkerVersion::STARTING) | 834 if (!version || |
| 835 version->running_status() != |
| 836 ServiceWorkerVersion::RunningStatus::STARTING) { |
835 return; | 837 return; |
| 838 } |
836 | 839 |
837 if (!provider_host->SetHostedVersion(version)) { | 840 if (!provider_host->SetHostedVersion(version)) { |
838 bad_message::ReceivedBadMessage(this, bad_message::SWDH_SET_HOSTED_VERSION); | 841 bad_message::ReceivedBadMessage(this, bad_message::SWDH_SET_HOSTED_VERSION); |
839 return; | 842 return; |
840 } | 843 } |
841 | 844 |
842 // Retrieve the registration associated with |version|. The registration | 845 // Retrieve the registration associated with |version|. The registration |
843 // must be alive because the version keeps it during starting worker. | 846 // must be alive because the version keeps it during starting worker. |
844 ServiceWorkerRegistration* registration = | 847 ServiceWorkerRegistration* registration = |
845 GetContext()->GetLiveRegistration(version->registration_id()); | 848 GetContext()->GetLiveRegistration(version->registration_id()); |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 if (!handle) { | 1409 if (!handle) { |
1407 bad_message::ReceivedBadMessage(this, | 1410 bad_message::ReceivedBadMessage(this, |
1408 bad_message::SWDH_TERMINATE_BAD_HANDLE); | 1411 bad_message::SWDH_TERMINATE_BAD_HANDLE); |
1409 return; | 1412 return; |
1410 } | 1413 } |
1411 handle->version()->StopWorker( | 1414 handle->version()->StopWorker( |
1412 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); | 1415 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
1413 } | 1416 } |
1414 | 1417 |
1415 } // namespace content | 1418 } // namespace content |
OLD | NEW |