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_register_job.h" | 5 #include "content/browser/service_worker/service_worker_register_job.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "content/browser/service_worker/service_worker_context_core.h" | 10 #include "content/browser/service_worker/service_worker_context_core.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 void ServiceWorkerRegisterJob::set_registration( | 83 void ServiceWorkerRegisterJob::set_registration( |
84 ServiceWorkerRegistration* registration) { | 84 ServiceWorkerRegistration* registration) { |
85 DCHECK(phase_ == START || phase_ == REGISTER) << phase_; | 85 DCHECK(phase_ == START || phase_ == REGISTER) << phase_; |
86 DCHECK(!internal_.registration); | 86 DCHECK(!internal_.registration); |
87 internal_.registration = registration; | 87 internal_.registration = registration; |
88 } | 88 } |
89 | 89 |
90 ServiceWorkerRegistration* ServiceWorkerRegisterJob::registration() { | 90 ServiceWorkerRegistration* ServiceWorkerRegisterJob::registration() { |
91 DCHECK(phase_ >= REGISTER) << phase_; | 91 DCHECK(phase_ >= REGISTER) << phase_; |
92 DCHECK(internal_.registration); | |
93 return internal_.registration; | 92 return internal_.registration; |
94 } | 93 } |
95 | 94 |
96 void ServiceWorkerRegisterJob::set_pending_version( | 95 void ServiceWorkerRegisterJob::set_pending_version( |
97 ServiceWorkerVersion* version) { | 96 ServiceWorkerVersion* version) { |
98 DCHECK(phase_ == UPDATE) << phase_; | 97 DCHECK(phase_ == UPDATE) << phase_; |
99 DCHECK(!internal_.pending_version); | 98 DCHECK(!internal_.pending_version); |
100 internal_.pending_version = version; | 99 internal_.pending_version = version; |
101 } | 100 } |
102 | 101 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 !it->IsAtEnd(); | 406 !it->IsAtEnd(); |
408 it->Advance()) { | 407 it->Advance()) { |
409 ServiceWorkerProviderHost* provider_host = it->GetProviderHost(); | 408 ServiceWorkerProviderHost* provider_host = it->GetProviderHost(); |
410 if (ServiceWorkerUtils::ScopeMatches(pattern_, | 409 if (ServiceWorkerUtils::ScopeMatches(pattern_, |
411 provider_host->document_url())) | 410 provider_host->document_url())) |
412 provider_host->SetPendingVersion(version); | 411 provider_host->SetPendingVersion(version); |
413 } | 412 } |
414 } | 413 } |
415 | 414 |
416 } // namespace content | 415 } // namespace content |
OLD | NEW |