OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "content/browser/webui/web_ui_controller_factory_registry.h" | 5 #include "content/browser/webui/web_ui_controller_factory_registry.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "content/browser/frame_host/debug_urls.h" | 10 #include "content/browser/frame_host/debug_urls.h" |
11 #include "content/public/common/url_constants.h" | 11 #include "content/public/common/url_constants.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 base::LazyInstance<std::vector<WebUIControllerFactory*> > g_factories = | 16 base::LazyInstance<std::vector<WebUIControllerFactory*>>::DestructorAtExit |
17 LAZY_INSTANCE_INITIALIZER; | 17 g_factories = LAZY_INSTANCE_INITIALIZER; |
18 | 18 |
19 void WebUIControllerFactory::RegisterFactory(WebUIControllerFactory* factory) { | 19 void WebUIControllerFactory::RegisterFactory(WebUIControllerFactory* factory) { |
20 g_factories.Pointer()->push_back(factory); | 20 g_factories.Pointer()->push_back(factory); |
21 } | 21 } |
22 | 22 |
23 void WebUIControllerFactory::UnregisterFactoryForTesting( | 23 void WebUIControllerFactory::UnregisterFactoryForTesting( |
24 WebUIControllerFactory* factory) { | 24 WebUIControllerFactory* factory) { |
25 std::vector<WebUIControllerFactory*>* factories = g_factories.Pointer(); | 25 std::vector<WebUIControllerFactory*>* factories = g_factories.Pointer(); |
26 for (size_t i = 0; i < factories->size(); ++i) { | 26 for (size_t i = 0; i < factories->size(); ++i) { |
27 if ((*factories)[i] == factory) { | 27 if ((*factories)[i] == factory) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 IsRendererDebugURL(url); | 90 IsRendererDebugURL(url); |
91 } | 91 } |
92 | 92 |
93 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() { | 93 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() { |
94 } | 94 } |
95 | 95 |
96 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() { | 96 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() { |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |