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_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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 get_ready_callback_->called = true; | 607 get_ready_callback_->called = true; |
| 608 return; | 608 return; |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 | 611 |
| 612 bool ServiceWorkerProviderHost::IsReadyToSendMessages() const { | 612 bool ServiceWorkerProviderHost::IsReadyToSendMessages() const { |
| 613 return render_thread_id_ != kInvalidEmbeddedWorkerThreadId; | 613 return render_thread_id_ != kInvalidEmbeddedWorkerThreadId; |
| 614 } | 614 } |
| 615 | 615 |
| 616 bool ServiceWorkerProviderHost::IsContextAlive() { | 616 bool ServiceWorkerProviderHost::IsContextAlive() { |
| 617 return context_ != NULL; | 617 return !!context_; |
|
Nico
2016/06/02 21:31:02
.
| |
| 618 } | 618 } |
| 619 | 619 |
| 620 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { | 620 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { |
| 621 DCHECK(dispatcher_host_); | 621 DCHECK(dispatcher_host_); |
| 622 DCHECK(IsReadyToSendMessages()); | 622 DCHECK(IsReadyToSendMessages()); |
| 623 dispatcher_host_->Send(message); | 623 dispatcher_host_->Send(message); |
| 624 } | 624 } |
| 625 | 625 |
| 626 void ServiceWorkerProviderHost::FinalizeInitialization( | 626 void ServiceWorkerProviderHost::FinalizeInitialization( |
| 627 int process_id, | 627 int process_id, |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 643 Send(new ServiceWorkerMsg_SetControllerServiceWorker( | 643 Send(new ServiceWorkerMsg_SetControllerServiceWorker( |
| 644 render_thread_id_, provider_id(), | 644 render_thread_id_, provider_id(), |
| 645 GetOrCreateServiceWorkerHandle( | 645 GetOrCreateServiceWorkerHandle( |
| 646 associated_registration_->active_version()), | 646 associated_registration_->active_version()), |
| 647 false /* shouldNotifyControllerChange */)); | 647 false /* shouldNotifyControllerChange */)); |
| 648 } | 648 } |
| 649 } | 649 } |
| 650 } | 650 } |
| 651 | 651 |
| 652 } // namespace content | 652 } // namespace content |
| OLD | NEW |