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

Side by Side Diff: extensions/browser/api/bluetooth_low_energy/bluetooth_api_advertisement.cc

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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_low_energy/bluetooth_api_advertisemen t.h" 5 #include "extensions/browser/api/bluetooth_low_energy/bluetooth_api_advertisemen t.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "device/bluetooth/bluetooth_advertisement.h" 8 #include "device/bluetooth/bluetooth_advertisement.h"
9 #include "net/base/io_buffer.h" 9 #include "net/base/io_buffer.h"
10 10
11 namespace extensions { 11 namespace extensions {
12 12
13 // static 13 // static
14 static base::LazyInstance<BrowserContextKeyedAPIFactory< 14 static base::LazyInstance<BrowserContextKeyedAPIFactory<
15 ApiResourceManager<BluetoothApiAdvertisement>>> 15 ApiResourceManager<BluetoothApiAdvertisement>>>::DestructorAtExit
16 g_server_factory = LAZY_INSTANCE_INITIALIZER; 16 g_server_factory = LAZY_INSTANCE_INITIALIZER;
17 17
18 // static 18 // static
19 template <> 19 template <>
20 BrowserContextKeyedAPIFactory<ApiResourceManager<BluetoothApiAdvertisement>>* 20 BrowserContextKeyedAPIFactory<ApiResourceManager<BluetoothApiAdvertisement>>*
21 ApiResourceManager<BluetoothApiAdvertisement>::GetFactoryInstance() { 21 ApiResourceManager<BluetoothApiAdvertisement>::GetFactoryInstance() {
22 return g_server_factory.Pointer(); 22 return g_server_factory.Pointer();
23 } 23 }
24 24
25 BluetoothApiAdvertisement::BluetoothApiAdvertisement( 25 BluetoothApiAdvertisement::BluetoothApiAdvertisement(
26 const std::string& owner_extension_id, 26 const std::string& owner_extension_id,
27 scoped_refptr<device::BluetoothAdvertisement> advertisement) 27 scoped_refptr<device::BluetoothAdvertisement> advertisement)
28 : ApiResource(owner_extension_id), advertisement_(advertisement) { 28 : ApiResource(owner_extension_id), advertisement_(advertisement) {
29 DCHECK_CURRENTLY_ON(kThreadId); 29 DCHECK_CURRENTLY_ON(kThreadId);
30 } 30 }
31 31
32 BluetoothApiAdvertisement::~BluetoothApiAdvertisement() {} 32 BluetoothApiAdvertisement::~BluetoothApiAdvertisement() {}
33 33
34 } // namespace extensions 34 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698