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

Side by Side Diff: extensions/browser/api/management/management_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/management/management_api.h" 5 #include "extensions/browser/api/management/management_api.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 event_router->RegisterObserver(this, management::OnDisabled::kEventName); 850 event_router->RegisterObserver(this, management::OnDisabled::kEventName);
851 } 851 }
852 852
853 ManagementAPI::~ManagementAPI() { 853 ManagementAPI::~ManagementAPI() {
854 } 854 }
855 855
856 void ManagementAPI::Shutdown() { 856 void ManagementAPI::Shutdown() {
857 EventRouter::Get(browser_context_)->UnregisterObserver(this); 857 EventRouter::Get(browser_context_)->UnregisterObserver(this);
858 } 858 }
859 859
860 static base::LazyInstance<BrowserContextKeyedAPIFactory<ManagementAPI>> 860 static base::LazyInstance<
861 g_factory = LAZY_INSTANCE_INITIALIZER; 861 BrowserContextKeyedAPIFactory<ManagementAPI>>::DestructorAtExit g_factory =
862 LAZY_INSTANCE_INITIALIZER;
862 863
863 // static 864 // static
864 BrowserContextKeyedAPIFactory<ManagementAPI>* 865 BrowserContextKeyedAPIFactory<ManagementAPI>*
865 ManagementAPI::GetFactoryInstance() { 866 ManagementAPI::GetFactoryInstance() {
866 return g_factory.Pointer(); 867 return g_factory.Pointer();
867 } 868 }
868 869
869 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) { 870 void ManagementAPI::OnListenerAdded(const EventListenerInfo& details) {
870 management_event_router_.reset(new ManagementEventRouter(browser_context_)); 871 management_event_router_.reset(new ManagementEventRouter(browser_context_));
871 EventRouter::Get(browser_context_)->UnregisterObserver(this); 872 EventRouter::Get(browser_context_)->UnregisterObserver(this);
872 } 873 }
873 874
874 } // namespace extensions 875 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/hid/hid_device_manager.cc ('k') | extensions/browser/api/power/power_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698