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

Side by Side Diff: extensions/browser/api/system_info/system_info_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/system_info/system_info_api.h" 5 #include "extensions/browser/api/system_info/system_info_api.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 void AddEventListener(const std::string& event_name) { 217 void AddEventListener(const std::string& event_name) {
218 SystemInfoEventRouter::GetInstance()->AddEventListener(event_name); 218 SystemInfoEventRouter::GetInstance()->AddEventListener(event_name);
219 } 219 }
220 220
221 void RemoveEventListener(const std::string& event_name) { 221 void RemoveEventListener(const std::string& event_name) {
222 SystemInfoEventRouter::GetInstance()->RemoveEventListener(event_name); 222 SystemInfoEventRouter::GetInstance()->RemoveEventListener(event_name);
223 } 223 }
224 224
225 } // namespace 225 } // namespace
226 226
227 static base::LazyInstance<BrowserContextKeyedAPIFactory<SystemInfoAPI> > 227 static base::LazyInstance<
228 g_factory = LAZY_INSTANCE_INITIALIZER; 228 BrowserContextKeyedAPIFactory<SystemInfoAPI>>::DestructorAtExit g_factory =
229 LAZY_INSTANCE_INITIALIZER;
229 230
230 // static 231 // static
231 BrowserContextKeyedAPIFactory<SystemInfoAPI>* 232 BrowserContextKeyedAPIFactory<SystemInfoAPI>*
232 SystemInfoAPI::GetFactoryInstance() { 233 SystemInfoAPI::GetFactoryInstance() {
233 return g_factory.Pointer(); 234 return g_factory.Pointer();
234 } 235 }
235 236
236 SystemInfoAPI::SystemInfoAPI(content::BrowserContext* context) 237 SystemInfoAPI::SystemInfoAPI(content::BrowserContext* context)
237 : browser_context_(context) { 238 : browser_context_(context) {
238 EventRouter* router = EventRouter::Get(browser_context_); 239 EventRouter* router = EventRouter::Get(browser_context_);
(...skipping 21 matching lines...) Expand all
260 void SystemInfoAPI::OnListenerRemoved(const EventListenerInfo& details) { 261 void SystemInfoAPI::OnListenerRemoved(const EventListenerInfo& details) {
261 if (IsSystemStorageEvent(details.event_name)) { 262 if (IsSystemStorageEvent(details.event_name)) {
262 StorageMonitor::GetInstance()->EnsureInitialized( 263 StorageMonitor::GetInstance()->EnsureInitialized(
263 base::Bind(&RemoveEventListener, details.event_name)); 264 base::Bind(&RemoveEventListener, details.event_name));
264 } else { 265 } else {
265 RemoveEventListener(details.event_name); 266 RemoveEventListener(details.event_name);
266 } 267 }
267 } 268 }
268 269
269 } // namespace extensions 270 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/system_cpu/cpu_info_provider.cc ('k') | extensions/browser/api/system_memory/memory_info_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698