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

Side by Side Diff: device/bluetooth/bluetooth_adapter_factory_wrapper.h

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_
7 7
8 #include <unordered_set> 8 #include <unordered_set>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 BluetoothAdapter* GetAdapter(BluetoothAdapter::Observer* observer); 49 BluetoothAdapter* GetAdapter(BluetoothAdapter::Observer* observer);
50 50
51 // Sets a new BluetoothAdapter to be returned by GetAdapter. When setting 51 // Sets a new BluetoothAdapter to be returned by GetAdapter. When setting
52 // a new adapter all observers from the old adapter are removed and added 52 // a new adapter all observers from the old adapter are removed and added
53 // to |mock_adapter|. 53 // to |mock_adapter|.
54 void SetBluetoothAdapterForTesting( 54 void SetBluetoothAdapterForTesting(
55 scoped_refptr<BluetoothAdapter> mock_adapter); 55 scoped_refptr<BluetoothAdapter> mock_adapter);
56 56
57 private: 57 private:
58 // friend LazyInstance to permit access to private constructor. 58 // friend LazyInstance to permit access to private constructor.
59 friend base::DefaultLazyInstanceTraits<BluetoothAdapterFactoryWrapper>; 59 friend base::LazyInstanceTraitsBase<BluetoothAdapterFactoryWrapper>;
60 60
61 BluetoothAdapterFactoryWrapper(); 61 BluetoothAdapterFactoryWrapper();
62 62
63 void OnGetAdapter(const AcquireAdapterCallback& continuation, 63 void OnGetAdapter(const AcquireAdapterCallback& continuation,
64 scoped_refptr<BluetoothAdapter> adapter); 64 scoped_refptr<BluetoothAdapter> adapter);
65 65
66 bool HasAdapter(BluetoothAdapter::Observer* observer); 66 bool HasAdapter(BluetoothAdapter::Observer* observer);
67 void AddAdapterObserver(BluetoothAdapter::Observer* observer); 67 void AddAdapterObserver(BluetoothAdapter::Observer* observer);
68 void RemoveAdapterObserver(BluetoothAdapter::Observer* observer); 68 void RemoveAdapterObserver(BluetoothAdapter::Observer* observer);
69 69
(...skipping 17 matching lines...) Expand all
87 // Note: This should remain the last member so it'll be destroyed and 87 // Note: This should remain the last member so it'll be destroyed and
88 // invalidate its weak pointers before any other members are destroyed. 88 // invalidate its weak pointers before any other members are destroyed.
89 base::WeakPtrFactory<BluetoothAdapterFactoryWrapper> weak_ptr_factory_; 89 base::WeakPtrFactory<BluetoothAdapterFactoryWrapper> weak_ptr_factory_;
90 90
91 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterFactoryWrapper); 91 DISALLOW_COPY_AND_ASSIGN(BluetoothAdapterFactoryWrapper);
92 }; 92 };
93 93
94 } // namespace device 94 } // namespace device
95 95
96 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_ 96 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_FACTORY_WRAPPER_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_adapter_factory.cc ('k') | device/bluetooth/bluetooth_socket_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698