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

Side by Side Diff: extensions/browser/api/bluetooth/bluetooth_api.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 (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
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
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
OLDNEW
« no previous file with comments | « extensions/browser/api/audio/audio_api.cc ('k') | extensions/browser/api/bluetooth/bluetooth_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698