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

Side by Side Diff: content/browser/webui/web_ui_controller_factory_registry.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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) 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 "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/browser/frame_host/debug_urls.h" 8 #include "content/browser/frame_host/debug_urls.h"
9 #include "content/public/common/url_constants.h" 9 #include "content/public/common/url_constants.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
(...skipping 13 matching lines...) Expand all
24 for (size_t i = 0; i < factories->size(); ++i) { 24 for (size_t i = 0; i < factories->size(); ++i) {
25 if ((*factories)[i] == factory) { 25 if ((*factories)[i] == factory) {
26 factories->erase(factories->begin() + i); 26 factories->erase(factories->begin() + i);
27 return; 27 return;
28 } 28 }
29 } 29 }
30 NOTREACHED() << "Tried to unregister a factory but it wasn't found"; 30 NOTREACHED() << "Tried to unregister a factory but it wasn't found";
31 } 31 }
32 32
33 WebUIControllerFactoryRegistry* WebUIControllerFactoryRegistry::GetInstance() { 33 WebUIControllerFactoryRegistry* WebUIControllerFactoryRegistry::GetInstance() {
34 return Singleton<WebUIControllerFactoryRegistry>::get(); 34 return base::Singleton<WebUIControllerFactoryRegistry>::get();
35 } 35 }
36 36
37 WebUIController* WebUIControllerFactoryRegistry::CreateWebUIControllerForURL( 37 WebUIController* WebUIControllerFactoryRegistry::CreateWebUIControllerForURL(
38 WebUI* web_ui, const GURL& url) const { 38 WebUI* web_ui, const GURL& url) const {
39 std::vector<WebUIControllerFactory*>* factories = g_factories.Pointer(); 39 std::vector<WebUIControllerFactory*>* factories = g_factories.Pointer();
40 for (size_t i = 0; i < factories->size(); ++i) { 40 for (size_t i = 0; i < factories->size(); ++i) {
41 WebUIController* controller = (*factories)[i]->CreateWebUIControllerForURL( 41 WebUIController* controller = (*factories)[i]->CreateWebUIControllerForURL(
42 web_ui, url); 42 web_ui, url);
43 if (controller) 43 if (controller)
44 return controller; 44 return controller;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 IsRendererDebugURL(url); 88 IsRendererDebugURL(url);
89 } 89 }
90 90
91 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() { 91 WebUIControllerFactoryRegistry::WebUIControllerFactoryRegistry() {
92 } 92 }
93 93
94 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() { 94 WebUIControllerFactoryRegistry::~WebUIControllerFactoryRegistry() {
95 } 95 }
96 96
97 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/web_ui_controller_factory_registry.h ('k') | content/browser/zygote_host/zygote_host_impl_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698