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

Side by Side Diff: extensions/browser/api/hid/hid_device_manager.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/hid/hid_device_manager.h" 5 #include "extensions/browser/api/hid/hid_device_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <utility> 10 #include <utility>
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 } 106 }
107 107
108 HidDeviceManager::~HidDeviceManager() { 108 HidDeviceManager::~HidDeviceManager() {
109 DCHECK(thread_checker_.CalledOnValidThread()); 109 DCHECK(thread_checker_.CalledOnValidThread());
110 } 110 }
111 111
112 // static 112 // static
113 BrowserContextKeyedAPIFactory<HidDeviceManager>* 113 BrowserContextKeyedAPIFactory<HidDeviceManager>*
114 HidDeviceManager::GetFactoryInstance() { 114 HidDeviceManager::GetFactoryInstance() {
115 static base::LazyInstance<BrowserContextKeyedAPIFactory<HidDeviceManager> > 115 static base::LazyInstance<BrowserContextKeyedAPIFactory<HidDeviceManager>>::
116 factory = LAZY_INSTANCE_INITIALIZER; 116 DestructorAtExit factory = LAZY_INSTANCE_INITIALIZER;
117 return &factory.Get(); 117 return &factory.Get();
118 } 118 }
119 119
120 void HidDeviceManager::GetApiDevices( 120 void HidDeviceManager::GetApiDevices(
121 const Extension* extension, 121 const Extension* extension,
122 const std::vector<HidDeviceFilter>& filters, 122 const std::vector<HidDeviceFilter>& filters,
123 const GetApiDevicesCallback& callback) { 123 const GetApiDevicesCallback& callback) {
124 DCHECK(thread_checker_.CalledOnValidThread()); 124 DCHECK(thread_checker_.CalledOnValidThread());
125 LazyInitialize(); 125 LazyInitialize();
126 126
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 std::unique_ptr<base::ListValue> event_args, 335 std::unique_ptr<base::ListValue> event_args,
336 scoped_refptr<HidDeviceInfo> device_info) { 336 scoped_refptr<HidDeviceInfo> device_info) {
337 std::unique_ptr<Event> event( 337 std::unique_ptr<Event> event(
338 new Event(histogram_value, event_name, std::move(event_args))); 338 new Event(histogram_value, event_name, std::move(event_args)));
339 event->will_dispatch_callback = base::Bind( 339 event->will_dispatch_callback = base::Bind(
340 &WillDispatchDeviceEvent, weak_factory_.GetWeakPtr(), device_info); 340 &WillDispatchDeviceEvent, weak_factory_.GetWeakPtr(), device_info);
341 event_router_->BroadcastEvent(std::move(event)); 341 event_router_->BroadcastEvent(std::move(event));
342 } 342 }
343 343
344 } // namespace extensions 344 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/hid/hid_connection_resource.cc ('k') | extensions/browser/api/management/management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698