OLD | NEW |
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 "ios/web/webui/web_ui_ios_controller_factory_registry.h" | 5 #include "ios/web/webui/web_ui_ios_controller_factory_registry.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
11 #include "ios/web/public/webui/web_ui_ios_controller.h" | 11 #include "ios/web/public/webui/web_ui_ios_controller.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 #include "url/url_constants.h" | 13 #include "url/url_constants.h" |
14 | 14 |
15 namespace web { | 15 namespace web { |
16 | 16 |
17 base::LazyInstance<std::vector<WebUIIOSControllerFactory*>> g_factories = | 17 base::LazyInstance<std::vector<WebUIIOSControllerFactory*>>::DestructorAtExit |
18 LAZY_INSTANCE_INITIALIZER; | 18 g_factories = LAZY_INSTANCE_INITIALIZER; |
19 | 19 |
20 void WebUIIOSControllerFactory::RegisterFactory( | 20 void WebUIIOSControllerFactory::RegisterFactory( |
21 WebUIIOSControllerFactory* factory) { | 21 WebUIIOSControllerFactory* factory) { |
22 g_factories.Pointer()->push_back(factory); | 22 g_factories.Pointer()->push_back(factory); |
23 } | 23 } |
24 | 24 |
25 WebUIIOSControllerFactoryRegistry* | 25 WebUIIOSControllerFactoryRegistry* |
26 WebUIIOSControllerFactoryRegistry::GetInstance() { | 26 WebUIIOSControllerFactoryRegistry::GetInstance() { |
27 return base::Singleton<WebUIIOSControllerFactoryRegistry>::get(); | 27 return base::Singleton<WebUIIOSControllerFactoryRegistry>::get(); |
28 } | 28 } |
(...skipping 11 matching lines...) Expand all Loading... |
40 return nullptr; | 40 return nullptr; |
41 } | 41 } |
42 | 42 |
43 WebUIIOSControllerFactoryRegistry::WebUIIOSControllerFactoryRegistry() { | 43 WebUIIOSControllerFactoryRegistry::WebUIIOSControllerFactoryRegistry() { |
44 } | 44 } |
45 | 45 |
46 WebUIIOSControllerFactoryRegistry::~WebUIIOSControllerFactoryRegistry() { | 46 WebUIIOSControllerFactoryRegistry::~WebUIIOSControllerFactoryRegistry() { |
47 } | 47 } |
48 | 48 |
49 } // namespace web | 49 } // namespace web |
OLD | NEW |