Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / toolkit / components / build / nsToolkitCompsModule.cpp
blob81c98037d6c2d0761cea16de78df495c111a23ff
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is mozilla.org code.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 2001
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
22 * Joe Hewitt <hewitt@netscape.com> (Original Author)
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include "nsIGenericFactory.h"
39 #include "nsAppStartup.h"
40 #include "nsUserInfo.h"
41 #include "nsXPFEComponentsCID.h"
42 #include "nsToolkitCompsCID.h"
44 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
45 #include "nsParentalControlsServiceWin.h"
46 #endif
48 #ifdef ALERTS_SERVICE
49 #include "nsAlertsService.h"
50 #endif
52 #ifndef SUITE_USING_XPFE_DM
53 #ifdef MOZ_RDF
54 #include "nsDownloadManager.h"
55 #include "nsDownloadProxy.h"
56 #endif
57 #endif
59 #include "nsTypeAheadFind.h"
61 #ifdef MOZ_URL_CLASSIFIER
62 #include "nsUrlClassifierDBService.h"
63 #include "nsUrlClassifierStreamUpdater.h"
64 #include "nsUrlClassifierUtils.h"
65 #include "nsUrlClassifierHashCompleter.h"
66 #include "nsDocShellCID.h"
67 #endif
69 #ifdef MOZ_FEEDS
70 #include "nsScriptableUnescapeHTML.h"
71 #endif
73 /////////////////////////////////////////////////////////////////////////////
75 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup, Init)
76 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo)
78 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
79 NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsServiceWin)
80 #endif
82 #ifdef ALERTS_SERVICE
83 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
84 #endif
86 #ifndef SUITE_USING_XPFE_DM
87 #ifdef MOZ_RDF
88 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsDownloadManager,
89 nsDownloadManager::GetSingleton)
90 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy)
91 #endif
92 #endif
94 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
96 #ifdef MOZ_URL_CLASSIFIER
97 NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater)
98 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils, Init)
99 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierHashCompleter, Init)
101 static NS_IMETHODIMP
102 nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
103 void **aResult)
105 nsresult rv;
106 NS_ENSURE_ARG_POINTER(aResult);
107 NS_ENSURE_NO_AGGREGATION(aOuter);
109 nsUrlClassifierDBService *inst = nsUrlClassifierDBService::GetInstance(&rv);
110 if (NULL == inst) {
111 return rv;
113 /* NS_ADDREF(inst); */
114 rv = inst->QueryInterface(aIID, aResult);
115 NS_RELEASE(inst);
117 return rv;
119 #endif
121 #ifdef MOZ_FEEDS
122 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableUnescapeHTML)
123 #endif
125 /////////////////////////////////////////////////////////////////////////////
127 static const nsModuleComponentInfo components[] =
129 { "App Startup Service",
130 NS_TOOLKIT_APPSTARTUP_CID,
131 NS_APPSTARTUP_CONTRACTID,
132 nsAppStartupConstructor },
134 { "User Info Service",
135 NS_USERINFO_CID,
136 NS_USERINFO_CONTRACTID,
137 nsUserInfoConstructor },
138 #ifdef ALERTS_SERVICE
139 { "Alerts Service",
140 NS_ALERTSSERVICE_CID,
141 NS_ALERTSERVICE_CONTRACTID,
142 nsAlertsServiceConstructor },
143 #endif
144 #if defined(XP_WIN) && !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
145 { "Parental Controls Service",
146 NS_PARENTALCONTROLSSERVICE_CID,
147 NS_PARENTALCONTROLSSERVICE_CONTRACTID,
148 nsParentalControlsServiceWinConstructor },
149 #endif
150 #ifndef SUITE_USING_XPFE_DM
151 #ifdef MOZ_RDF
152 { "Download Manager",
153 NS_DOWNLOADMANAGER_CID,
154 NS_DOWNLOADMANAGER_CONTRACTID,
155 nsDownloadManagerConstructor },
156 { "Download",
157 NS_DOWNLOAD_CID,
158 NS_TRANSFER_CONTRACTID,
159 nsDownloadProxyConstructor },
160 #endif
161 #endif
162 { "TypeAheadFind Component",
163 NS_TYPEAHEADFIND_CID,
164 NS_TYPEAHEADFIND_CONTRACTID,
165 nsTypeAheadFindConstructor
167 #ifdef MOZ_URL_CLASSIFIER
168 { "Url Classifier DB Service",
169 NS_URLCLASSIFIERDBSERVICE_CID,
170 NS_URLCLASSIFIERDBSERVICE_CONTRACTID,
171 nsUrlClassifierDBServiceConstructor },
172 { "Url Classifier DB Service",
173 NS_URLCLASSIFIERDBSERVICE_CID,
174 NS_URICLASSIFIERSERVICE_CONTRACTID,
175 nsUrlClassifierDBServiceConstructor },
176 { "Url Classifier Stream Updater",
177 NS_URLCLASSIFIERSTREAMUPDATER_CID,
178 NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID,
179 nsUrlClassifierStreamUpdaterConstructor },
180 { "Url Classifier Utils",
181 NS_URLCLASSIFIERUTILS_CID,
182 NS_URLCLASSIFIERUTILS_CONTRACTID,
183 nsUrlClassifierUtilsConstructor },
184 { "Url Classifier Hash Completer",
185 NS_URLCLASSIFIERHASHCOMPLETER_CID,
186 NS_URLCLASSIFIERHASHCOMPLETER_CONTRACTID,
187 nsUrlClassifierHashCompleterConstructor },
188 #endif
189 #ifdef MOZ_FEEDS
190 { "Unescape HTML",
191 NS_SCRIPTABLEUNESCAPEHTML_CID,
192 NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID,
193 nsScriptableUnescapeHTMLConstructor },
194 #endif
197 NS_IMPL_NSGETMODULE(nsToolkitCompsModule, components)