Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "base/basictypes.h" |
michael@0 | 7 | |
michael@0 | 8 | #include "XPCModule.h" |
michael@0 | 9 | #include "mozilla/ModuleUtils.h" |
michael@0 | 10 | #include "nsImageModule.h" |
michael@0 | 11 | #include "nsLayoutStatics.h" |
michael@0 | 12 | #include "nsContentCID.h" |
michael@0 | 13 | #include "nsContentDLF.h" |
michael@0 | 14 | #include "nsContentPolicyUtils.h" |
michael@0 | 15 | #include "nsDataDocumentContentPolicy.h" |
michael@0 | 16 | #include "nsNoDataProtocolContentPolicy.h" |
michael@0 | 17 | #include "nsDOMCID.h" |
michael@0 | 18 | #include "nsHTMLContentSerializer.h" |
michael@0 | 19 | #include "nsHTMLParts.h" |
michael@0 | 20 | #include "nsIComponentManager.h" |
michael@0 | 21 | #include "nsIContentIterator.h" |
michael@0 | 22 | #include "nsIContentSerializer.h" |
michael@0 | 23 | #include "nsIContentViewer.h" |
michael@0 | 24 | #include "nsIController.h" |
michael@0 | 25 | #include "nsIControllers.h" |
michael@0 | 26 | #include "nsIDOMDOMImplementation.h" |
michael@0 | 27 | #include "nsIDocument.h" |
michael@0 | 28 | #include "nsIDocumentEncoder.h" |
michael@0 | 29 | #include "nsIFactory.h" |
michael@0 | 30 | #include "nsIFrameUtil.h" |
michael@0 | 31 | #include "nsHTMLStyleSheet.h" |
michael@0 | 32 | #include "nsILayoutDebugger.h" |
michael@0 | 33 | #include "nsNameSpaceManager.h" |
michael@0 | 34 | #include "nsINodeInfo.h" |
michael@0 | 35 | #include "nsIObserver.h" |
michael@0 | 36 | #include "nsIObserverService.h" |
michael@0 | 37 | #include "nsIScriptNameSpaceManager.h" |
michael@0 | 38 | #include "nsISelection.h" |
michael@0 | 39 | #include "nsCaret.h" |
michael@0 | 40 | #include "nsPlainTextSerializer.h" |
michael@0 | 41 | #include "nsXMLContentSerializer.h" |
michael@0 | 42 | #include "nsXHTMLContentSerializer.h" |
michael@0 | 43 | #include "nsRuleNode.h" |
michael@0 | 44 | #include "nsContentAreaDragDrop.h" |
michael@0 | 45 | #include "nsContentList.h" |
michael@0 | 46 | #include "nsBox.h" |
michael@0 | 47 | #include "nsIFrameTraversal.h" |
michael@0 | 48 | #include "nsLayoutCID.h" |
michael@0 | 49 | #include "nsStyleSheetService.h" |
michael@0 | 50 | #include "nsFocusManager.h" |
michael@0 | 51 | #include "ThirdPartyUtil.h" |
michael@0 | 52 | #include "nsStructuredCloneContainer.h" |
michael@0 | 53 | |
michael@0 | 54 | #include "nsIEventListenerService.h" |
michael@0 | 55 | #include "nsIMessageManager.h" |
michael@0 | 56 | |
michael@0 | 57 | // Transformiix stuff |
michael@0 | 58 | #include "mozilla/dom/XPathEvaluator.h" |
michael@0 | 59 | #include "txMozillaXSLTProcessor.h" |
michael@0 | 60 | #include "txNodeSetAdaptor.h" |
michael@0 | 61 | |
michael@0 | 62 | #include "mozilla/dom/DOMParser.h" |
michael@0 | 63 | #include "nsDOMSerializer.h" |
michael@0 | 64 | #include "nsXMLHttpRequest.h" |
michael@0 | 65 | #include "nsChannelPolicy.h" |
michael@0 | 66 | |
michael@0 | 67 | // view stuff |
michael@0 | 68 | #include "nsContentCreatorFunctions.h" |
michael@0 | 69 | |
michael@0 | 70 | // DOM includes |
michael@0 | 71 | #include "nsDOMBlobBuilder.h" |
michael@0 | 72 | #include "nsDOMFileReader.h" |
michael@0 | 73 | |
michael@0 | 74 | #include "gfxPlatform.h" |
michael@0 | 75 | #include "nsFormData.h" |
michael@0 | 76 | #include "nsHostObjectProtocolHandler.h" |
michael@0 | 77 | #include "nsHostObjectURI.h" |
michael@0 | 78 | #include "nsGlobalWindowCommands.h" |
michael@0 | 79 | #include "nsIControllerCommandTable.h" |
michael@0 | 80 | #include "nsJSProtocolHandler.h" |
michael@0 | 81 | #include "nsScriptNameSpaceManager.h" |
michael@0 | 82 | #include "nsIControllerContext.h" |
michael@0 | 83 | #include "nsDOMScriptObjectFactory.h" |
michael@0 | 84 | #include "DOMStorageManager.h" |
michael@0 | 85 | #include "nsJSON.h" |
michael@0 | 86 | #include "nsZipArchive.h" |
michael@0 | 87 | #include "mozIApplicationClearPrivateDataParams.h" |
michael@0 | 88 | #include "mozilla/Attributes.h" |
michael@0 | 89 | #include "mozilla/dom/DOMException.h" |
michael@0 | 90 | #include "mozilla/dom/DOMRequest.h" |
michael@0 | 91 | #include "mozilla/dom/indexedDB/IndexedDatabaseManager.h" |
michael@0 | 92 | #include "mozilla/dom/network/TCPSocketChild.h" |
michael@0 | 93 | #include "mozilla/dom/network/TCPSocketParent.h" |
michael@0 | 94 | #include "mozilla/dom/network/TCPServerSocketChild.h" |
michael@0 | 95 | #include "mozilla/dom/network/UDPSocketChild.h" |
michael@0 | 96 | #include "mozilla/dom/quota/QuotaManager.h" |
michael@0 | 97 | #include "mozilla/OSFileConstants.h" |
michael@0 | 98 | #include "mozilla/Services.h" |
michael@0 | 99 | |
michael@0 | 100 | #ifdef MOZ_WEBSPEECH |
michael@0 | 101 | #include "mozilla/dom/FakeSpeechRecognitionService.h" |
michael@0 | 102 | #include "mozilla/dom/nsSynthVoiceRegistry.h" |
michael@0 | 103 | #endif |
michael@0 | 104 | |
michael@0 | 105 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 106 | #include "SystemWorkerManager.h" |
michael@0 | 107 | using mozilla::dom::gonk::SystemWorkerManager; |
michael@0 | 108 | #define SYSTEMWORKERMANAGER_CID \ |
michael@0 | 109 | {0xd53b6524, 0x6ac3, 0x42b0, {0xae, 0xca, 0x62, 0xb3, 0xc4, 0xe5, 0x2b, 0x04}} |
michael@0 | 110 | #define SYSTEMWORKERMANAGER_CONTRACTID \ |
michael@0 | 111 | "@mozilla.org/telephony/system-worker-manager;1" |
michael@0 | 112 | #endif |
michael@0 | 113 | |
michael@0 | 114 | #ifdef MOZ_B2G_BT |
michael@0 | 115 | #include "BluetoothService.h" |
michael@0 | 116 | using mozilla::dom::bluetooth::BluetoothService; |
michael@0 | 117 | #define BLUETOOTHSERVICE_CID \ |
michael@0 | 118 | {0xa753b487, 0x3344, 0x4de4, {0xad, 0x5f, 0x06, 0x36, 0x76, 0xa7, 0xc1, 0x04}} |
michael@0 | 119 | #define BLUETOOTHSERVICE_CONTRACTID \ |
michael@0 | 120 | "@mozilla.org/bluetooth/service;1" |
michael@0 | 121 | #endif |
michael@0 | 122 | |
michael@0 | 123 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 124 | #include "AudioManager.h" |
michael@0 | 125 | using mozilla::dom::gonk::AudioManager; |
michael@0 | 126 | #include "nsVolumeService.h" |
michael@0 | 127 | using mozilla::system::nsVolumeService; |
michael@0 | 128 | #endif |
michael@0 | 129 | |
michael@0 | 130 | #include "AudioChannelAgent.h" |
michael@0 | 131 | using mozilla::dom::AudioChannelAgent; |
michael@0 | 132 | |
michael@0 | 133 | // Editor stuff |
michael@0 | 134 | #include "nsEditorCID.h" |
michael@0 | 135 | #include "nsEditor.h" |
michael@0 | 136 | #include "nsPlaintextEditor.h" |
michael@0 | 137 | #include "nsEditorController.h" //CID |
michael@0 | 138 | |
michael@0 | 139 | #include "nsHTMLEditor.h" |
michael@0 | 140 | #include "nsTextServicesDocument.h" |
michael@0 | 141 | #include "nsTextServicesCID.h" |
michael@0 | 142 | |
michael@0 | 143 | #include "nsScriptSecurityManager.h" |
michael@0 | 144 | #include "nsPrincipal.h" |
michael@0 | 145 | #include "nsSystemPrincipal.h" |
michael@0 | 146 | #include "nsNullPrincipal.h" |
michael@0 | 147 | #include "nsNetCID.h" |
michael@0 | 148 | #ifndef MOZ_WIDGET_GONK |
michael@0 | 149 | #if defined(MOZ_WIDGET_ANDROID) |
michael@0 | 150 | #include "nsHapticFeedback.h" |
michael@0 | 151 | #endif |
michael@0 | 152 | #endif |
michael@0 | 153 | #include "nsParserUtils.h" |
michael@0 | 154 | |
michael@0 | 155 | #define NS_EDITORCOMMANDTABLE_CID \ |
michael@0 | 156 | { 0x4f5e62b8, 0xd659, 0x4156, { 0x84, 0xfc, 0x2f, 0x60, 0x99, 0x40, 0x03, 0x69 }} |
michael@0 | 157 | |
michael@0 | 158 | #define NS_EDITINGCOMMANDTABLE_CID \ |
michael@0 | 159 | { 0xcb38a746, 0xbeb8, 0x43f3, { 0x94, 0x29, 0x77, 0x96, 0xe1, 0xa9, 0x3f, 0xb4 }} |
michael@0 | 160 | |
michael@0 | 161 | #define NS_HAPTICFEEDBACK_CID \ |
michael@0 | 162 | { 0x1f15dbc8, 0xbfaa, 0x45de, \ |
michael@0 | 163 | { 0x8a, 0x46, 0x08, 0xe2, 0xe2, 0x63, 0x26, 0xb0 } } |
michael@0 | 164 | |
michael@0 | 165 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsPlaintextEditor) |
michael@0 | 166 | |
michael@0 | 167 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserUtils) |
michael@0 | 168 | |
michael@0 | 169 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextServicesDocument) |
michael@0 | 170 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLEditor) |
michael@0 | 171 | |
michael@0 | 172 | #include "nsHTMLCanvasFrame.h" |
michael@0 | 173 | |
michael@0 | 174 | #include "nsIDOMWebGLRenderingContext.h" |
michael@0 | 175 | |
michael@0 | 176 | class nsIDocumentLoaderFactory; |
michael@0 | 177 | |
michael@0 | 178 | #define PRODUCT_NAME "Gecko" |
michael@0 | 179 | |
michael@0 | 180 | /* 0ddf4df8-4dbb-4133-8b79-9afb966514f5 */ |
michael@0 | 181 | #define NS_PLUGINDOCLOADERFACTORY_CID \ |
michael@0 | 182 | { 0x0ddf4df8, 0x4dbb, 0x4133, { 0x8b, 0x79, 0x9a, 0xfb, 0x96, 0x65, 0x14, 0xf5 } } |
michael@0 | 183 | |
michael@0 | 184 | #define NS_WINDOWCOMMANDTABLE_CID \ |
michael@0 | 185 | { /* 0DE2FBFA-6B7F-11D7-BBBA-0003938A9D96 */ \ |
michael@0 | 186 | 0x0DE2FBFA, 0x6B7F, 0x11D7, {0xBB, 0xBA, 0x00, 0x03, 0x93, 0x8A, 0x9D, 0x96} } |
michael@0 | 187 | |
michael@0 | 188 | #include "nsIBoxObject.h" |
michael@0 | 189 | |
michael@0 | 190 | #ifdef MOZ_XUL |
michael@0 | 191 | #include "inDOMView.h" |
michael@0 | 192 | #endif /* MOZ_XUL */ |
michael@0 | 193 | |
michael@0 | 194 | #include "inDeepTreeWalker.h" |
michael@0 | 195 | #include "inFlasher.h" |
michael@0 | 196 | #include "inCSSValueSearch.h" |
michael@0 | 197 | #include "inDOMUtils.h" |
michael@0 | 198 | |
michael@0 | 199 | #ifdef MOZ_XUL |
michael@0 | 200 | #include "nsIXULDocument.h" |
michael@0 | 201 | #include "nsIXULSortService.h" |
michael@0 | 202 | |
michael@0 | 203 | nsresult |
michael@0 | 204 | NS_NewXULContentBuilder(nsISupports* aOuter, REFNSIID aIID, void** aResult); |
michael@0 | 205 | |
michael@0 | 206 | nsresult |
michael@0 | 207 | NS_NewXULTreeBuilder(nsISupports* aOuter, REFNSIID aIID, void** aResult); |
michael@0 | 208 | #endif |
michael@0 | 209 | |
michael@0 | 210 | static void Shutdown(); |
michael@0 | 211 | |
michael@0 | 212 | #include "nsGeolocation.h" |
michael@0 | 213 | #include "nsDeviceSensors.h" |
michael@0 | 214 | #ifdef MOZ_GAMEPAD |
michael@0 | 215 | #include "mozilla/dom/GamepadService.h" |
michael@0 | 216 | #endif |
michael@0 | 217 | #include "nsCSPService.h" |
michael@0 | 218 | #include "nsISmsService.h" |
michael@0 | 219 | #include "nsIMmsService.h" |
michael@0 | 220 | #include "nsIMobileMessageService.h" |
michael@0 | 221 | #include "nsIMobileMessageDatabaseService.h" |
michael@0 | 222 | #include "mozilla/dom/mobilemessage/MobileMessageService.h" |
michael@0 | 223 | #include "mozilla/dom/mobilemessage/SmsServicesFactory.h" |
michael@0 | 224 | #include "nsIPowerManagerService.h" |
michael@0 | 225 | #include "nsIAlarmHalService.h" |
michael@0 | 226 | #include "nsIMediaManager.h" |
michael@0 | 227 | #include "nsMixedContentBlocker.h" |
michael@0 | 228 | |
michael@0 | 229 | #include "AudioChannelService.h" |
michael@0 | 230 | |
michael@0 | 231 | #include "mozilla/dom/power/PowerManagerService.h" |
michael@0 | 232 | #include "mozilla/dom/alarm/AlarmHalService.h" |
michael@0 | 233 | #include "mozilla/dom/time/TimeService.h" |
michael@0 | 234 | #include "StreamingProtocolService.h" |
michael@0 | 235 | |
michael@0 | 236 | #include "mozilla/dom/telephony/TelephonyFactory.h" |
michael@0 | 237 | #include "nsITelephonyProvider.h" |
michael@0 | 238 | |
michael@0 | 239 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 240 | #include "GonkGPSGeolocationProvider.h" |
michael@0 | 241 | #endif |
michael@0 | 242 | #include "MediaManager.h" |
michael@0 | 243 | |
michael@0 | 244 | using namespace mozilla; |
michael@0 | 245 | using namespace mozilla::dom; |
michael@0 | 246 | using namespace mozilla::dom::mobilemessage; |
michael@0 | 247 | using namespace mozilla::dom::telephony; |
michael@0 | 248 | using mozilla::dom::alarm::AlarmHalService; |
michael@0 | 249 | using mozilla::dom::indexedDB::IndexedDatabaseManager; |
michael@0 | 250 | using mozilla::dom::power::PowerManagerService; |
michael@0 | 251 | using mozilla::dom::quota::QuotaManager; |
michael@0 | 252 | using mozilla::dom::TCPSocketChild; |
michael@0 | 253 | using mozilla::dom::TCPSocketParent; |
michael@0 | 254 | using mozilla::dom::TCPServerSocketChild; |
michael@0 | 255 | using mozilla::dom::UDPSocketChild; |
michael@0 | 256 | using mozilla::dom::time::TimeService; |
michael@0 | 257 | using mozilla::net::StreamingProtocolControllerService; |
michael@0 | 258 | |
michael@0 | 259 | // Transformiix |
michael@0 | 260 | /* 5d5d92cd-6bf8-11d9-bf4a-000a95dc234c */ |
michael@0 | 261 | #define TRANSFORMIIX_NODESET_CID \ |
michael@0 | 262 | { 0x5d5d92cd, 0x6bf8, 0x11d9, { 0xbf, 0x4a, 0x0, 0x0a, 0x95, 0xdc, 0x23, 0x4c } } |
michael@0 | 263 | |
michael@0 | 264 | #define TRANSFORMIIX_NODESET_CONTRACTID \ |
michael@0 | 265 | "@mozilla.org/transformiix-nodeset;1" |
michael@0 | 266 | |
michael@0 | 267 | // Factory Constructor |
michael@0 | 268 | NS_GENERIC_FACTORY_CONSTRUCTOR(txMozillaXSLTProcessor) |
michael@0 | 269 | NS_GENERIC_FACTORY_CONSTRUCTOR(XPathEvaluator) |
michael@0 | 270 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(txNodeSetAdaptor, Init) |
michael@0 | 271 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMSerializer) |
michael@0 | 272 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsXMLHttpRequest, Init) |
michael@0 | 273 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDOMFileReader, Init) |
michael@0 | 274 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormData) |
michael@0 | 275 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsBlobProtocolHandler) |
michael@0 | 276 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaStreamProtocolHandler) |
michael@0 | 277 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaSourceProtocolHandler) |
michael@0 | 278 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontTableProtocolHandler) |
michael@0 | 279 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsHostObjectURI) |
michael@0 | 280 | NS_GENERIC_FACTORY_CONSTRUCTOR(DOMParser) |
michael@0 | 281 | NS_GENERIC_FACTORY_CONSTRUCTOR(Exception) |
michael@0 | 282 | NS_GENERIC_FACTORY_CONSTRUCTOR(DOMSessionStorageManager) |
michael@0 | 283 | NS_GENERIC_FACTORY_CONSTRUCTOR(DOMLocalStorageManager) |
michael@0 | 284 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsChannelPolicy) |
michael@0 | 285 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(IndexedDatabaseManager, |
michael@0 | 286 | IndexedDatabaseManager::FactoryCreate) |
michael@0 | 287 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService, |
michael@0 | 288 | DOMRequestService::FactoryCreate) |
michael@0 | 289 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager, |
michael@0 | 290 | QuotaManager::FactoryCreate) |
michael@0 | 291 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 292 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager, |
michael@0 | 293 | SystemWorkerManager::FactoryCreate) |
michael@0 | 294 | #endif |
michael@0 | 295 | #ifdef MOZ_B2G_BT |
michael@0 | 296 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(BluetoothService, |
michael@0 | 297 | BluetoothService::FactoryCreate) |
michael@0 | 298 | #endif |
michael@0 | 299 | |
michael@0 | 300 | #ifdef MOZ_WEBSPEECH |
michael@0 | 301 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSynthVoiceRegistry, |
michael@0 | 302 | nsSynthVoiceRegistry::GetInstanceForService) |
michael@0 | 303 | #endif |
michael@0 | 304 | |
michael@0 | 305 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 306 | NS_GENERIC_FACTORY_CONSTRUCTOR(AudioManager) |
michael@0 | 307 | #endif |
michael@0 | 308 | |
michael@0 | 309 | NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent) |
michael@0 | 310 | |
michael@0 | 311 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors) |
michael@0 | 312 | |
michael@0 | 313 | #ifndef MOZ_WIDGET_GONK |
michael@0 | 314 | #if defined(ANDROID) |
michael@0 | 315 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback) |
michael@0 | 316 | #endif |
michael@0 | 317 | #endif |
michael@0 | 318 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init) |
michael@0 | 319 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService, |
michael@0 | 320 | SmsServicesFactory::CreateSmsService) |
michael@0 | 321 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMmsService, |
michael@0 | 322 | SmsServicesFactory::CreateMmsService) |
michael@0 | 323 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileMessageService, |
michael@0 | 324 | MobileMessageService::GetInstance) |
michael@0 | 325 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMobileMessageDatabaseService, |
michael@0 | 326 | SmsServicesFactory::CreateMobileMessageDatabaseService) |
michael@0 | 327 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPowerManagerService, |
michael@0 | 328 | PowerManagerService::GetInstance) |
michael@0 | 329 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIAlarmHalService, |
michael@0 | 330 | AlarmHalService::GetInstance) |
michael@0 | 331 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITimeService, |
michael@0 | 332 | TimeService::GetInstance) |
michael@0 | 333 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService, |
michael@0 | 334 | StreamingProtocolControllerService::GetInstance) |
michael@0 | 335 | |
michael@0 | 336 | #ifdef MOZ_GAMEPAD |
michael@0 | 337 | using mozilla::dom::GamepadServiceTest; |
michael@0 | 338 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(GamepadServiceTest, |
michael@0 | 339 | GamepadServiceTest::CreateService) |
michael@0 | 340 | #endif |
michael@0 | 341 | |
michael@0 | 342 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 343 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIGeolocationProvider, |
michael@0 | 344 | GonkGPSGeolocationProvider::GetSingleton) |
michael@0 | 345 | // Since the nsVolumeService constructor calls into nsIPowerManagerService, |
michael@0 | 346 | // we need it to be constructed sometime after nsIPowerManagerService. |
michael@0 | 347 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsVolumeService, |
michael@0 | 348 | nsVolumeService::GetSingleton) |
michael@0 | 349 | #endif |
michael@0 | 350 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService, |
michael@0 | 351 | MediaManager::GetInstance) |
michael@0 | 352 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITelephonyProvider, |
michael@0 | 353 | TelephonyFactory::CreateTelephonyProvider) |
michael@0 | 354 | |
michael@0 | 355 | //----------------------------------------------------------------------------- |
michael@0 | 356 | |
michael@0 | 357 | static bool gInitialized = false; |
michael@0 | 358 | |
michael@0 | 359 | // Perform our one-time intialization for this module |
michael@0 | 360 | |
michael@0 | 361 | // static |
michael@0 | 362 | nsresult |
michael@0 | 363 | Initialize() |
michael@0 | 364 | { |
michael@0 | 365 | if (gInitialized) { |
michael@0 | 366 | NS_RUNTIMEABORT("Recursive layout module initialization"); |
michael@0 | 367 | return NS_ERROR_FAILURE; |
michael@0 | 368 | } |
michael@0 | 369 | |
michael@0 | 370 | static_assert(sizeof(uintptr_t) == sizeof(void*), |
michael@0 | 371 | "Eeek! You'll need to adjust the size of uintptr_t to the " |
michael@0 | 372 | "size of a pointer on your platform."); |
michael@0 | 373 | |
michael@0 | 374 | gInitialized = true; |
michael@0 | 375 | |
michael@0 | 376 | nsresult rv; |
michael@0 | 377 | rv = xpcModuleCtor(); |
michael@0 | 378 | if (NS_FAILED(rv)) |
michael@0 | 379 | return rv; |
michael@0 | 380 | |
michael@0 | 381 | rv = nsLayoutStatics::Initialize(); |
michael@0 | 382 | if (NS_FAILED(rv)) { |
michael@0 | 383 | Shutdown(); |
michael@0 | 384 | return rv; |
michael@0 | 385 | } |
michael@0 | 386 | |
michael@0 | 387 | #ifdef DEBUG |
michael@0 | 388 | nsStyleContext::AssertStyleStructMaxDifferenceValid(); |
michael@0 | 389 | #endif |
michael@0 | 390 | |
michael@0 | 391 | return NS_OK; |
michael@0 | 392 | } |
michael@0 | 393 | |
michael@0 | 394 | // Shutdown this module, releasing all of the module resources |
michael@0 | 395 | |
michael@0 | 396 | // static |
michael@0 | 397 | void |
michael@0 | 398 | Shutdown() |
michael@0 | 399 | { |
michael@0 | 400 | NS_PRECONDITION(gInitialized, "module not initialized"); |
michael@0 | 401 | if (!gInitialized) |
michael@0 | 402 | return; |
michael@0 | 403 | |
michael@0 | 404 | gInitialized = false; |
michael@0 | 405 | |
michael@0 | 406 | nsLayoutStatics::Release(); |
michael@0 | 407 | } |
michael@0 | 408 | |
michael@0 | 409 | #ifdef DEBUG |
michael@0 | 410 | nsresult NS_NewFrameUtil(nsIFrameUtil** aResult); |
michael@0 | 411 | nsresult NS_NewLayoutDebugger(nsILayoutDebugger** aResult); |
michael@0 | 412 | #endif |
michael@0 | 413 | |
michael@0 | 414 | nsresult NS_NewBoxObject(nsIBoxObject** aResult); |
michael@0 | 415 | |
michael@0 | 416 | #ifdef MOZ_XUL |
michael@0 | 417 | nsresult NS_NewListBoxObject(nsIBoxObject** aResult); |
michael@0 | 418 | nsresult NS_NewScrollBoxObject(nsIBoxObject** aResult); |
michael@0 | 419 | nsresult NS_NewMenuBoxObject(nsIBoxObject** aResult); |
michael@0 | 420 | nsresult NS_NewPopupBoxObject(nsIBoxObject** aResult); |
michael@0 | 421 | nsresult NS_NewContainerBoxObject(nsIBoxObject** aResult); |
michael@0 | 422 | nsresult NS_NewTreeBoxObject(nsIBoxObject** aResult); |
michael@0 | 423 | #endif |
michael@0 | 424 | |
michael@0 | 425 | nsresult NS_NewCanvasRenderingContextWebGL(nsIDOMWebGLRenderingContext** aResult); |
michael@0 | 426 | |
michael@0 | 427 | nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult); |
michael@0 | 428 | |
michael@0 | 429 | nsresult NS_NewDomSelection(nsISelection** aResult); |
michael@0 | 430 | already_AddRefed<nsIContentViewer> NS_NewContentViewer(); |
michael@0 | 431 | nsresult NS_NewGenRegularIterator(nsIContentIterator** aResult); |
michael@0 | 432 | nsresult NS_NewGenSubtreeIterator(nsIContentIterator** aInstancePtrResult); |
michael@0 | 433 | nsresult NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult); |
michael@0 | 434 | nsresult NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult); |
michael@0 | 435 | nsresult NS_NewTextEncoder(nsIDocumentEncoder** aResult); |
michael@0 | 436 | nsresult NS_NewContentPolicy(nsIContentPolicy** aResult); |
michael@0 | 437 | |
michael@0 | 438 | nsresult NS_NewEventListenerService(nsIEventListenerService** aResult); |
michael@0 | 439 | nsresult NS_NewGlobalMessageManager(nsIMessageBroadcaster** aResult); |
michael@0 | 440 | nsresult NS_NewParentProcessMessageManager(nsIMessageBroadcaster** aResult); |
michael@0 | 441 | nsresult NS_NewChildProcessMessageManager(nsISyncMessageSender** aResult); |
michael@0 | 442 | |
michael@0 | 443 | nsresult NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult); |
michael@0 | 444 | |
michael@0 | 445 | #define MAKE_CTOR(ctor_, iface_, func_) \ |
michael@0 | 446 | static nsresult \ |
michael@0 | 447 | ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \ |
michael@0 | 448 | { \ |
michael@0 | 449 | *aResult = nullptr; \ |
michael@0 | 450 | if (aOuter) \ |
michael@0 | 451 | return NS_ERROR_NO_AGGREGATION; \ |
michael@0 | 452 | iface_* inst; \ |
michael@0 | 453 | nsresult rv = func_(&inst); \ |
michael@0 | 454 | if (NS_SUCCEEDED(rv)) { \ |
michael@0 | 455 | rv = inst->QueryInterface(aIID, aResult); \ |
michael@0 | 456 | NS_RELEASE(inst); \ |
michael@0 | 457 | } \ |
michael@0 | 458 | return rv; \ |
michael@0 | 459 | } |
michael@0 | 460 | |
michael@0 | 461 | // As above, but expects |
michael@0 | 462 | // already_AddRefed<nsIFoo> NS_NewFoo(); |
michael@0 | 463 | // instead of |
michael@0 | 464 | // nsresult NS_NewFoo(nsIFoo**); |
michael@0 | 465 | #define MAKE_CTOR2(ctor_, iface_, func_) \ |
michael@0 | 466 | static nsresult \ |
michael@0 | 467 | ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) \ |
michael@0 | 468 | { \ |
michael@0 | 469 | *aResult = nullptr; \ |
michael@0 | 470 | if (aOuter) { \ |
michael@0 | 471 | return NS_ERROR_NO_AGGREGATION; \ |
michael@0 | 472 | } \ |
michael@0 | 473 | nsCOMPtr<iface_> inst = func_(); \ |
michael@0 | 474 | inst.forget(aResult); \ |
michael@0 | 475 | return NS_OK; \ |
michael@0 | 476 | } |
michael@0 | 477 | |
michael@0 | 478 | #ifdef DEBUG |
michael@0 | 479 | MAKE_CTOR(CreateNewFrameUtil, nsIFrameUtil, NS_NewFrameUtil) |
michael@0 | 480 | MAKE_CTOR(CreateNewLayoutDebugger, nsILayoutDebugger, NS_NewLayoutDebugger) |
michael@0 | 481 | #endif |
michael@0 | 482 | |
michael@0 | 483 | MAKE_CTOR(CreateNewFrameTraversal, nsIFrameTraversal, NS_CreateFrameTraversal) |
michael@0 | 484 | MAKE_CTOR(CreateNewBoxObject, nsIBoxObject, NS_NewBoxObject) |
michael@0 | 485 | |
michael@0 | 486 | #ifdef MOZ_XUL |
michael@0 | 487 | MAKE_CTOR(CreateNewListBoxObject, nsIBoxObject, NS_NewListBoxObject) |
michael@0 | 488 | MAKE_CTOR(CreateNewMenuBoxObject, nsIBoxObject, NS_NewMenuBoxObject) |
michael@0 | 489 | MAKE_CTOR(CreateNewPopupBoxObject, nsIBoxObject, NS_NewPopupBoxObject) |
michael@0 | 490 | MAKE_CTOR(CreateNewScrollBoxObject, nsIBoxObject, NS_NewScrollBoxObject) |
michael@0 | 491 | MAKE_CTOR(CreateNewTreeBoxObject, nsIBoxObject, NS_NewTreeBoxObject) |
michael@0 | 492 | MAKE_CTOR(CreateNewContainerBoxObject, nsIBoxObject, NS_NewContainerBoxObject) |
michael@0 | 493 | #endif // MOZ_XUL |
michael@0 | 494 | |
michael@0 | 495 | #ifdef MOZ_XUL |
michael@0 | 496 | NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMView) |
michael@0 | 497 | #endif |
michael@0 | 498 | NS_GENERIC_FACTORY_CONSTRUCTOR(inDeepTreeWalker) |
michael@0 | 499 | NS_GENERIC_FACTORY_CONSTRUCTOR(inFlasher) |
michael@0 | 500 | NS_GENERIC_FACTORY_CONSTRUCTOR(inCSSValueSearch) |
michael@0 | 501 | NS_GENERIC_FACTORY_CONSTRUCTOR(inDOMUtils) |
michael@0 | 502 | |
michael@0 | 503 | MAKE_CTOR2(CreateContentViewer, nsIContentViewer, NS_NewContentViewer) |
michael@0 | 504 | MAKE_CTOR(CreateHTMLDocument, nsIDocument, NS_NewHTMLDocument) |
michael@0 | 505 | MAKE_CTOR(CreateXMLDocument, nsIDocument, NS_NewXMLDocument) |
michael@0 | 506 | MAKE_CTOR(CreateSVGDocument, nsIDocument, NS_NewSVGDocument) |
michael@0 | 507 | MAKE_CTOR(CreateImageDocument, nsIDocument, NS_NewImageDocument) |
michael@0 | 508 | MAKE_CTOR(CreateDOMBlob, nsISupports, nsDOMMultipartFile::NewBlob) |
michael@0 | 509 | MAKE_CTOR(CreateDOMFile, nsISupports, nsDOMMultipartFile::NewFile) |
michael@0 | 510 | MAKE_CTOR(CreateDOMSelection, nsISelection, NS_NewDomSelection) |
michael@0 | 511 | MAKE_CTOR2(CreateContentIterator, nsIContentIterator, NS_NewContentIterator) |
michael@0 | 512 | MAKE_CTOR2(CreatePreContentIterator, nsIContentIterator, NS_NewPreContentIterator) |
michael@0 | 513 | MAKE_CTOR2(CreateSubtreeIterator, nsIContentIterator, NS_NewContentSubtreeIterator) |
michael@0 | 514 | MAKE_CTOR(CreateTextEncoder, nsIDocumentEncoder, NS_NewTextEncoder) |
michael@0 | 515 | MAKE_CTOR(CreateHTMLCopyTextEncoder, nsIDocumentEncoder, NS_NewHTMLCopyTextEncoder) |
michael@0 | 516 | MAKE_CTOR(CreateXMLContentSerializer, nsIContentSerializer, NS_NewXMLContentSerializer) |
michael@0 | 517 | MAKE_CTOR(CreateHTMLContentSerializer, nsIContentSerializer, NS_NewHTMLContentSerializer) |
michael@0 | 518 | MAKE_CTOR(CreateXHTMLContentSerializer, nsIContentSerializer, NS_NewXHTMLContentSerializer) |
michael@0 | 519 | MAKE_CTOR(CreatePlainTextSerializer, nsIContentSerializer, NS_NewPlainTextSerializer) |
michael@0 | 520 | MAKE_CTOR(CreateContentPolicy, nsIContentPolicy, NS_NewContentPolicy) |
michael@0 | 521 | #ifdef MOZ_XUL |
michael@0 | 522 | MAKE_CTOR(CreateXULSortService, nsIXULSortService, NS_NewXULSortService) |
michael@0 | 523 | // NS_NewXULContentBuilder |
michael@0 | 524 | // NS_NewXULTreeBuilder |
michael@0 | 525 | MAKE_CTOR(CreateXULDocument, nsIXULDocument, NS_NewXULDocument) |
michael@0 | 526 | // NS_NewXULControllers |
michael@0 | 527 | #endif |
michael@0 | 528 | MAKE_CTOR(CreateContentDLF, nsIDocumentLoaderFactory, NS_NewContentDocumentLoaderFactory) |
michael@0 | 529 | MAKE_CTOR(CreateEventListenerService, nsIEventListenerService, NS_NewEventListenerService) |
michael@0 | 530 | MAKE_CTOR(CreateGlobalMessageManager, nsIMessageBroadcaster, NS_NewGlobalMessageManager) |
michael@0 | 531 | MAKE_CTOR(CreateParentMessageManager, nsIMessageBroadcaster, NS_NewParentProcessMessageManager) |
michael@0 | 532 | MAKE_CTOR(CreateChildMessageManager, nsISyncMessageSender, NS_NewChildProcessMessageManager) |
michael@0 | 533 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDataDocumentContentPolicy) |
michael@0 | 534 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoDataProtocolContentPolicy) |
michael@0 | 535 | MAKE_CTOR(CreatePluginDocument, nsIDocument, NS_NewPluginDocument) |
michael@0 | 536 | MAKE_CTOR(CreateVideoDocument, nsIDocument, NS_NewVideoDocument) |
michael@0 | 537 | MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager) |
michael@0 | 538 | |
michael@0 | 539 | MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext, NS_NewCanvasRenderingContextWebGL) |
michael@0 | 540 | |
michael@0 | 541 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init) |
michael@0 | 542 | |
michael@0 | 543 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURI) |
michael@0 | 544 | |
michael@0 | 545 | // views are not refcounted, so this is the same as |
michael@0 | 546 | // NS_GENERIC_FACTORY_CONSTRUCTOR without the NS_ADDREF/NS_RELEASE |
michael@0 | 547 | #define NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(_InstanceClass) \ |
michael@0 | 548 | static nsresult \ |
michael@0 | 549 | _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \ |
michael@0 | 550 | void **aResult) \ |
michael@0 | 551 | { \ |
michael@0 | 552 | nsresult rv; \ |
michael@0 | 553 | \ |
michael@0 | 554 | *aResult = nullptr; \ |
michael@0 | 555 | if (nullptr != aOuter) { \ |
michael@0 | 556 | rv = NS_ERROR_NO_AGGREGATION; \ |
michael@0 | 557 | return rv; \ |
michael@0 | 558 | } \ |
michael@0 | 559 | \ |
michael@0 | 560 | _InstanceClass * inst = new _InstanceClass(); \ |
michael@0 | 561 | if (nullptr == inst) { \ |
michael@0 | 562 | rv = NS_ERROR_OUT_OF_MEMORY; \ |
michael@0 | 563 | return rv; \ |
michael@0 | 564 | } \ |
michael@0 | 565 | rv = inst->QueryInterface(aIID, aResult); \ |
michael@0 | 566 | \ |
michael@0 | 567 | return rv; \ |
michael@0 | 568 | } \ |
michael@0 | 569 | |
michael@0 | 570 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsDOMScriptObjectFactory) |
michael@0 | 571 | |
michael@0 | 572 | #define NS_GEOLOCATION_CID \ |
michael@0 | 573 | { 0x1E1C3FF, 0x94A, 0xD048, { 0x44, 0xB4, 0x62, 0xD2, 0x9C, 0x7B, 0x4F, 0x39 } } |
michael@0 | 574 | |
michael@0 | 575 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(Geolocation, Init) |
michael@0 | 576 | |
michael@0 | 577 | #define NS_GEOLOCATION_SERVICE_CID \ |
michael@0 | 578 | { 0x404d02a, 0x1CA, 0xAAAB, { 0x47, 0x62, 0x94, 0x4b, 0x1b, 0xf2, 0xf7, 0xb5 } } |
michael@0 | 579 | |
michael@0 | 580 | #define NS_AUDIOCHANNEL_SERVICE_CID \ |
michael@0 | 581 | { 0xf712e983, 0x048a, 0x443f, { 0x88, 0x02, 0xfc, 0xc3, 0xd9, 0x27, 0xce, 0xac }} |
michael@0 | 582 | |
michael@0 | 583 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsGeolocationService, nsGeolocationService::GetGeolocationService) |
michael@0 | 584 | |
michael@0 | 585 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelService::GetAudioChannelService) |
michael@0 | 586 | |
michael@0 | 587 | #ifdef MOZ_WEBSPEECH |
michael@0 | 588 | NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService) |
michael@0 | 589 | #endif |
michael@0 | 590 | |
michael@0 | 591 | NS_GENERIC_FACTORY_CONSTRUCTOR(CSPService) |
michael@0 | 592 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsMixedContentBlocker) |
michael@0 | 593 | |
michael@0 | 594 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrincipal) |
michael@0 | 595 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsSecurityNameSet) |
michael@0 | 596 | NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsSystemPrincipal, |
michael@0 | 597 | nsScriptSecurityManager::SystemPrincipalSingletonConstructor) |
michael@0 | 598 | NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNullPrincipal, Init) |
michael@0 | 599 | NS_GENERIC_FACTORY_CONSTRUCTOR(nsStructuredCloneContainer) |
michael@0 | 600 | |
michael@0 | 601 | NS_GENERIC_FACTORY_CONSTRUCTOR(OSFileConstantsService) |
michael@0 | 602 | NS_GENERIC_FACTORY_CONSTRUCTOR(TCPSocketChild) |
michael@0 | 603 | NS_GENERIC_FACTORY_CONSTRUCTOR(TCPSocketParent) |
michael@0 | 604 | NS_GENERIC_FACTORY_CONSTRUCTOR(TCPServerSocketChild) |
michael@0 | 605 | NS_GENERIC_FACTORY_CONSTRUCTOR(UDPSocketChild) |
michael@0 | 606 | |
michael@0 | 607 | #ifdef ACCESSIBILITY |
michael@0 | 608 | #include "nsAccessibilityService.h" |
michael@0 | 609 | |
michael@0 | 610 | MAKE_CTOR(CreateA11yService, nsIAccessibilityService, NS_GetAccessibilityService) |
michael@0 | 611 | #endif |
michael@0 | 612 | |
michael@0 | 613 | static nsresult |
michael@0 | 614 | Construct_nsIScriptSecurityManager(nsISupports *aOuter, REFNSIID aIID, |
michael@0 | 615 | void **aResult) |
michael@0 | 616 | { |
michael@0 | 617 | if (!aResult) |
michael@0 | 618 | return NS_ERROR_NULL_POINTER; |
michael@0 | 619 | *aResult = nullptr; |
michael@0 | 620 | if (aOuter) |
michael@0 | 621 | return NS_ERROR_NO_AGGREGATION; |
michael@0 | 622 | nsScriptSecurityManager *obj = nsScriptSecurityManager::GetScriptSecurityManager(); |
michael@0 | 623 | if (!obj) |
michael@0 | 624 | return NS_ERROR_OUT_OF_MEMORY; |
michael@0 | 625 | if (NS_FAILED(obj->QueryInterface(aIID, aResult))) |
michael@0 | 626 | return NS_ERROR_FAILURE; |
michael@0 | 627 | return NS_OK; |
michael@0 | 628 | } |
michael@0 | 629 | |
michael@0 | 630 | #ifdef DEBUG |
michael@0 | 631 | NS_DEFINE_NAMED_CID(NS_FRAME_UTIL_CID); |
michael@0 | 632 | NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGER_CID); |
michael@0 | 633 | #endif |
michael@0 | 634 | NS_DEFINE_NAMED_CID(NS_FRAMETRAVERSAL_CID); |
michael@0 | 635 | NS_DEFINE_NAMED_CID(NS_BOXOBJECT_CID); |
michael@0 | 636 | #ifdef MOZ_XUL |
michael@0 | 637 | NS_DEFINE_NAMED_CID(NS_LISTBOXOBJECT_CID); |
michael@0 | 638 | NS_DEFINE_NAMED_CID(NS_MENUBOXOBJECT_CID); |
michael@0 | 639 | NS_DEFINE_NAMED_CID(NS_POPUPBOXOBJECT_CID); |
michael@0 | 640 | NS_DEFINE_NAMED_CID(NS_CONTAINERBOXOBJECT_CID); |
michael@0 | 641 | NS_DEFINE_NAMED_CID(NS_SCROLLBOXOBJECT_CID); |
michael@0 | 642 | NS_DEFINE_NAMED_CID(NS_TREEBOXOBJECT_CID); |
michael@0 | 643 | #endif // MOZ_XUL |
michael@0 | 644 | #ifdef MOZ_XUL |
michael@0 | 645 | NS_DEFINE_NAMED_CID(IN_DOMVIEW_CID); |
michael@0 | 646 | #endif |
michael@0 | 647 | NS_DEFINE_NAMED_CID(IN_DEEPTREEWALKER_CID); |
michael@0 | 648 | NS_DEFINE_NAMED_CID(IN_FLASHER_CID); |
michael@0 | 649 | NS_DEFINE_NAMED_CID(IN_CSSVALUESEARCH_CID); |
michael@0 | 650 | NS_DEFINE_NAMED_CID(IN_DOMUTILS_CID); |
michael@0 | 651 | NS_DEFINE_NAMED_CID(NS_CONTENT_VIEWER_CID); |
michael@0 | 652 | NS_DEFINE_NAMED_CID(NS_HTMLDOCUMENT_CID); |
michael@0 | 653 | NS_DEFINE_NAMED_CID(NS_XMLDOCUMENT_CID); |
michael@0 | 654 | NS_DEFINE_NAMED_CID(NS_SVGDOCUMENT_CID); |
michael@0 | 655 | NS_DEFINE_NAMED_CID(NS_IMAGEDOCUMENT_CID); |
michael@0 | 656 | NS_DEFINE_NAMED_CID(NS_DOMMULTIPARTBLOB_CID); |
michael@0 | 657 | NS_DEFINE_NAMED_CID(NS_DOMMULTIPARTFILE_CID); |
michael@0 | 658 | NS_DEFINE_NAMED_CID(NS_DOMSELECTION_CID); |
michael@0 | 659 | NS_DEFINE_NAMED_CID(NS_CONTENTITERATOR_CID); |
michael@0 | 660 | NS_DEFINE_NAMED_CID(NS_PRECONTENTITERATOR_CID); |
michael@0 | 661 | NS_DEFINE_NAMED_CID(NS_SUBTREEITERATOR_CID); |
michael@0 | 662 | NS_DEFINE_NAMED_CID(NS_CANVASRENDERINGCONTEXTWEBGL_CID); |
michael@0 | 663 | NS_DEFINE_NAMED_CID(NS_TEXT_ENCODER_CID); |
michael@0 | 664 | NS_DEFINE_NAMED_CID(NS_HTMLCOPY_TEXT_ENCODER_CID); |
michael@0 | 665 | NS_DEFINE_NAMED_CID(NS_XMLCONTENTSERIALIZER_CID); |
michael@0 | 666 | NS_DEFINE_NAMED_CID(NS_XHTMLCONTENTSERIALIZER_CID); |
michael@0 | 667 | NS_DEFINE_NAMED_CID(NS_HTMLCONTENTSERIALIZER_CID); |
michael@0 | 668 | NS_DEFINE_NAMED_CID(NS_PLAINTEXTSERIALIZER_CID); |
michael@0 | 669 | NS_DEFINE_NAMED_CID(NS_PARSERUTILS_CID); |
michael@0 | 670 | NS_DEFINE_NAMED_CID(NS_SCRIPTABLEUNESCAPEHTML_CID); |
michael@0 | 671 | NS_DEFINE_NAMED_CID(NS_CONTENTPOLICY_CID); |
michael@0 | 672 | NS_DEFINE_NAMED_CID(NS_DATADOCUMENTCONTENTPOLICY_CID); |
michael@0 | 673 | NS_DEFINE_NAMED_CID(NS_NODATAPROTOCOLCONTENTPOLICY_CID); |
michael@0 | 674 | NS_DEFINE_NAMED_CID(NS_XULCONTROLLERS_CID); |
michael@0 | 675 | #ifdef MOZ_XUL |
michael@0 | 676 | NS_DEFINE_NAMED_CID(NS_XULSORTSERVICE_CID); |
michael@0 | 677 | NS_DEFINE_NAMED_CID(NS_XULTEMPLATEBUILDER_CID); |
michael@0 | 678 | NS_DEFINE_NAMED_CID(NS_XULTREEBUILDER_CID); |
michael@0 | 679 | NS_DEFINE_NAMED_CID(NS_XULDOCUMENT_CID); |
michael@0 | 680 | #endif |
michael@0 | 681 | NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID); |
michael@0 | 682 | NS_DEFINE_NAMED_CID(NS_DOM_SCRIPT_OBJECT_FACTORY_CID); |
michael@0 | 683 | NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID); |
michael@0 | 684 | NS_DEFINE_NAMED_CID(NS_JSURI_CID); |
michael@0 | 685 | NS_DEFINE_NAMED_CID(NS_WINDOWCOMMANDTABLE_CID); |
michael@0 | 686 | NS_DEFINE_NAMED_CID(NS_WINDOWCONTROLLER_CID); |
michael@0 | 687 | NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID); |
michael@0 | 688 | NS_DEFINE_NAMED_CID(NS_PLUGINDOCUMENT_CID); |
michael@0 | 689 | NS_DEFINE_NAMED_CID(NS_VIDEODOCUMENT_CID); |
michael@0 | 690 | NS_DEFINE_NAMED_CID(NS_STYLESHEETSERVICE_CID); |
michael@0 | 691 | NS_DEFINE_NAMED_CID(TRANSFORMIIX_XSLT_PROCESSOR_CID); |
michael@0 | 692 | NS_DEFINE_NAMED_CID(TRANSFORMIIX_XPATH_EVALUATOR_CID); |
michael@0 | 693 | NS_DEFINE_NAMED_CID(TRANSFORMIIX_NODESET_CID); |
michael@0 | 694 | NS_DEFINE_NAMED_CID(NS_XMLSERIALIZER_CID); |
michael@0 | 695 | NS_DEFINE_NAMED_CID(NS_FILEREADER_CID); |
michael@0 | 696 | NS_DEFINE_NAMED_CID(NS_FORMDATA_CID); |
michael@0 | 697 | NS_DEFINE_NAMED_CID(NS_BLOBPROTOCOLHANDLER_CID); |
michael@0 | 698 | NS_DEFINE_NAMED_CID(NS_MEDIASTREAMPROTOCOLHANDLER_CID); |
michael@0 | 699 | NS_DEFINE_NAMED_CID(NS_MEDIASOURCEPROTOCOLHANDLER_CID); |
michael@0 | 700 | NS_DEFINE_NAMED_CID(NS_FONTTABLEPROTOCOLHANDLER_CID); |
michael@0 | 701 | NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURI_CID); |
michael@0 | 702 | NS_DEFINE_NAMED_CID(NS_XMLHTTPREQUEST_CID); |
michael@0 | 703 | NS_DEFINE_NAMED_CID(NS_DOMPARSER_CID); |
michael@0 | 704 | NS_DEFINE_NAMED_CID(NS_DOMSESSIONSTORAGEMANAGER_CID); |
michael@0 | 705 | NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID); |
michael@0 | 706 | NS_DEFINE_NAMED_CID(NS_DOMJSON_CID); |
michael@0 | 707 | NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID); |
michael@0 | 708 | NS_DEFINE_NAMED_CID(INDEXEDDB_MANAGER_CID); |
michael@0 | 709 | NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID); |
michael@0 | 710 | NS_DEFINE_NAMED_CID(QUOTA_MANAGER_CID); |
michael@0 | 711 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 712 | NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID); |
michael@0 | 713 | #endif |
michael@0 | 714 | #ifdef MOZ_B2G_BT |
michael@0 | 715 | NS_DEFINE_NAMED_CID(BLUETOOTHSERVICE_CID); |
michael@0 | 716 | #endif |
michael@0 | 717 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 718 | NS_DEFINE_NAMED_CID(NS_AUDIOMANAGER_CID); |
michael@0 | 719 | NS_DEFINE_NAMED_CID(NS_VOLUMESERVICE_CID); |
michael@0 | 720 | #endif |
michael@0 | 721 | |
michael@0 | 722 | NS_DEFINE_NAMED_CID(NS_AUDIOCHANNELAGENT_CID); |
michael@0 | 723 | |
michael@0 | 724 | NS_DEFINE_NAMED_CID(NS_HTMLEDITOR_CID); |
michael@0 | 725 | NS_DEFINE_NAMED_CID(NS_EDITORCONTROLLER_CID); |
michael@0 | 726 | NS_DEFINE_NAMED_CID(NS_EDITINGCONTROLLER_CID); |
michael@0 | 727 | NS_DEFINE_NAMED_CID(NS_EDITORCOMMANDTABLE_CID); |
michael@0 | 728 | NS_DEFINE_NAMED_CID(NS_EDITINGCOMMANDTABLE_CID); |
michael@0 | 729 | NS_DEFINE_NAMED_CID(NS_TEXTSERVICESDOCUMENT_CID); |
michael@0 | 730 | NS_DEFINE_NAMED_CID(NS_GEOLOCATION_SERVICE_CID); |
michael@0 | 731 | NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID); |
michael@0 | 732 | NS_DEFINE_NAMED_CID(NS_AUDIOCHANNEL_SERVICE_CID); |
michael@0 | 733 | NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID); |
michael@0 | 734 | NS_DEFINE_NAMED_CID(CSPSERVICE_CID); |
michael@0 | 735 | NS_DEFINE_NAMED_CID(NS_MIXEDCONTENTBLOCKER_CID); |
michael@0 | 736 | NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID); |
michael@0 | 737 | NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID); |
michael@0 | 738 | NS_DEFINE_NAMED_CID(NS_PARENTPROCESSMESSAGEMANAGER_CID); |
michael@0 | 739 | NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSAGEMANAGER_CID); |
michael@0 | 740 | NS_DEFINE_NAMED_CID(NSCHANNELPOLICY_CID); |
michael@0 | 741 | NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID); |
michael@0 | 742 | NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID); |
michael@0 | 743 | NS_DEFINE_NAMED_CID(NS_SYSTEMPRINCIPAL_CID); |
michael@0 | 744 | NS_DEFINE_NAMED_CID(NS_NULLPRINCIPAL_CID); |
michael@0 | 745 | NS_DEFINE_NAMED_CID(NS_SECURITYNAMESET_CID); |
michael@0 | 746 | NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID); |
michael@0 | 747 | NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID); |
michael@0 | 748 | NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID); |
michael@0 | 749 | |
michael@0 | 750 | #ifndef MOZ_WIDGET_GONK |
michael@0 | 751 | #if defined(ANDROID) |
michael@0 | 752 | NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID); |
michael@0 | 753 | #endif |
michael@0 | 754 | #endif |
michael@0 | 755 | NS_DEFINE_NAMED_CID(SMS_SERVICE_CID); |
michael@0 | 756 | NS_DEFINE_NAMED_CID(MMS_SERVICE_CID); |
michael@0 | 757 | NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_SERVICE_CID); |
michael@0 | 758 | NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_DATABASE_SERVICE_CID); |
michael@0 | 759 | NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID); |
michael@0 | 760 | NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID); |
michael@0 | 761 | NS_DEFINE_NAMED_CID(NS_ALARMHALSERVICE_CID); |
michael@0 | 762 | NS_DEFINE_NAMED_CID(TCPSOCKETCHILD_CID); |
michael@0 | 763 | NS_DEFINE_NAMED_CID(TCPSOCKETPARENT_CID); |
michael@0 | 764 | NS_DEFINE_NAMED_CID(TCPSERVERSOCKETCHILD_CID); |
michael@0 | 765 | NS_DEFINE_NAMED_CID(UDPSOCKETCHILD_CID); |
michael@0 | 766 | NS_DEFINE_NAMED_CID(NS_TIMESERVICE_CID); |
michael@0 | 767 | NS_DEFINE_NAMED_CID(NS_MEDIASTREAMCONTROLLERSERVICE_CID); |
michael@0 | 768 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 769 | NS_DEFINE_NAMED_CID(GONK_GPS_GEOLOCATION_PROVIDER_CID); |
michael@0 | 770 | #endif |
michael@0 | 771 | NS_DEFINE_NAMED_CID(NS_MEDIAMANAGERSERVICE_CID); |
michael@0 | 772 | #ifdef MOZ_GAMEPAD |
michael@0 | 773 | NS_DEFINE_NAMED_CID(NS_GAMEPAD_TEST_CID); |
michael@0 | 774 | #endif |
michael@0 | 775 | #ifdef MOZ_WEBSPEECH |
michael@0 | 776 | NS_DEFINE_NAMED_CID(NS_FAKE_SPEECH_RECOGNITION_SERVICE_CID); |
michael@0 | 777 | NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID); |
michael@0 | 778 | #endif |
michael@0 | 779 | |
michael@0 | 780 | #ifdef ACCESSIBILITY |
michael@0 | 781 | NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID); |
michael@0 | 782 | #endif |
michael@0 | 783 | NS_DEFINE_NAMED_CID(TELEPHONY_PROVIDER_CID); |
michael@0 | 784 | |
michael@0 | 785 | static nsresult |
michael@0 | 786 | CreateWindowCommandTableConstructor(nsISupports *aOuter, |
michael@0 | 787 | REFNSIID aIID, void **aResult) |
michael@0 | 788 | { |
michael@0 | 789 | nsresult rv; |
michael@0 | 790 | nsCOMPtr<nsIControllerCommandTable> commandTable = |
michael@0 | 791 | do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv); |
michael@0 | 792 | if (NS_FAILED(rv)) return rv; |
michael@0 | 793 | |
michael@0 | 794 | rv = nsWindowCommandRegistration::RegisterWindowCommands(commandTable); |
michael@0 | 795 | if (NS_FAILED(rv)) return rv; |
michael@0 | 796 | |
michael@0 | 797 | return commandTable->QueryInterface(aIID, aResult); |
michael@0 | 798 | } |
michael@0 | 799 | |
michael@0 | 800 | static nsresult |
michael@0 | 801 | CreateWindowControllerWithSingletonCommandTable(nsISupports *aOuter, |
michael@0 | 802 | REFNSIID aIID, void **aResult) |
michael@0 | 803 | { |
michael@0 | 804 | nsresult rv; |
michael@0 | 805 | nsCOMPtr<nsIController> controller = |
michael@0 | 806 | do_CreateInstance("@mozilla.org/embedcomp/base-command-controller;1", &rv); |
michael@0 | 807 | |
michael@0 | 808 | if (NS_FAILED(rv)) return rv; |
michael@0 | 809 | |
michael@0 | 810 | nsCOMPtr<nsIControllerCommandTable> windowCommandTable = do_GetService(kNS_WINDOWCOMMANDTABLE_CID, &rv); |
michael@0 | 811 | if (NS_FAILED(rv)) return rv; |
michael@0 | 812 | |
michael@0 | 813 | // this is a singleton; make it immutable |
michael@0 | 814 | windowCommandTable->MakeImmutable(); |
michael@0 | 815 | |
michael@0 | 816 | nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv); |
michael@0 | 817 | if (NS_FAILED(rv)) return rv; |
michael@0 | 818 | |
michael@0 | 819 | controllerContext->Init(windowCommandTable); |
michael@0 | 820 | if (NS_FAILED(rv)) return rv; |
michael@0 | 821 | |
michael@0 | 822 | return controller->QueryInterface(aIID, aResult); |
michael@0 | 823 | } |
michael@0 | 824 | |
michael@0 | 825 | // Constructor of a controller which is set up to use, internally, a |
michael@0 | 826 | // singleton command-table pre-filled with editor commands. |
michael@0 | 827 | static nsresult |
michael@0 | 828 | nsEditorControllerConstructor(nsISupports *aOuter, REFNSIID aIID, |
michael@0 | 829 | void **aResult) |
michael@0 | 830 | { |
michael@0 | 831 | nsresult rv; |
michael@0 | 832 | nsCOMPtr<nsIController> controller = do_CreateInstance("@mozilla.org/embedcomp/base-command-controller;1", &rv); |
michael@0 | 833 | if (NS_FAILED(rv)) return rv; |
michael@0 | 834 | |
michael@0 | 835 | nsCOMPtr<nsIControllerCommandTable> editorCommandTable = do_GetService(kNS_EDITORCOMMANDTABLE_CID, &rv); |
michael@0 | 836 | if (NS_FAILED(rv)) return rv; |
michael@0 | 837 | |
michael@0 | 838 | // this guy is a singleton, so make it immutable |
michael@0 | 839 | editorCommandTable->MakeImmutable(); |
michael@0 | 840 | |
michael@0 | 841 | nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv); |
michael@0 | 842 | if (NS_FAILED(rv)) return rv; |
michael@0 | 843 | |
michael@0 | 844 | rv = controllerContext->Init(editorCommandTable); |
michael@0 | 845 | if (NS_FAILED(rv)) return rv; |
michael@0 | 846 | |
michael@0 | 847 | return controller->QueryInterface(aIID, aResult); |
michael@0 | 848 | } |
michael@0 | 849 | |
michael@0 | 850 | // Constructor of a controller which is set up to use, internally, a |
michael@0 | 851 | // singleton command-table pre-filled with editing commands. |
michael@0 | 852 | static nsresult |
michael@0 | 853 | nsEditingControllerConstructor(nsISupports *aOuter, REFNSIID aIID, |
michael@0 | 854 | void **aResult) |
michael@0 | 855 | { |
michael@0 | 856 | nsresult rv; |
michael@0 | 857 | nsCOMPtr<nsIController> controller = do_CreateInstance("@mozilla.org/embedcomp/base-command-controller;1", &rv); |
michael@0 | 858 | if (NS_FAILED(rv)) return rv; |
michael@0 | 859 | |
michael@0 | 860 | nsCOMPtr<nsIControllerCommandTable> editingCommandTable = do_GetService(kNS_EDITINGCOMMANDTABLE_CID, &rv); |
michael@0 | 861 | if (NS_FAILED(rv)) return rv; |
michael@0 | 862 | |
michael@0 | 863 | // this guy is a singleton, so make it immutable |
michael@0 | 864 | editingCommandTable->MakeImmutable(); |
michael@0 | 865 | |
michael@0 | 866 | nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv); |
michael@0 | 867 | if (NS_FAILED(rv)) return rv; |
michael@0 | 868 | |
michael@0 | 869 | rv = controllerContext->Init(editingCommandTable); |
michael@0 | 870 | if (NS_FAILED(rv)) return rv; |
michael@0 | 871 | |
michael@0 | 872 | return controller->QueryInterface(aIID, aResult); |
michael@0 | 873 | } |
michael@0 | 874 | |
michael@0 | 875 | // Constructor for a command-table pre-filled with editor commands |
michael@0 | 876 | static nsresult |
michael@0 | 877 | nsEditorCommandTableConstructor(nsISupports *aOuter, REFNSIID aIID, |
michael@0 | 878 | void **aResult) |
michael@0 | 879 | { |
michael@0 | 880 | nsresult rv; |
michael@0 | 881 | nsCOMPtr<nsIControllerCommandTable> commandTable = |
michael@0 | 882 | do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv); |
michael@0 | 883 | if (NS_FAILED(rv)) return rv; |
michael@0 | 884 | |
michael@0 | 885 | rv = nsEditorController::RegisterEditorCommands(commandTable); |
michael@0 | 886 | if (NS_FAILED(rv)) return rv; |
michael@0 | 887 | |
michael@0 | 888 | // we don't know here whether we're being created as an instance, |
michael@0 | 889 | // or a service, so we can't become immutable |
michael@0 | 890 | |
michael@0 | 891 | return commandTable->QueryInterface(aIID, aResult); |
michael@0 | 892 | } |
michael@0 | 893 | |
michael@0 | 894 | // Constructor for a command-table pre-filled with editing commands |
michael@0 | 895 | static nsresult |
michael@0 | 896 | nsEditingCommandTableConstructor(nsISupports *aOuter, REFNSIID aIID, |
michael@0 | 897 | void **aResult) |
michael@0 | 898 | { |
michael@0 | 899 | nsresult rv; |
michael@0 | 900 | nsCOMPtr<nsIControllerCommandTable> commandTable = |
michael@0 | 901 | do_CreateInstance(NS_CONTROLLERCOMMANDTABLE_CONTRACTID, &rv); |
michael@0 | 902 | if (NS_FAILED(rv)) return rv; |
michael@0 | 903 | |
michael@0 | 904 | rv = nsEditorController::RegisterEditingCommands(commandTable); |
michael@0 | 905 | if (NS_FAILED(rv)) return rv; |
michael@0 | 906 | |
michael@0 | 907 | // we don't know here whether we're being created as an instance, |
michael@0 | 908 | // or a service, so we can't become immutable |
michael@0 | 909 | |
michael@0 | 910 | return commandTable->QueryInterface(aIID, aResult); |
michael@0 | 911 | } |
michael@0 | 912 | |
michael@0 | 913 | |
michael@0 | 914 | static const mozilla::Module::CIDEntry kLayoutCIDs[] = { |
michael@0 | 915 | XPCONNECT_CIDENTRIES |
michael@0 | 916 | #ifdef DEBUG |
michael@0 | 917 | { &kNS_FRAME_UTIL_CID, false, nullptr, CreateNewFrameUtil }, |
michael@0 | 918 | { &kNS_LAYOUT_DEBUGGER_CID, false, nullptr, CreateNewLayoutDebugger }, |
michael@0 | 919 | #endif |
michael@0 | 920 | { &kNS_FRAMETRAVERSAL_CID, false, nullptr, CreateNewFrameTraversal }, |
michael@0 | 921 | { &kNS_BOXOBJECT_CID, false, nullptr, CreateNewBoxObject }, |
michael@0 | 922 | #ifdef MOZ_XUL |
michael@0 | 923 | { &kNS_LISTBOXOBJECT_CID, false, nullptr, CreateNewListBoxObject }, |
michael@0 | 924 | { &kNS_MENUBOXOBJECT_CID, false, nullptr, CreateNewMenuBoxObject }, |
michael@0 | 925 | { &kNS_POPUPBOXOBJECT_CID, false, nullptr, CreateNewPopupBoxObject }, |
michael@0 | 926 | { &kNS_CONTAINERBOXOBJECT_CID, false, nullptr, CreateNewContainerBoxObject }, |
michael@0 | 927 | { &kNS_SCROLLBOXOBJECT_CID, false, nullptr, CreateNewScrollBoxObject }, |
michael@0 | 928 | { &kNS_TREEBOXOBJECT_CID, false, nullptr, CreateNewTreeBoxObject }, |
michael@0 | 929 | #endif // MOZ_XUL |
michael@0 | 930 | #ifdef MOZ_XUL |
michael@0 | 931 | { &kIN_DOMVIEW_CID, false, nullptr, inDOMViewConstructor }, |
michael@0 | 932 | #endif |
michael@0 | 933 | { &kIN_DEEPTREEWALKER_CID, false, nullptr, inDeepTreeWalkerConstructor }, |
michael@0 | 934 | { &kIN_FLASHER_CID, false, nullptr, inFlasherConstructor }, |
michael@0 | 935 | { &kIN_CSSVALUESEARCH_CID, false, nullptr, inCSSValueSearchConstructor }, |
michael@0 | 936 | { &kIN_DOMUTILS_CID, false, nullptr, inDOMUtilsConstructor }, |
michael@0 | 937 | { &kNS_CONTENT_VIEWER_CID, false, nullptr, CreateContentViewer }, |
michael@0 | 938 | { &kNS_HTMLDOCUMENT_CID, false, nullptr, CreateHTMLDocument }, |
michael@0 | 939 | { &kNS_XMLDOCUMENT_CID, false, nullptr, CreateXMLDocument }, |
michael@0 | 940 | { &kNS_SVGDOCUMENT_CID, false, nullptr, CreateSVGDocument }, |
michael@0 | 941 | { &kNS_IMAGEDOCUMENT_CID, false, nullptr, CreateImageDocument }, |
michael@0 | 942 | { &kNS_DOMMULTIPARTBLOB_CID, false, nullptr, CreateDOMBlob }, |
michael@0 | 943 | { &kNS_DOMMULTIPARTFILE_CID, false, nullptr, CreateDOMFile }, |
michael@0 | 944 | { &kNS_DOMSELECTION_CID, false, nullptr, CreateDOMSelection }, |
michael@0 | 945 | { &kNS_CONTENTITERATOR_CID, false, nullptr, CreateContentIterator }, |
michael@0 | 946 | { &kNS_PRECONTENTITERATOR_CID, false, nullptr, CreatePreContentIterator }, |
michael@0 | 947 | { &kNS_SUBTREEITERATOR_CID, false, nullptr, CreateSubtreeIterator }, |
michael@0 | 948 | { &kNS_CANVASRENDERINGCONTEXTWEBGL_CID, false, nullptr, CreateCanvasRenderingContextWebGL }, |
michael@0 | 949 | { &kNS_TEXT_ENCODER_CID, false, nullptr, CreateTextEncoder }, |
michael@0 | 950 | { &kNS_HTMLCOPY_TEXT_ENCODER_CID, false, nullptr, CreateHTMLCopyTextEncoder }, |
michael@0 | 951 | { &kNS_XMLCONTENTSERIALIZER_CID, false, nullptr, CreateXMLContentSerializer }, |
michael@0 | 952 | { &kNS_HTMLCONTENTSERIALIZER_CID, false, nullptr, CreateHTMLContentSerializer }, |
michael@0 | 953 | { &kNS_XHTMLCONTENTSERIALIZER_CID, false, nullptr, CreateXHTMLContentSerializer }, |
michael@0 | 954 | { &kNS_PLAINTEXTSERIALIZER_CID, false, nullptr, CreatePlainTextSerializer }, |
michael@0 | 955 | { &kNS_PARSERUTILS_CID, false, nullptr, nsParserUtilsConstructor }, |
michael@0 | 956 | { &kNS_SCRIPTABLEUNESCAPEHTML_CID, false, nullptr, nsParserUtilsConstructor }, |
michael@0 | 957 | { &kNS_CONTENTPOLICY_CID, false, nullptr, CreateContentPolicy }, |
michael@0 | 958 | { &kNS_DATADOCUMENTCONTENTPOLICY_CID, false, nullptr, nsDataDocumentContentPolicyConstructor }, |
michael@0 | 959 | { &kNS_NODATAPROTOCOLCONTENTPOLICY_CID, false, nullptr, nsNoDataProtocolContentPolicyConstructor }, |
michael@0 | 960 | { &kNS_XULCONTROLLERS_CID, false, nullptr, NS_NewXULControllers }, |
michael@0 | 961 | #ifdef MOZ_XUL |
michael@0 | 962 | { &kNS_XULSORTSERVICE_CID, false, nullptr, CreateXULSortService }, |
michael@0 | 963 | { &kNS_XULTEMPLATEBUILDER_CID, false, nullptr, NS_NewXULContentBuilder }, |
michael@0 | 964 | { &kNS_XULTREEBUILDER_CID, false, nullptr, NS_NewXULTreeBuilder }, |
michael@0 | 965 | { &kNS_XULDOCUMENT_CID, false, nullptr, CreateXULDocument }, |
michael@0 | 966 | #endif |
michael@0 | 967 | { &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, nullptr, CreateContentDLF }, |
michael@0 | 968 | { &kNS_DOM_SCRIPT_OBJECT_FACTORY_CID, false, nullptr, nsDOMScriptObjectFactoryConstructor }, |
michael@0 | 969 | { &kNS_JSPROTOCOLHANDLER_CID, false, nullptr, nsJSProtocolHandler::Create }, |
michael@0 | 970 | { &kNS_JSURI_CID, false, nullptr, nsJSURIConstructor }, |
michael@0 | 971 | { &kNS_WINDOWCOMMANDTABLE_CID, false, nullptr, CreateWindowCommandTableConstructor }, |
michael@0 | 972 | { &kNS_WINDOWCONTROLLER_CID, false, nullptr, CreateWindowControllerWithSingletonCommandTable }, |
michael@0 | 973 | { &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF }, |
michael@0 | 974 | { &kNS_PLUGINDOCUMENT_CID, false, nullptr, CreatePluginDocument }, |
michael@0 | 975 | { &kNS_VIDEODOCUMENT_CID, false, nullptr, CreateVideoDocument }, |
michael@0 | 976 | { &kNS_STYLESHEETSERVICE_CID, false, nullptr, nsStyleSheetServiceConstructor }, |
michael@0 | 977 | { &kTRANSFORMIIX_XSLT_PROCESSOR_CID, false, nullptr, txMozillaXSLTProcessorConstructor }, |
michael@0 | 978 | { &kTRANSFORMIIX_XPATH_EVALUATOR_CID, false, nullptr, XPathEvaluatorConstructor }, |
michael@0 | 979 | { &kTRANSFORMIIX_NODESET_CID, false, nullptr, txNodeSetAdaptorConstructor }, |
michael@0 | 980 | { &kNS_XMLSERIALIZER_CID, false, nullptr, nsDOMSerializerConstructor }, |
michael@0 | 981 | { &kNS_FILEREADER_CID, false, nullptr, nsDOMFileReaderConstructor }, |
michael@0 | 982 | { &kNS_FORMDATA_CID, false, nullptr, nsFormDataConstructor }, |
michael@0 | 983 | { &kNS_BLOBPROTOCOLHANDLER_CID, false, nullptr, nsBlobProtocolHandlerConstructor }, |
michael@0 | 984 | { &kNS_MEDIASTREAMPROTOCOLHANDLER_CID, false, nullptr, nsMediaStreamProtocolHandlerConstructor }, |
michael@0 | 985 | { &kNS_MEDIASOURCEPROTOCOLHANDLER_CID, false, nullptr, nsMediaSourceProtocolHandlerConstructor }, |
michael@0 | 986 | { &kNS_FONTTABLEPROTOCOLHANDLER_CID, false, nullptr, nsFontTableProtocolHandlerConstructor }, |
michael@0 | 987 | { &kNS_HOSTOBJECTURI_CID, false, nullptr, nsHostObjectURIConstructor }, |
michael@0 | 988 | { &kNS_XMLHTTPREQUEST_CID, false, nullptr, nsXMLHttpRequestConstructor }, |
michael@0 | 989 | { &kNS_DOMPARSER_CID, false, nullptr, DOMParserConstructor }, |
michael@0 | 990 | { &kNS_XPCEXCEPTION_CID, false, nullptr, ExceptionConstructor }, |
michael@0 | 991 | { &kNS_DOMSESSIONSTORAGEMANAGER_CID, false, nullptr, DOMSessionStorageManagerConstructor }, |
michael@0 | 992 | { &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, DOMLocalStorageManagerConstructor }, |
michael@0 | 993 | { &kNS_DOMJSON_CID, false, nullptr, NS_NewJSON }, |
michael@0 | 994 | { &kNS_TEXTEDITOR_CID, false, nullptr, nsPlaintextEditorConstructor }, |
michael@0 | 995 | { &kINDEXEDDB_MANAGER_CID, false, nullptr, IndexedDatabaseManagerConstructor }, |
michael@0 | 996 | { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor }, |
michael@0 | 997 | { &kQUOTA_MANAGER_CID, false, nullptr, QuotaManagerConstructor }, |
michael@0 | 998 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 999 | { &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor }, |
michael@0 | 1000 | #endif |
michael@0 | 1001 | #ifdef MOZ_B2G_BT |
michael@0 | 1002 | { &kBLUETOOTHSERVICE_CID, true, nullptr, BluetoothServiceConstructor }, |
michael@0 | 1003 | #endif |
michael@0 | 1004 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1005 | { &kNS_AUDIOMANAGER_CID, true, nullptr, AudioManagerConstructor }, |
michael@0 | 1006 | { &kNS_VOLUMESERVICE_CID, true, nullptr, nsVolumeServiceConstructor }, |
michael@0 | 1007 | #endif |
michael@0 | 1008 | { &kNS_AUDIOCHANNELAGENT_CID, true, nullptr, AudioChannelAgentConstructor }, |
michael@0 | 1009 | { &kNS_HTMLEDITOR_CID, false, nullptr, nsHTMLEditorConstructor }, |
michael@0 | 1010 | { &kNS_EDITORCONTROLLER_CID, false, nullptr, nsEditorControllerConstructor }, |
michael@0 | 1011 | { &kNS_EDITINGCONTROLLER_CID, false, nullptr, nsEditingControllerConstructor }, |
michael@0 | 1012 | { &kNS_EDITORCOMMANDTABLE_CID, false, nullptr, nsEditorCommandTableConstructor }, |
michael@0 | 1013 | { &kNS_EDITINGCOMMANDTABLE_CID, false, nullptr, nsEditingCommandTableConstructor }, |
michael@0 | 1014 | { &kNS_TEXTSERVICESDOCUMENT_CID, false, nullptr, nsTextServicesDocumentConstructor }, |
michael@0 | 1015 | { &kNS_GEOLOCATION_SERVICE_CID, false, nullptr, nsGeolocationServiceConstructor }, |
michael@0 | 1016 | { &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor }, |
michael@0 | 1017 | { &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor }, |
michael@0 | 1018 | { &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager }, |
michael@0 | 1019 | #ifdef MOZ_WEBSPEECH |
michael@0 | 1020 | { &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor }, |
michael@0 | 1021 | { &kNS_SYNTHVOICEREGISTRY_CID, true, nullptr, nsSynthVoiceRegistryConstructor }, |
michael@0 | 1022 | #endif |
michael@0 | 1023 | { &kCSPSERVICE_CID, false, nullptr, CSPServiceConstructor }, |
michael@0 | 1024 | { &kNS_MIXEDCONTENTBLOCKER_CID, false, nullptr, nsMixedContentBlockerConstructor }, |
michael@0 | 1025 | { &kNS_EVENTLISTENERSERVICE_CID, false, nullptr, CreateEventListenerService }, |
michael@0 | 1026 | { &kNS_GLOBALMESSAGEMANAGER_CID, false, nullptr, CreateGlobalMessageManager }, |
michael@0 | 1027 | { &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateParentMessageManager }, |
michael@0 | 1028 | { &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateChildMessageManager }, |
michael@0 | 1029 | { &kNSCHANNELPOLICY_CID, false, nullptr, nsChannelPolicyConstructor }, |
michael@0 | 1030 | { &kNS_SCRIPTSECURITYMANAGER_CID, false, nullptr, Construct_nsIScriptSecurityManager }, |
michael@0 | 1031 | { &kNS_PRINCIPAL_CID, false, nullptr, nsPrincipalConstructor }, |
michael@0 | 1032 | { &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, nsSystemPrincipalConstructor }, |
michael@0 | 1033 | { &kNS_NULLPRINCIPAL_CID, false, nullptr, nsNullPrincipalConstructor }, |
michael@0 | 1034 | { &kNS_SECURITYNAMESET_CID, false, nullptr, nsSecurityNameSetConstructor }, |
michael@0 | 1035 | { &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor }, |
michael@0 | 1036 | #ifndef MOZ_WIDGET_GONK |
michael@0 | 1037 | #if defined(ANDROID) |
michael@0 | 1038 | { &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor }, |
michael@0 | 1039 | #endif |
michael@0 | 1040 | #endif |
michael@0 | 1041 | { &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor }, |
michael@0 | 1042 | { &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor }, |
michael@0 | 1043 | { &kSMS_SERVICE_CID, false, nullptr, nsISmsServiceConstructor }, |
michael@0 | 1044 | { &kMMS_SERVICE_CID, false, nullptr, nsIMmsServiceConstructor }, |
michael@0 | 1045 | { &kMOBILE_MESSAGE_SERVICE_CID, false, nullptr, nsIMobileMessageServiceConstructor }, |
michael@0 | 1046 | { &kMOBILE_MESSAGE_DATABASE_SERVICE_CID, false, nullptr, nsIMobileMessageDatabaseServiceConstructor }, |
michael@0 | 1047 | { &kNS_POWERMANAGERSERVICE_CID, false, nullptr, nsIPowerManagerServiceConstructor }, |
michael@0 | 1048 | { &kOSFILECONSTANTSSERVICE_CID, true, nullptr, OSFileConstantsServiceConstructor }, |
michael@0 | 1049 | { &kNS_ALARMHALSERVICE_CID, false, nullptr, nsIAlarmHalServiceConstructor }, |
michael@0 | 1050 | { &kTCPSOCKETCHILD_CID, false, nullptr, TCPSocketChildConstructor }, |
michael@0 | 1051 | { &kTCPSOCKETPARENT_CID, false, nullptr, TCPSocketParentConstructor }, |
michael@0 | 1052 | { &kTCPSERVERSOCKETCHILD_CID, false, nullptr, TCPServerSocketChildConstructor }, |
michael@0 | 1053 | { &kUDPSOCKETCHILD_CID, false, nullptr, UDPSocketChildConstructor }, |
michael@0 | 1054 | { &kNS_TIMESERVICE_CID, false, nullptr, nsITimeServiceConstructor }, |
michael@0 | 1055 | { &kNS_MEDIASTREAMCONTROLLERSERVICE_CID, false, nullptr, nsIStreamingProtocolControllerServiceConstructor }, |
michael@0 | 1056 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1057 | { &kGONK_GPS_GEOLOCATION_PROVIDER_CID, false, nullptr, nsIGeolocationProviderConstructor }, |
michael@0 | 1058 | #endif |
michael@0 | 1059 | { &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor }, |
michael@0 | 1060 | #ifdef MOZ_GAMEPAD |
michael@0 | 1061 | { &kNS_GAMEPAD_TEST_CID, false, nullptr, GamepadServiceTestConstructor }, |
michael@0 | 1062 | #endif |
michael@0 | 1063 | #ifdef ACCESSIBILITY |
michael@0 | 1064 | { &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService }, |
michael@0 | 1065 | #endif |
michael@0 | 1066 | { &kTELEPHONY_PROVIDER_CID, false, nullptr, nsITelephonyProviderConstructor }, |
michael@0 | 1067 | { nullptr } |
michael@0 | 1068 | }; |
michael@0 | 1069 | |
michael@0 | 1070 | static const mozilla::Module::ContractIDEntry kLayoutContracts[] = { |
michael@0 | 1071 | XPCONNECT_CONTRACTS |
michael@0 | 1072 | { "@mozilla.org/layout/xul-boxobject;1", &kNS_BOXOBJECT_CID }, |
michael@0 | 1073 | #ifdef MOZ_XUL |
michael@0 | 1074 | { "@mozilla.org/layout/xul-boxobject-listbox;1", &kNS_LISTBOXOBJECT_CID }, |
michael@0 | 1075 | { "@mozilla.org/layout/xul-boxobject-menu;1", &kNS_MENUBOXOBJECT_CID }, |
michael@0 | 1076 | { "@mozilla.org/layout/xul-boxobject-popup;1", &kNS_POPUPBOXOBJECT_CID }, |
michael@0 | 1077 | { "@mozilla.org/layout/xul-boxobject-container;1", &kNS_CONTAINERBOXOBJECT_CID }, |
michael@0 | 1078 | { "@mozilla.org/layout/xul-boxobject-scrollbox;1", &kNS_SCROLLBOXOBJECT_CID }, |
michael@0 | 1079 | { "@mozilla.org/layout/xul-boxobject-tree;1", &kNS_TREEBOXOBJECT_CID }, |
michael@0 | 1080 | #endif // MOZ_XUL |
michael@0 | 1081 | #ifdef MOZ_XUL |
michael@0 | 1082 | { "@mozilla.org/inspector/dom-view;1", &kIN_DOMVIEW_CID }, |
michael@0 | 1083 | #endif |
michael@0 | 1084 | { "@mozilla.org/inspector/deep-tree-walker;1", &kIN_DEEPTREEWALKER_CID }, |
michael@0 | 1085 | { "@mozilla.org/inspector/flasher;1", &kIN_FLASHER_CID }, |
michael@0 | 1086 | { "@mozilla.org/inspector/search;1?type=cssvalue", &kIN_CSSVALUESEARCH_CID }, |
michael@0 | 1087 | { IN_DOMUTILS_CONTRACTID, &kIN_DOMUTILS_CID }, |
michael@0 | 1088 | { "@mozilla.org/xml/xml-document;1", &kNS_XMLDOCUMENT_CID }, |
michael@0 | 1089 | { "@mozilla.org/svg/svg-document;1", &kNS_SVGDOCUMENT_CID }, |
michael@0 | 1090 | { NS_DOMMULTIPARTBLOB_CONTRACTID, &kNS_DOMMULTIPARTBLOB_CID }, |
michael@0 | 1091 | { NS_DOMMULTIPARTFILE_CONTRACTID, &kNS_DOMMULTIPARTFILE_CID }, |
michael@0 | 1092 | { "@mozilla.org/content/dom-selection;1", &kNS_DOMSELECTION_CID }, |
michael@0 | 1093 | { "@mozilla.org/content/post-content-iterator;1", &kNS_CONTENTITERATOR_CID }, |
michael@0 | 1094 | { "@mozilla.org/content/pre-content-iterator;1", &kNS_PRECONTENTITERATOR_CID }, |
michael@0 | 1095 | { "@mozilla.org/content/subtree-content-iterator;1", &kNS_SUBTREEITERATOR_CID }, |
michael@0 | 1096 | { "@mozilla.org/content/canvas-rendering-context;1?id=experimental-webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID }, |
michael@0 | 1097 | #ifdef MOZ_WEBGL_CONFORMANT |
michael@0 | 1098 | { "@mozilla.org/content/canvas-rendering-context;1?id=webgl", &kNS_CANVASRENDERINGCONTEXTWEBGL_CID }, |
michael@0 | 1099 | #endif |
michael@0 | 1100 | { NS_DOC_ENCODER_CONTRACTID_BASE "text/xml", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1101 | { NS_DOC_ENCODER_CONTRACTID_BASE "application/xml", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1102 | { NS_DOC_ENCODER_CONTRACTID_BASE "application/xhtml+xml", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1103 | { NS_DOC_ENCODER_CONTRACTID_BASE "image/svg+xml", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1104 | { NS_DOC_ENCODER_CONTRACTID_BASE "text/html", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1105 | { NS_DOC_ENCODER_CONTRACTID_BASE "text/plain", &kNS_TEXT_ENCODER_CID }, |
michael@0 | 1106 | { NS_HTMLCOPY_ENCODER_CONTRACTID, &kNS_HTMLCOPY_TEXT_ENCODER_CID }, |
michael@0 | 1107 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/xml", &kNS_XMLCONTENTSERIALIZER_CID }, |
michael@0 | 1108 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xml", &kNS_XMLCONTENTSERIALIZER_CID }, |
michael@0 | 1109 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xhtml+xml", &kNS_XHTMLCONTENTSERIALIZER_CID }, |
michael@0 | 1110 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "image/svg+xml", &kNS_XMLCONTENTSERIALIZER_CID }, |
michael@0 | 1111 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/html", &kNS_HTMLCONTENTSERIALIZER_CID }, |
michael@0 | 1112 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/vnd.mozilla.xul+xml", &kNS_XMLCONTENTSERIALIZER_CID }, |
michael@0 | 1113 | { NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/plain", &kNS_PLAINTEXTSERIALIZER_CID }, |
michael@0 | 1114 | { NS_PARSERUTILS_CONTRACTID, &kNS_PARSERUTILS_CID }, |
michael@0 | 1115 | { NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID, &kNS_SCRIPTABLEUNESCAPEHTML_CID }, |
michael@0 | 1116 | { NS_CONTENTPOLICY_CONTRACTID, &kNS_CONTENTPOLICY_CID }, |
michael@0 | 1117 | { NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, &kNS_DATADOCUMENTCONTENTPOLICY_CID }, |
michael@0 | 1118 | { NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, &kNS_NODATAPROTOCOLCONTENTPOLICY_CID }, |
michael@0 | 1119 | { "@mozilla.org/xul/xul-controllers;1", &kNS_XULCONTROLLERS_CID }, |
michael@0 | 1120 | #ifdef MOZ_XUL |
michael@0 | 1121 | { "@mozilla.org/xul/xul-sort-service;1", &kNS_XULSORTSERVICE_CID }, |
michael@0 | 1122 | { "@mozilla.org/xul/xul-template-builder;1", &kNS_XULTEMPLATEBUILDER_CID }, |
michael@0 | 1123 | { "@mozilla.org/xul/xul-tree-builder;1", &kNS_XULTREEBUILDER_CID }, |
michael@0 | 1124 | { "@mozilla.org/xul/xul-document;1", &kNS_XULDOCUMENT_CID }, |
michael@0 | 1125 | #endif |
michael@0 | 1126 | { CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID }, |
michael@0 | 1127 | { NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID }, |
michael@0 | 1128 | { NS_WINDOWCONTROLLER_CONTRACTID, &kNS_WINDOWCONTROLLER_CID }, |
michael@0 | 1129 | { PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID }, |
michael@0 | 1130 | { NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID }, |
michael@0 | 1131 | { TRANSFORMIIX_XSLT_PROCESSOR_CONTRACTID, &kTRANSFORMIIX_XSLT_PROCESSOR_CID }, |
michael@0 | 1132 | { NS_XPATH_EVALUATOR_CONTRACTID, &kTRANSFORMIIX_XPATH_EVALUATOR_CID }, |
michael@0 | 1133 | { TRANSFORMIIX_NODESET_CONTRACTID, &kTRANSFORMIIX_NODESET_CID }, |
michael@0 | 1134 | { NS_XMLSERIALIZER_CONTRACTID, &kNS_XMLSERIALIZER_CID }, |
michael@0 | 1135 | { NS_FILEREADER_CONTRACTID, &kNS_FILEREADER_CID }, |
michael@0 | 1136 | { NS_FORMDATA_CONTRACTID, &kNS_FORMDATA_CID }, |
michael@0 | 1137 | { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX BLOBURI_SCHEME, &kNS_BLOBPROTOCOLHANDLER_CID }, |
michael@0 | 1138 | { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MEDIASTREAMURI_SCHEME, &kNS_MEDIASTREAMPROTOCOLHANDLER_CID }, |
michael@0 | 1139 | { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX MEDIASOURCEURI_SCHEME, &kNS_MEDIASOURCEPROTOCOLHANDLER_CID }, |
michael@0 | 1140 | { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX FONTTABLEURI_SCHEME, &kNS_FONTTABLEPROTOCOLHANDLER_CID }, |
michael@0 | 1141 | { NS_XMLHTTPREQUEST_CONTRACTID, &kNS_XMLHTTPREQUEST_CID }, |
michael@0 | 1142 | { NS_DOMPARSER_CONTRACTID, &kNS_DOMPARSER_CID }, |
michael@0 | 1143 | { XPC_EXCEPTION_CONTRACTID, &kNS_XPCEXCEPTION_CID }, |
michael@0 | 1144 | { "@mozilla.org/dom/localStorage-manager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID }, |
michael@0 | 1145 | // Keeping the old ContractID for backward compatibility |
michael@0 | 1146 | { "@mozilla.org/dom/storagemanager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID }, |
michael@0 | 1147 | { "@mozilla.org/dom/sessionStorage-manager;1", &kNS_DOMSESSIONSTORAGEMANAGER_CID }, |
michael@0 | 1148 | { "@mozilla.org/dom/json;1", &kNS_DOMJSON_CID }, |
michael@0 | 1149 | { "@mozilla.org/editor/texteditor;1", &kNS_TEXTEDITOR_CID }, |
michael@0 | 1150 | { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID }, |
michael@0 | 1151 | { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID }, |
michael@0 | 1152 | { QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID }, |
michael@0 | 1153 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1154 | { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID }, |
michael@0 | 1155 | #endif |
michael@0 | 1156 | #ifdef MOZ_B2G_BT |
michael@0 | 1157 | { BLUETOOTHSERVICE_CONTRACTID, &kBLUETOOTHSERVICE_CID }, |
michael@0 | 1158 | #endif |
michael@0 | 1159 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1160 | { NS_AUDIOMANAGER_CONTRACTID, &kNS_AUDIOMANAGER_CID }, |
michael@0 | 1161 | { NS_VOLUMESERVICE_CONTRACTID, &kNS_VOLUMESERVICE_CID }, |
michael@0 | 1162 | #endif |
michael@0 | 1163 | { NS_AUDIOCHANNELAGENT_CONTRACTID, &kNS_AUDIOCHANNELAGENT_CID }, |
michael@0 | 1164 | { "@mozilla.org/editor/htmleditor;1", &kNS_HTMLEDITOR_CID }, |
michael@0 | 1165 | { "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID }, |
michael@0 | 1166 | { "@mozilla.org/editor/editingcontroller;1", &kNS_EDITINGCONTROLLER_CID }, |
michael@0 | 1167 | { "@mozilla.org/textservices/textservicesdocument;1", &kNS_TEXTSERVICESDOCUMENT_CID }, |
michael@0 | 1168 | { "@mozilla.org/geolocation/service;1", &kNS_GEOLOCATION_SERVICE_CID }, |
michael@0 | 1169 | { "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID }, |
michael@0 | 1170 | { "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID }, |
michael@0 | 1171 | { "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID }, |
michael@0 | 1172 | #ifdef MOZ_WEBSPEECH |
michael@0 | 1173 | { NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID }, |
michael@0 | 1174 | { NS_SYNTHVOICEREGISTRY_CONTRACTID, &kNS_SYNTHVOICEREGISTRY_CID }, |
michael@0 | 1175 | #endif |
michael@0 | 1176 | { CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID }, |
michael@0 | 1177 | { NS_MIXEDCONTENTBLOCKER_CONTRACTID, &kNS_MIXEDCONTENTBLOCKER_CID }, |
michael@0 | 1178 | { NS_EVENTLISTENERSERVICE_CONTRACTID, &kNS_EVENTLISTENERSERVICE_CID }, |
michael@0 | 1179 | { NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID }, |
michael@0 | 1180 | { NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_PARENTPROCESSMESSAGEMANAGER_CID }, |
michael@0 | 1181 | { NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID }, |
michael@0 | 1182 | { NSCHANNELPOLICY_CONTRACTID, &kNSCHANNELPOLICY_CID }, |
michael@0 | 1183 | { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID }, |
michael@0 | 1184 | { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID }, |
michael@0 | 1185 | { NS_PRINCIPAL_CONTRACTID, &kNS_PRINCIPAL_CID }, |
michael@0 | 1186 | { NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID }, |
michael@0 | 1187 | { NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID }, |
michael@0 | 1188 | { NS_SECURITYNAMESET_CONTRACTID, &kNS_SECURITYNAMESET_CID }, |
michael@0 | 1189 | { NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID }, |
michael@0 | 1190 | #ifndef MOZ_WIDGET_GONK |
michael@0 | 1191 | #if defined(ANDROID) |
michael@0 | 1192 | { "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID }, |
michael@0 | 1193 | #endif |
michael@0 | 1194 | #endif |
michael@0 | 1195 | { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID }, |
michael@0 | 1196 | { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID }, |
michael@0 | 1197 | { SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID }, |
michael@0 | 1198 | { MMS_SERVICE_CONTRACTID, &kMMS_SERVICE_CID }, |
michael@0 | 1199 | { MOBILE_MESSAGE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_SERVICE_CID }, |
michael@0 | 1200 | { MOBILE_MESSAGE_DATABASE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_DATABASE_SERVICE_CID }, |
michael@0 | 1201 | { POWERMANAGERSERVICE_CONTRACTID, &kNS_POWERMANAGERSERVICE_CID }, |
michael@0 | 1202 | { OSFILECONSTANTSSERVICE_CONTRACTID, &kOSFILECONSTANTSSERVICE_CID }, |
michael@0 | 1203 | { ALARMHALSERVICE_CONTRACTID, &kNS_ALARMHALSERVICE_CID }, |
michael@0 | 1204 | { "@mozilla.org/tcp-socket-child;1", &kTCPSOCKETCHILD_CID }, |
michael@0 | 1205 | { "@mozilla.org/tcp-socket-parent;1", &kTCPSOCKETPARENT_CID }, |
michael@0 | 1206 | { "@mozilla.org/tcp-server-socket-child;1", &kTCPSERVERSOCKETCHILD_CID }, |
michael@0 | 1207 | { "@mozilla.org/udp-socket-child;1", &kUDPSOCKETCHILD_CID }, |
michael@0 | 1208 | { TIMESERVICE_CONTRACTID, &kNS_TIMESERVICE_CID }, |
michael@0 | 1209 | { MEDIASTREAMCONTROLLERSERVICE_CONTRACTID, &kNS_MEDIASTREAMCONTROLLERSERVICE_CID }, |
michael@0 | 1210 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1211 | { GONK_GPS_GEOLOCATION_PROVIDER_CONTRACTID, &kGONK_GPS_GEOLOCATION_PROVIDER_CID }, |
michael@0 | 1212 | #endif |
michael@0 | 1213 | #ifdef MOZ_GAMEPAD |
michael@0 | 1214 | { NS_GAMEPAD_TEST_CONTRACTID, &kNS_GAMEPAD_TEST_CID }, |
michael@0 | 1215 | #endif |
michael@0 | 1216 | { MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID }, |
michael@0 | 1217 | #ifdef ACCESSIBILITY |
michael@0 | 1218 | { "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID }, |
michael@0 | 1219 | { "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID }, |
michael@0 | 1220 | #endif |
michael@0 | 1221 | { TELEPHONY_PROVIDER_CONTRACTID, &kTELEPHONY_PROVIDER_CID }, |
michael@0 | 1222 | { nullptr } |
michael@0 | 1223 | }; |
michael@0 | 1224 | |
michael@0 | 1225 | static const mozilla::Module::CategoryEntry kLayoutCategories[] = { |
michael@0 | 1226 | XPCONNECT_CATEGORIES |
michael@0 | 1227 | { "content-policy", NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID }, |
michael@0 | 1228 | { "content-policy", NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID }, |
michael@0 | 1229 | { "content-policy", "CSPService", CSPSERVICE_CONTRACTID }, |
michael@0 | 1230 | { "content-policy", NS_MIXEDCONTENTBLOCKER_CONTRACTID, NS_MIXEDCONTENTBLOCKER_CONTRACTID }, |
michael@0 | 1231 | { "net-channel-event-sinks", "CSPService", CSPSERVICE_CONTRACTID }, |
michael@0 | 1232 | { JAVASCRIPT_GLOBAL_STATIC_NAMESET_CATEGORY, "PrivilegeManager", NS_SECURITYNAMESET_CONTRACTID }, |
michael@0 | 1233 | { "app-startup", "Script Security Manager", "service," NS_SCRIPTSECURITYMANAGER_CONTRACTID }, |
michael@0 | 1234 | { TOPIC_WEB_APP_CLEAR_DATA, "QuotaManager", "service," QUOTA_MANAGER_CONTRACTID }, |
michael@0 | 1235 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1236 | { "app-startup", "Volume Service", "service," NS_VOLUMESERVICE_CONTRACTID }, |
michael@0 | 1237 | #endif |
michael@0 | 1238 | CONTENTDLF_CATEGORIES |
michael@0 | 1239 | #ifdef MOZ_WIDGET_GONK |
michael@0 | 1240 | { "profile-after-change", "Gonk System Worker Manager", SYSTEMWORKERMANAGER_CONTRACTID }, |
michael@0 | 1241 | #endif |
michael@0 | 1242 | #ifdef MOZ_B2G_BT |
michael@0 | 1243 | { "profile-after-change", "Bluetooth Service", BLUETOOTHSERVICE_CONTRACTID }, |
michael@0 | 1244 | #endif |
michael@0 | 1245 | { nullptr } |
michael@0 | 1246 | }; |
michael@0 | 1247 | |
michael@0 | 1248 | static void |
michael@0 | 1249 | LayoutModuleDtor() |
michael@0 | 1250 | { |
michael@0 | 1251 | Shutdown(); |
michael@0 | 1252 | nsContentUtils::XPCOMShutdown(); |
michael@0 | 1253 | |
michael@0 | 1254 | // Layout depends heavily on gfx and imagelib, so we want to make sure that |
michael@0 | 1255 | // these modules are shut down after all the layout cleanup runs. |
michael@0 | 1256 | mozilla::image::ShutdownModule(); |
michael@0 | 1257 | gfxPlatform::Shutdown(); |
michael@0 | 1258 | |
michael@0 | 1259 | nsScriptSecurityManager::Shutdown(); |
michael@0 | 1260 | xpcModuleDtor(); |
michael@0 | 1261 | } |
michael@0 | 1262 | |
michael@0 | 1263 | static const mozilla::Module kLayoutModule = { |
michael@0 | 1264 | mozilla::Module::kVersion, |
michael@0 | 1265 | kLayoutCIDs, |
michael@0 | 1266 | kLayoutContracts, |
michael@0 | 1267 | kLayoutCategories, |
michael@0 | 1268 | nullptr, |
michael@0 | 1269 | Initialize, |
michael@0 | 1270 | LayoutModuleDtor |
michael@0 | 1271 | }; |
michael@0 | 1272 | |
michael@0 | 1273 | NSMODULE_DEFN(nsLayoutModule) = &kLayoutModule; |