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

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

Issue 554573002: SWRegistration::unregister returns false when the registration is already unregistered. (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/message_port_message_filter.h" 9 #include "content/browser/message_port_message_filter.h"
10 #include "content/browser/message_port_service.h" 10 #include "content/browser/message_port_service.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 527 }
528 handle->DecrementRefCount(); 528 handle->DecrementRefCount();
529 if (handle->HasNoRefCount()) 529 if (handle->HasNoRefCount())
530 registration_handles_.Remove(registration_handle_id); 530 registration_handles_.Remove(registration_handle_id);
531 } 531 }
532 532
533 void ServiceWorkerDispatcherHost::UnregistrationComplete( 533 void ServiceWorkerDispatcherHost::UnregistrationComplete(
534 int thread_id, 534 int thread_id,
535 int request_id, 535 int request_id,
536 ServiceWorkerStatusCode status) { 536 ServiceWorkerStatusCode status) {
537 if (status != SERVICE_WORKER_OK) { 537 if (status != SERVICE_WORKER_OK && status != SERVICE_WORKER_ERROR_NOT_FOUND) {
538 SendUnregistrationError(thread_id, request_id, status); 538 SendUnregistrationError(thread_id, request_id, status);
539 return; 539 return;
540 } 540 }
541 541
542 Send(new ServiceWorkerMsg_ServiceWorkerUnregistered(thread_id, request_id)); 542 Send(new ServiceWorkerMsg_ServiceWorkerUnregistered(thread_id,
543 request_id,
544 status));
543 } 545 }
544 546
545 void ServiceWorkerDispatcherHost::SendRegistrationError( 547 void ServiceWorkerDispatcherHost::SendRegistrationError(
546 int thread_id, 548 int thread_id,
547 int request_id, 549 int request_id,
548 ServiceWorkerStatusCode status) { 550 ServiceWorkerStatusCode status) {
549 base::string16 error_message; 551 base::string16 error_message;
550 blink::WebServiceWorkerError::ErrorType error_type; 552 blink::WebServiceWorkerError::ErrorType error_type;
551 GetServiceWorkerRegistrationStatusResponse( 553 GetServiceWorkerRegistrationStatusResponse(
552 status, &error_type, &error_message); 554 status, &error_type, &error_message);
(...skipping 11 matching lines...) Expand all
564 status, &error_type, &error_message); 566 status, &error_type, &error_message);
565 Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError( 567 Send(new ServiceWorkerMsg_ServiceWorkerUnregistrationError(
566 thread_id, request_id, error_type, error_message)); 568 thread_id, request_id, error_type, error_message));
567 } 569 }
568 570
569 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { 571 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() {
570 return context_wrapper_->context(); 572 return context_wrapper_->context();
571 } 573 }
572 574
573 } // namespace content 575 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698