OLD | NEW |
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 "extensions/browser/api/bluetooth/bluetooth_api.h" | 5 #include "extensions/browser/api/bluetooth/bluetooth_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 extensions::BluetoothEventRouter* GetEventRouter(BrowserContext* context) { | 38 extensions::BluetoothEventRouter* GetEventRouter(BrowserContext* context) { |
39 // Note: |context| is valid on UI thread only. | 39 // Note: |context| is valid on UI thread only. |
40 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 40 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
41 return extensions::BluetoothAPI::Get(context)->event_router(); | 41 return extensions::BluetoothAPI::Get(context)->event_router(); |
42 } | 42 } |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
46 namespace extensions { | 46 namespace extensions { |
47 | 47 |
48 static base::LazyInstance<BrowserContextKeyedAPIFactory<BluetoothAPI> > | 48 static base::LazyInstance< |
49 g_factory = LAZY_INSTANCE_INITIALIZER; | 49 BrowserContextKeyedAPIFactory<BluetoothAPI>>::DestructorAtExit g_factory = |
| 50 LAZY_INSTANCE_INITIALIZER; |
50 | 51 |
51 // static | 52 // static |
52 BrowserContextKeyedAPIFactory<BluetoothAPI>* | 53 BrowserContextKeyedAPIFactory<BluetoothAPI>* |
53 BluetoothAPI::GetFactoryInstance() { | 54 BluetoothAPI::GetFactoryInstance() { |
54 return g_factory.Pointer(); | 55 return g_factory.Pointer(); |
55 } | 56 } |
56 | 57 |
57 // static | 58 // static |
58 BluetoothAPI* BluetoothAPI::Get(BrowserContext* context) { | 59 BluetoothAPI* BluetoothAPI::Get(BrowserContext* context) { |
59 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 60 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ->StopDiscoverySession( | 197 ->StopDiscoverySession( |
197 adapter.get(), GetExtensionId(), | 198 adapter.get(), GetExtensionId(), |
198 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), | 199 base::Bind(&BluetoothStopDiscoveryFunction::OnSuccessCallback, this), |
199 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); | 200 base::Bind(&BluetoothStopDiscoveryFunction::OnErrorCallback, this)); |
200 | 201 |
201 return true; | 202 return true; |
202 } | 203 } |
203 | 204 |
204 } // namespace api | 205 } // namespace api |
205 } // namespace extensions | 206 } // namespace extensions |
OLD | NEW |