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

Side by Side Diff: device/bluetooth/bluetooth_adapter_factory.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "device/bluetooth/bluetooth_adapter_factory.h" 5 #include "device/bluetooth/bluetooth_adapter_factory.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 #endif 98 #endif
99 99
100 // static 100 // static
101 void BluetoothAdapterFactory::SetAdapterForTesting( 101 void BluetoothAdapterFactory::SetAdapterForTesting(
102 scoped_refptr<BluetoothAdapter> adapter) { 102 scoped_refptr<BluetoothAdapter> adapter) {
103 default_adapter.Get() = adapter->GetWeakPtrForTesting(); 103 default_adapter.Get() = adapter->GetWeakPtrForTesting();
104 } 104 }
105 105
106 // static 106 // static
107 bool BluetoothAdapterFactory::HasSharedInstanceForTesting() { 107 bool BluetoothAdapterFactory::HasSharedInstanceForTesting() {
108 return default_adapter.Get(); 108 return !!default_adapter.Get();
Nico 2016/06/02 21:31:02 .
109 } 109 }
110 110
111 } // namespace device 111 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698