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

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

Issue 1307133003: ServiceWorker: Make APIs that return ServiceWorkerRegistration coin a new JS object (2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split CreateRegistration() Created 5 years, 4 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 "base/guid.h" 7 #include "base/guid.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 for (const auto& event : queued_events_) 616 for (const auto& event : queued_events_)
617 event.Run(); 617 event.Run();
618 queued_events_.clear(); 618 queued_events_.clear();
619 } 619 }
620 620
621 void ServiceWorkerProviderHost::SendAssociateRegistrationMessage() { 621 void ServiceWorkerProviderHost::SendAssociateRegistrationMessage() {
622 if (!dispatcher_host_) 622 if (!dispatcher_host_)
623 return; 623 return;
624 624
625 ServiceWorkerRegistrationHandle* handle = 625 ServiceWorkerRegistrationHandle* handle =
626 dispatcher_host_->GetOrCreateRegistrationHandle( 626 dispatcher_host_->CreateRegistrationHandle(
627 AsWeakPtr(), associated_registration_.get()); 627 AsWeakPtr(), associated_registration_.get());
628 628
629 ServiceWorkerVersionAttributes attrs; 629 ServiceWorkerVersionAttributes attrs;
630 attrs.installing = GetOrCreateServiceWorkerHandle( 630 attrs.installing = GetOrCreateServiceWorkerHandle(
631 associated_registration_->installing_version()); 631 associated_registration_->installing_version());
632 attrs.waiting = GetOrCreateServiceWorkerHandle( 632 attrs.waiting = GetOrCreateServiceWorkerHandle(
633 associated_registration_->waiting_version()); 633 associated_registration_->waiting_version());
634 attrs.active = GetOrCreateServiceWorkerHandle( 634 attrs.active = GetOrCreateServiceWorkerHandle(
635 associated_registration_->active_version()); 635 associated_registration_->active_version());
636 636
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 return context_ != NULL; 678 return context_ != NULL;
679 } 679 }
680 680
681 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { 681 void ServiceWorkerProviderHost::Send(IPC::Message* message) const {
682 DCHECK(dispatcher_host_); 682 DCHECK(dispatcher_host_);
683 DCHECK(IsReadyToSendMessages()); 683 DCHECK(IsReadyToSendMessages());
684 dispatcher_host_->Send(message); 684 dispatcher_host_->Send(message);
685 } 685 }
686 686
687 } // namespace content 687 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698