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

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

Issue 1909263002: Replace safe-bool idiom with explicit WeakPtr::operator bool() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698