| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 get_ready_callback_->called = true; | 632 get_ready_callback_->called = true; |
| 633 return; | 633 return; |
| 634 } | 634 } |
| 635 } | 635 } |
| 636 | 636 |
| 637 bool ServiceWorkerProviderHost::IsReadyToSendMessages() const { | 637 bool ServiceWorkerProviderHost::IsReadyToSendMessages() const { |
| 638 return render_thread_id_ != kInvalidEmbeddedWorkerThreadId; | 638 return render_thread_id_ != kInvalidEmbeddedWorkerThreadId; |
| 639 } | 639 } |
| 640 | 640 |
| 641 bool ServiceWorkerProviderHost::IsContextAlive() { | 641 bool ServiceWorkerProviderHost::IsContextAlive() { |
| 642 return context_ != NULL; | 642 return context_ != nullptr; |
| 643 } | 643 } |
| 644 | 644 |
| 645 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { | 645 void ServiceWorkerProviderHost::Send(IPC::Message* message) const { |
| 646 DCHECK(dispatcher_host_); | 646 DCHECK(dispatcher_host_); |
| 647 DCHECK(IsReadyToSendMessages()); | 647 DCHECK(IsReadyToSendMessages()); |
| 648 dispatcher_host_->Send(message); | 648 dispatcher_host_->Send(message); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void ServiceWorkerProviderHost::FinalizeInitialization( | 651 void ServiceWorkerProviderHost::FinalizeInitialization( |
| 652 int process_id, | 652 int process_id, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 668 Send(new ServiceWorkerMsg_SetControllerServiceWorker( | 668 Send(new ServiceWorkerMsg_SetControllerServiceWorker( |
| 669 render_thread_id_, provider_id(), | 669 render_thread_id_, provider_id(), |
| 670 GetOrCreateServiceWorkerHandle( | 670 GetOrCreateServiceWorkerHandle( |
| 671 associated_registration_->active_version()), | 671 associated_registration_->active_version()), |
| 672 false /* shouldNotifyControllerChange */)); | 672 false /* shouldNotifyControllerChange */)); |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 } | 675 } |
| 676 | 676 |
| 677 } // namespace content | 677 } // namespace content |
| OLD | NEW |