Chromium Code Reviews| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 new_version()->script_cache_map()->main_script_status(); | 345 new_version()->script_cache_map()->main_script_status(); |
| 346 if (main_script_status.status() != net::URLRequestStatus::SUCCESS) { | 346 if (main_script_status.status() != net::URLRequestStatus::SUCCESS) { |
| 347 switch (main_script_status.error()) { | 347 switch (main_script_status.error()) { |
| 348 case net::ERR_INSECURE_RESPONSE: | 348 case net::ERR_INSECURE_RESPONSE: |
| 349 case net::ERR_UNSAFE_REDIRECT: | 349 case net::ERR_UNSAFE_REDIRECT: |
| 350 status = SERVICE_WORKER_ERROR_SECURITY; | 350 status = SERVICE_WORKER_ERROR_SECURITY; |
| 351 break; | 351 break; |
| 352 case net::ERR_ABORTED: | 352 case net::ERR_ABORTED: |
| 353 status = SERVICE_WORKER_ERROR_ABORT; | 353 status = SERVICE_WORKER_ERROR_ABORT; |
| 354 break; | 354 break; |
| 355 case net::ERR_FAILED: | 355 default: |
| 356 status = SERVICE_WORKER_ERROR_NETWORK; | 356 status = SERVICE_WORKER_ERROR_NETWORK; |
|
falken
2014/10/17 06:34:44
Can you help me understand what's going on here? W
horo
2014/10/17 07:15:51
main_script_status is set by NotifyFinishedCaching
falken
2014/10/17 07:23:17
OK I see.
| |
| 357 break; | |
| 358 default: | |
| 359 NOTREACHED(); | |
| 360 } | 357 } |
| 361 } | 358 } |
| 362 Complete(status); | 359 Complete(status); |
| 363 } | 360 } |
| 364 | 361 |
| 365 // This function corresponds to the spec's [[Install]] algorithm. | 362 // This function corresponds to the spec's [[Install]] algorithm. |
| 366 void ServiceWorkerRegisterJob::InstallAndContinue() { | 363 void ServiceWorkerRegisterJob::InstallAndContinue() { |
| 367 SetPhase(INSTALL); | 364 SetPhase(INSTALL); |
| 368 | 365 |
| 369 // "2. Set registration.installingWorker to worker." | 366 // "2. Set registration.installingWorker to worker." |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 554 ServiceWorkerProviderHost* host = it->GetProviderHost(); | 551 ServiceWorkerProviderHost* host = it->GetProviderHost(); |
| 555 if (ServiceWorkerUtils::ScopeMatches(registration->pattern(), | 552 if (ServiceWorkerUtils::ScopeMatches(registration->pattern(), |
| 556 host->document_url())) { | 553 host->document_url())) { |
| 557 if (host->CanAssociateRegistration(registration)) | 554 if (host->CanAssociateRegistration(registration)) |
| 558 host->AssociateRegistration(registration); | 555 host->AssociateRegistration(registration); |
| 559 } | 556 } |
| 560 } | 557 } |
| 561 } | 558 } |
| 562 | 559 |
| 563 } // namespace content | 560 } // namespace content |
| OLD | NEW |