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

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

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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_provider_host.h" 5 #include "content/browser/service_worker/service_worker_provider_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 ChangedVersionAttributesMask changed_mask, 508 ChangedVersionAttributesMask changed_mask,
509 ServiceWorkerVersion* installing_version, 509 ServiceWorkerVersion* installing_version,
510 ServiceWorkerVersion* waiting_version, 510 ServiceWorkerVersion* waiting_version,
511 ServiceWorkerVersion* active_version) { 511 ServiceWorkerVersion* active_version) {
512 if (!dispatcher_host_) 512 if (!dispatcher_host_)
513 return; // Could be nullptr in some tests. 513 return; // Could be nullptr in some tests.
514 if (!changed_mask.changed()) 514 if (!changed_mask.changed())
515 return; 515 return;
516 516
517 if (!IsReadyToSendMessages()) { 517 if (!IsReadyToSendMessages()) {
518 queued_events_.push_back( 518 queued_events_.push_back(base::Bind(
519 base::Bind(&ServiceWorkerProviderHost::SendSetVersionAttributesMessage, 519 &ServiceWorkerProviderHost::SendSetVersionAttributesMessage,
520 AsWeakPtr(), registration_handle_id, changed_mask, 520 AsWeakPtr(), registration_handle_id, changed_mask,
521 make_scoped_refptr(installing_version), 521 base::RetainedRef(installing_version),
522 make_scoped_refptr(waiting_version), 522 base::RetainedRef(waiting_version), base::RetainedRef(active_version)));
523 make_scoped_refptr(active_version)));
524 return; 523 return;
525 } 524 }
526 525
527 ServiceWorkerVersionAttributes attrs; 526 ServiceWorkerVersionAttributes attrs;
528 if (changed_mask.installing_changed()) 527 if (changed_mask.installing_changed())
529 attrs.installing = GetOrCreateServiceWorkerHandle(installing_version); 528 attrs.installing = GetOrCreateServiceWorkerHandle(installing_version);
530 if (changed_mask.waiting_changed()) 529 if (changed_mask.waiting_changed())
531 attrs.waiting = GetOrCreateServiceWorkerHandle(waiting_version); 530 attrs.waiting = GetOrCreateServiceWorkerHandle(waiting_version);
532 if (changed_mask.active_changed()) 531 if (changed_mask.active_changed())
533 attrs.active = GetOrCreateServiceWorkerHandle(active_version); 532 attrs.active = GetOrCreateServiceWorkerHandle(active_version);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 Send(new ServiceWorkerMsg_SetControllerServiceWorker( 649 Send(new ServiceWorkerMsg_SetControllerServiceWorker(
651 render_thread_id_, provider_id(), 650 render_thread_id_, provider_id(),
652 GetOrCreateServiceWorkerHandle( 651 GetOrCreateServiceWorkerHandle(
653 associated_registration_->active_version()), 652 associated_registration_->active_version()),
654 false /* shouldNotifyControllerChange */)); 653 false /* shouldNotifyControllerChange */));
655 } 654 }
656 } 655 }
657 } 656 }
658 657
659 } // namespace content 658 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698