Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: content/browser/service_worker/service_worker_register_job.cc

Issue 1030103003: Report error messages to DevTools window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated falken's comment Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 void ServiceWorkerRegisterJob::CompleteInternal( 452 void ServiceWorkerRegisterJob::CompleteInternal(
453 ServiceWorkerStatusCode status, 453 ServiceWorkerStatusCode status,
454 const std::string& status_message) { 454 const std::string& status_message) {
455 SetPhase(COMPLETE); 455 SetPhase(COMPLETE);
456 if (status != SERVICE_WORKER_OK) { 456 if (status != SERVICE_WORKER_OK) {
457 if (registration()) { 457 if (registration()) {
458 if (should_uninstall_on_failure_) 458 if (should_uninstall_on_failure_)
459 registration()->ClearWhenReady(); 459 registration()->ClearWhenReady();
460 if (new_version()) { 460 if (new_version()) {
461 if (status != SERVICE_WORKER_ERROR_EXISTS)
462 new_version()->ReportError(status, status_message);
461 registration()->UnsetVersion(new_version()); 463 registration()->UnsetVersion(new_version());
462 new_version()->Doom(); 464 new_version()->Doom();
463 } 465 }
464 if (!registration()->waiting_version() && 466 if (!registration()->waiting_version() &&
465 !registration()->active_version()) { 467 !registration()->active_version()) {
466 registration()->NotifyRegistrationFailed(); 468 registration()->NotifyRegistrationFailed();
467 context_->storage()->DeleteRegistration( 469 context_->storage()->DeleteRegistration(
468 registration()->id(), 470 registration()->id(),
469 registration()->pattern().GetOrigin(), 471 registration()->pattern().GetOrigin(),
470 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 472 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 if (host->IsHostToRunningServiceWorker()) 560 if (host->IsHostToRunningServiceWorker())
559 continue; 561 continue;
560 if (!ServiceWorkerUtils::ScopeMatches(registration->pattern(), 562 if (!ServiceWorkerUtils::ScopeMatches(registration->pattern(),
561 host->document_url())) 563 host->document_url()))
562 continue; 564 continue;
563 host->AddMatchingRegistration(registration); 565 host->AddMatchingRegistration(registration);
564 } 566 }
565 } 567 }
566 568
567 } // namespace content 569 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698