Bug 1478124: Part 8b - Update DocShell module to use a static component manifest. r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D15040

--HG--
extra : rebase_source : d89ac470241cb6f6a43c29c6e90b1c0e4fc78028
extra : source : b0444e0bc801f828b49f9953a73498cf5ff5024b
This commit is contained in:
Kris Maglione 2018-12-16 17:27:58 -08:00
Родитель b83df4e952
Коммит eb14dd1d2c
46 изменённых файлов: 286 добавлений и 416 удалений

Просмотреть файл

@ -20,10 +20,10 @@
# include "Logging.h"
#endif
#include "mozilla/Components.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/dom/Event.h" // for Event
#include "nsContentUtils.h"
#include "nsCURILoader.h"
#include "nsDocShellLoadTypes.h"
#include "nsIChannel.h"
#include "nsIInterfaceRequestorUtils.h"
@ -171,8 +171,7 @@ bool DocManager::IsProcessingRefreshDriverNotification() const {
// DocManager protected
bool DocManager::Init() {
nsCOMPtr<nsIWebProgress> progress =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
if (!progress) return false;
@ -183,8 +182,7 @@ bool DocManager::Init() {
}
void DocManager::Shutdown() {
nsCOMPtr<nsIWebProgress> progress =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
if (progress)
progress->RemoveProgressListener(

Просмотреть файл

@ -53,11 +53,11 @@
#include "nsAboutProtocolUtils.h"
#include "nsIClassInfo.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
#include "nsIChromeRegistry.h"
#include "nsIResProtocolHandler.h"
#include "nsIContentSecurityPolicy.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Components.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/NullPrincipal.h"
@ -1137,7 +1137,7 @@ nsScriptSecurityManager::CheckLoadURIStrWithPrincipal(
// Now start testing fixup -- since aTargetURIStr is a string, not
// an nsIURI, we may well end up fixing it up before loading.
// Note: This needs to stay in sync with the nsIURIFixup api.
nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
nsCOMPtr<nsIURIFixup> fixup = components::URIFixup::Service();
if (!fixup) {
return rv;
}

Просмотреть файл

@ -38,15 +38,6 @@ class ChildProcessChannelListener final
nsDataHashtable<nsUint64HashKey, nsCOMPtr<nsIChildChannel>> mChannels;
};
#define NS_CHILDPROCESSCHANNELLISTENER_CID \
{ \
0x397b43f3, 0x1470, 0x4542, { \
0x8a, 0x40, 0xc7, 0x18, 0xf7, 0x75, 0x35, 0x63 \
} \
}
#define NS_CHILDPROCESSCHANNELLISTENER_CONTRACTID \
"@mozilla.org/network/childProcessChannelListener;1"
} // namespace dom
} // namespace mozilla

Просмотреть файл

@ -36,7 +36,6 @@ DIRS += [
]
XPIDL_SOURCES += [
'nsCDefaultURIFixup.idl',
'nsIContentViewer.idl',
'nsIContentViewerEdit.idl',
'nsIDocShell.idl',

Просмотреть файл

@ -23,12 +23,4 @@ class nsAboutRedirector : public nsIAboutModule {
virtual ~nsAboutRedirector() {}
};
/* 56ebedd4-6ccf-48e8-bdae-adc77f044567 */
#define NS_ABOUT_REDIRECTOR_MODULE_CID \
{ \
0x56ebedd4, 0x6ccf, 0x48e8, { \
0xbd, 0xae, 0xad, 0xc7, 0x7f, 0x04, 0x45, 0x67 \
} \
}
#endif // nsAboutRedirector_h__

Просмотреть файл

@ -1,13 +0,0 @@
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%{ C++
// {214C48A0-B57F-11d4-959C-0020183BF181}
#define NS_DEFAULTURIFIXUP_CID \
{ 0x214c48a0, 0xb57f, 0x11d4, { 0x95, 0x9c, 0x0, 0x20, 0x18, 0x3b, 0xf1, 0x81 } }
#define NS_URIFIXUP_CONTRACTID \
"@mozilla.org/docshell/urifixup;1"
%}

Просмотреть файл

@ -20,6 +20,7 @@
#include "mozilla/AutoRestore.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Casting.h"
#include "mozilla/Components.h"
#include "mozilla/Encoding.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/HTMLEditor.h"
@ -160,7 +161,6 @@
#include "nsArray.h"
#include "nsArrayUtils.h"
#include "nsAutoPtr.h"
#include "nsCDefaultURIFixup.h"
#include "nsCExternalHandlerService.h"
#include "nsContentDLF.h"
#include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
@ -399,7 +399,8 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext)
NS_ASSERTION(sURIFixup == nullptr,
"Huh, sURIFixup not null in first nsDocShell ctor!");
CallGetService(NS_URIFIXUP_CONTRACTID, &sURIFixup);
nsCOMPtr<nsIURIFixup> uriFixup = components::URIFixup::Service();
uriFixup.forget(&sURIFixup);
}
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
@ -9628,13 +9629,12 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
return NS_OK;
}
nsresult rv;
nsCOMPtr<nsIURILoader> uriLoader =
do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return rv;
nsCOMPtr<nsIURILoader> uriLoader = components::URILoader::Service();
if (NS_WARN_IF(!uriLoader)) {
return NS_ERROR_UNEXPECTED;
}
nsresult rv;
if (IsFrame()) {
MOZ_ASSERT(aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_IFRAME ||
aContentPolicyType == nsIContentPolicy::TYPE_INTERNAL_FRAME,
@ -11267,7 +11267,7 @@ nsresult nsDocShell::AddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel,
// Create a new entry if necessary.
if (!entry) {
entry = do_CreateInstance(NS_SHENTRY_CONTRACTID);
entry = components::SHEntry::Create();
if (!entry) {
return NS_ERROR_OUT_OF_MEMORY;

Просмотреть файл

@ -13,13 +13,6 @@
#include "nsStringFwd.h"
#include "mozilla/Attributes.h"
#define NS_WEBNAVIGATION_INFO_CID \
{ \
0xf30bc0a2, 0x958b, 0x4287, { \
0xbf, 0x62, 0xce, 0x38, 0xba, 0x0c, 0x81, 0x1e \
} \
}
class nsWebNavigationInfo final : public nsIWebNavigationInfo {
public:
nsWebNavigationInfo() {}

Просмотреть файл

@ -0,0 +1,177 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
about_pages = [
'about',
'addons',
'buildconfig',
'checkerboard',
'crashcontent',
'crashparent',
'credits',
'license',
'logo',
'memory',
'mozilla',
'neterror',
'networking',
'performance',
'plugins',
'printpreview',
'serviceworkers',
'srcdoc',
'support',
'telemetry',
'url-classifier',
'webrtc',
]
if not defined('NIGHTLY_BUILD') or CONFIG['MOZ_BUILD_APP'] != 'browser':
about_pages.append('config')
if defined('MOZ_CRASHREPORTER'):
about_pages.append('crashes')
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] != 'android':
about_pages.append('profiles')
Headers = ['/docshell/build/nsDocShellModule.h']
InitFunc = 'mozilla::InitDocShellModule'
UnloadFunc = 'mozilla::UnloadDocShellModule'
Classes = [
{
'name': 'SHEntry',
'cid': '{bfd1a791-ad9f-11d3-bdc7-0050040a9b44}',
'contract_ids': ['@mozilla.org/browser/session-history-entry;1'],
'type': 'nsSHEntry',
'headers': ['/docshell/shistory/nsSHEntry.h'],
},
{
'name': 'DocLoader',
'cid': '{057b04d0-0ccf-11d2-beba-00805f8a66dc}',
'contract_ids': ['@mozilla.org/docloaderservice;1'],
'type': 'nsDocLoader',
'headers': ['nsDocLoader.h'],
'init_method': 'Init',
},
{
'name': 'URIFixup',
'cid': '{214c48a0-b57f-11d4-959c-0020183bf181}',
'contract_ids': ['@mozilla.org/docshell/urifixup;1'],
'type': 'nsDefaultURIFixup',
'headers': ['/docshell/base/nsDefaultURIFixup.h'],
},
{
'cid': '{a7f800e0-4306-11d4-98d0-001083010e9b}',
'contract_ids': [
'@mozilla.org/mime;1',
'@mozilla.org/uriloader/external-helper-app-service;1',
'@mozilla.org/uriloader/external-protocol-service;1',
],
'type': 'nsOSHelperAppService',
'headers': ['nsOSHelperAppService.h'],
'init_method': 'Init',
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{397b43f3-1470-4542-8a40-c718f7753563}',
'contract_ids': ['@mozilla.org/network/childProcessChannelListener;1'],
'singleton': True,
'type': 'mozilla::dom::ChildProcessChannelListener',
'constructor': 'mozilla::dom::ChildProcessChannelListener::GetSingleton',
'headers': ['mozilla/dom/ChildProcessChannelListener.h'],
'processes': ProcessSelector.CONTENT_PROCESS_ONLY,
},
{
'cid': '{56ebedd4-6ccf-48e8-bdae-adc77f044567}',
'contract_ids': [
'@mozilla.org/network/protocol/about;1?what=%s' % path
for path in about_pages
],
'legacy_constructor': 'nsAboutRedirector::Create',
'headers': ['/docshell/base/nsAboutRedirector.h'],
},
{
'cid': '{bd6390c8-fbea-11d4-98f6-001083010e9b}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=default'],
'type': 'nsExternalProtocolHandler',
'headers': ['/uriloader/exthandler/nsExternalProtocolHandler.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'name': 'OfflineCacheUpdate',
'cid': '{ec06f3fc-70db-4ecd-94e0-a6e91ca44d8a}',
'contract_ids': ['@mozilla.org/offlinecacheupdate-service;1'],
'singleton': True,
'type': 'nsOfflineCacheUpdateService',
'headers': ['/uriloader/prefetch/nsOfflineCacheUpdate.h'],
'constructor': 'nsOfflineCacheUpdateService::GetInstance',
},
{
'cid': '{95790842-75a0-430d-98bf-f5ce3788ea6d}',
'contract_ids': ['@mozilla.org/ospermissionrequest;1'],
'type': 'nsOSPermissionRequest',
'headers': ['nsOSPermissionRequest.h'],
'processes': ProcessSelector.MAIN_PROCESS_ONLY,
},
{
'name': 'Prefetch',
'cid': '{6b8bdffc-3394-417d-be83-a81b7c0f63bf}',
'contract_ids': ['@mozilla.org/prefetch-service;1'],
'type': 'nsPrefetchService',
'headers': ['/uriloader/prefetch/nsPrefetchService.h'],
'init_method': 'Init',
},
{
'cid': '{c4b6fb7c-bfb1-49dc-a65f-035796524b53}',
'contract_ids': ['@mozilla.org/uriloader/handler-service;1'],
'type': 'mozilla::dom::ContentHandlerService',
'headers': ['ContentHandlerService.h'],
'init_method': 'Init',
'processes': ProcessSelector.CONTENT_PROCESS_ONLY,
},
{
'cid': '{bc0017e3-2438-47be-a567-41db58f17627}',
'contract_ids': ['@mozilla.org/uriloader/local-handler-app;1'],
'type': 'PlatformLocalHandlerApp_t',
'headers': ['/uriloader/exthandler/nsLocalHandlerApp.h'],
},
{
'name': 'URILoader',
'cid': '{9f6d5d40-90e7-11d3-af80-00a024ffc08c}',
'contract_ids': ['@mozilla.org/uriloader;1'],
'type': 'nsURILoader',
'headers': ['nsURILoader.h'],
},
{
'cid': '{f30bc0a2-958b-4287-bf62-ce38ba0c811e}',
'contract_ids': ['@mozilla.org/webnavigation-info;1'],
'type': 'nsWebNavigationInfo',
'headers': ['/docshell/base/nsWebNavigationInfo.h'],
'init_method': 'Init',
},
]
if defined('MOZ_ENABLE_DBUS'):
Classes += [
{
'name': 'DBusHandlerApp',
'cid': '{6c3c274b-4cbf-4bb5-a635-05ad2cbb6535}',
'contract_ids': ['@mozilla.org/uriloader/dbus-handler-app;1'],
'type': 'nsDBusHandlerApp',
'headers': ['/uriloader/exthandler/nsDBusHandlerApp.h'],
},
]
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
Classes += [
{
'cid': '{4bf1f8ef-d947-4ba3-9cd3-8c9a54a63a1c}',
'contract_ids': ['@mozilla.org/uriloader/external-url-handler-service;1'],
'type': 'nsExternalURLHandlerService',
'headers': ['nsExternalURLHandlerService.h'],
},
]

Просмотреть файл

@ -13,11 +13,11 @@ SOURCES += [
]
LOCAL_INCLUDES += [
'/docshell/base',
'/docshell/shistory',
'/uriloader/base',
'/uriloader/exthandler',
'/uriloader/prefetch',
]
XPCOM_MANIFESTS += [
'components.conf',
]
include('/ipc/chromium/chromium-config.mozbuild')

Просмотреть файл

@ -4,53 +4,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ModuleUtils.h"
#include "nsDocShellCID.h"
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/dom/ChildProcessChannelListener.h"
#include "nsDocShell.h"
#include "nsDefaultURIFixup.h"
#include "nsWebNavigationInfo.h"
#include "nsAboutRedirector.h"
#include "nsCDefaultURIFixup.h"
// uriloader
#include "nsURILoader.h"
#include "nsDocLoader.h"
#include "nsOSHelperAppService.h"
#include "nsOSPermissionRequest.h"
#include "nsExternalProtocolHandler.h"
#include "nsPrefetchService.h"
#include "nsOfflineCacheUpdate.h"
#include "nsLocalHandlerApp.h"
#include "ContentHandlerService.h"
#ifdef MOZ_ENABLE_DBUS
# include "nsDBusHandlerApp.h"
#endif
#if defined(MOZ_WIDGET_ANDROID)
# include "nsExternalURLHandlerService.h"
#endif
// session history
#include "nsSHEntry.h"
#include "nsSHEntryShared.h"
#include "nsSHistory.h"
using mozilla::dom::ChildProcessChannelListener;
using mozilla::dom::ContentHandlerService;
static bool gInitialized = false;
namespace mozilla {
// The one time initialization for this module
static nsresult Initialize() {
MOZ_ASSERT(!gInitialized, "docshell module already initialized");
if (gInitialized) {
return NS_OK;
}
gInitialized = true;
nsresult InitDocShellModule() {
mozilla::dom::BrowsingContext::Init();
nsresult rv = nsSHistory::Startup();
NS_ENSURE_SUCCESS(rv, rv);
@ -58,154 +21,9 @@ static nsresult Initialize() {
return NS_OK;
}
static void Shutdown() {
void UnloadDocShellModule() {
nsSHistory::Shutdown();
nsSHEntryShared::Shutdown();
gInitialized = false;
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultURIFixup)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWebNavigationInfo, Init)
// uriloader
NS_GENERIC_FACTORY_CONSTRUCTOR(nsURILoader)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDocLoader, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsOSHelperAppService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefetchService, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
nsOfflineCacheUpdateService, nsOfflineCacheUpdateService::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR(PlatformLocalHandlerApp_t)
#ifdef MOZ_ENABLE_DBUS
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDBusHandlerApp)
#endif
#if defined(MOZ_WIDGET_ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalURLHandlerService)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ContentHandlerService, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
ChildProcessChannelListener, ChildProcessChannelListener::GetSingleton)
// OS access permissions
NS_GENERIC_FACTORY_CONSTRUCTOR(nsOSPermissionRequest)
// session history
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSHEntry)
NS_DEFINE_NAMED_CID(NS_DEFAULTURIFIXUP_CID);
NS_DEFINE_NAMED_CID(NS_WEBNAVIGATION_INFO_CID);
NS_DEFINE_NAMED_CID(NS_ABOUT_REDIRECTOR_MODULE_CID);
NS_DEFINE_NAMED_CID(NS_URI_LOADER_CID);
NS_DEFINE_NAMED_CID(NS_DOCUMENTLOADER_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_EXTERNALHELPERAPPSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_EXTERNALPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_PREFETCHSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_OFFLINECACHEUPDATESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_LOCALHANDLERAPP_CID);
NS_DEFINE_NAMED_CID(NS_OSPERMISSIONREQUEST_CID);
#ifdef MOZ_ENABLE_DBUS
NS_DEFINE_NAMED_CID(NS_DBUSHANDLERAPP_CID);
#endif
#if defined(MOZ_WIDGET_ANDROID)
NS_DEFINE_NAMED_CID(NS_EXTERNALURLHANDLERSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_SHENTRY_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTHANDLERSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_CHILDPROCESSCHANNELLISTENER_CID);
const mozilla::Module::CIDEntry kDocShellCIDs[] = {
// clang-format off
{ &kNS_DEFAULTURIFIXUP_CID, false, nullptr, nsDefaultURIFixupConstructor },
{ &kNS_WEBNAVIGATION_INFO_CID, false, nullptr, nsWebNavigationInfoConstructor },
{ &kNS_ABOUT_REDIRECTOR_MODULE_CID, false, nullptr, nsAboutRedirector::Create },
{ &kNS_URI_LOADER_CID, false, nullptr, nsURILoaderConstructor },
{ &kNS_DOCUMENTLOADER_SERVICE_CID, false, nullptr, nsDocLoaderConstructor },
{ &kNS_EXTERNALHELPERAPPSERVICE_CID, false, nullptr, nsOSHelperAppServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_OSPERMISSIONREQUEST_CID, false, nullptr, nsOSPermissionRequestConstructor },
{ &kNS_CONTENTHANDLERSERVICE_CID, false, nullptr, ContentHandlerServiceConstructor,
mozilla::Module::CONTENT_PROCESS_ONLY },
{ &kNS_EXTERNALPROTOCOLHANDLER_CID, false, nullptr, nsExternalProtocolHandlerConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_PREFETCHSERVICE_CID, false, nullptr, nsPrefetchServiceConstructor },
{ &kNS_OFFLINECACHEUPDATESERVICE_CID, false, nullptr, nsOfflineCacheUpdateServiceConstructor },
{ &kNS_LOCALHANDLERAPP_CID, false, nullptr, PlatformLocalHandlerApp_tConstructor },
#ifdef MOZ_ENABLE_DBUS
{ &kNS_DBUSHANDLERAPP_CID, false, nullptr, nsDBusHandlerAppConstructor },
#endif
#if defined(MOZ_WIDGET_ANDROID)
{ &kNS_EXTERNALURLHANDLERSERVICE_CID, false, nullptr, nsExternalURLHandlerServiceConstructor },
#endif
{ &kNS_SHENTRY_CID, false, nullptr, nsSHEntryConstructor },
{ &kNS_CHILDPROCESSCHANNELLISTENER_CID, false, nullptr, ChildProcessChannelListenerConstructor },
{ nullptr }
// clang-format on
};
const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
// clang-format off
{ NS_URIFIXUP_CONTRACTID, &kNS_DEFAULTURIFIXUP_CID },
{ NS_WEBNAVIGATION_INFO_CONTRACTID, &kNS_WEBNAVIGATION_INFO_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "about", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "addons", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "buildconfig", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "checkerboard", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#if !defined(NIGHTLY_BUILD) || !defined(MOZ_BUILD_APP_IS_BROWSER)
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#endif
#ifdef MOZ_CRASHREPORTER
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashes", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashparent", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "crashcontent", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "credits", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "license", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "logo", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "memory", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "mozilla", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "neterror", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "networking", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "performance", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "serviceworkers", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#ifndef ANDROID
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "profiles", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "srcdoc", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "support", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "telemetry", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "webrtc", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "printpreview", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "url-classifier", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_URI_LOADER_CONTRACTID, &kNS_URI_LOADER_CID },
{ NS_DOCUMENTLOADER_SERVICE_CONTRACTID, &kNS_DOCUMENTLOADER_SERVICE_CID },
{ NS_HANDLERSERVICE_CONTRACTID, &kNS_CONTENTHANDLERSERVICE_CID, mozilla::Module::CONTENT_PROCESS_ONLY },
{ NS_EXTERNALHELPERAPPSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID },
{ NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_MIMESERVICE_CONTRACTID, &kNS_EXTERNALHELPERAPPSERVICE_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"default", &kNS_EXTERNALPROTOCOLHANDLER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_PREFETCHSERVICE_CONTRACTID, &kNS_PREFETCHSERVICE_CID },
{ NS_OFFLINECACHEUPDATESERVICE_CONTRACTID, &kNS_OFFLINECACHEUPDATESERVICE_CID },
{ NS_LOCALHANDLERAPP_CONTRACTID, &kNS_LOCALHANDLERAPP_CID },
#ifdef MOZ_ENABLE_DBUS
{ NS_DBUSHANDLERAPP_CONTRACTID, &kNS_DBUSHANDLERAPP_CID },
#endif
#if defined(MOZ_WIDGET_ANDROID)
{ NS_EXTERNALURLHANDLERSERVICE_CONTRACTID, &kNS_EXTERNALURLHANDLERSERVICE_CID },
#endif
{ NS_SHENTRY_CONTRACTID, &kNS_SHENTRY_CID },
{ NS_OSPERMISSIONREQUEST_CONTRACTID, &kNS_OSPERMISSIONREQUEST_CID, mozilla::Module::MAIN_PROCESS_ONLY },
{ NS_CHILDPROCESSCHANNELLISTENER_CONTRACTID, &kNS_CHILDPROCESSCHANNELLISTENER_CID, mozilla::Module::CONTENT_PROCESS_ONLY },
{ nullptr }
// clang-format on
};
static const mozilla::Module kDocShellModule = {
mozilla::Module::kVersion,
kDocShellCIDs,
kDocShellContracts,
nullptr,
nullptr,
Initialize,
Shutdown,
mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
NSMODULE_DEFN(docshell_provider) = &kDocShellModule;
} // namespace mozilla

Просмотреть файл

@ -0,0 +1,20 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsDocShellModule_h
#define nsDocShellModule_h
#include "nscore.h"
namespace mozilla {
nsresult InitDocShellModule();
void UnloadDocShellModule();
} // namespace mozilla
#endif

Просмотреть файл

@ -397,12 +397,3 @@ interface nsISHEntry : nsISupports
[noscript] void ReplaceChild(in nsISHEntry aNewChild);
};
%{ C++
// {BFD1A791-AD9F-11d3-BDC7-0050040A9B44}
#define NS_SHENTRY_CID \
{0xbfd1a791, 0xad9f, 0x11d3, {0xbd, 0xc7, 0x0, 0x50, 0x4, 0xa, 0x9b, 0x44}}
#define NS_SHENTRY_CONTRACTID \
"@mozilla.org/browser/session-history-entry;1"
%}

Просмотреть файл

@ -6,6 +6,7 @@
#include "Link.h"
#include "mozilla/Components.h"
#include "mozilla/EventStates.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/Element.h"
@ -19,7 +20,6 @@
#include "nsISizeOf.h"
#include "nsIDocShell.h"
#include "nsIPrefetchService.h"
#include "nsCPrefetchService.h"
#include "nsStyleLinkElement.h"
#include "nsEscape.h"
@ -134,7 +134,7 @@ void Link::TryDNSPrefetchOrPreconnectOrPrefetchOrPreloadOrPrerender() {
(linkTypes & nsStyleLinkElement::eNEXT) ||
(linkTypes & nsStyleLinkElement::ePRELOAD)) {
nsCOMPtr<nsIPrefetchService> prefetchService(
do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
components::Prefetch::Service());
if (prefetchService) {
nsCOMPtr<nsIURI> uri(GetURI());
if (uri) {
@ -209,8 +209,7 @@ void Link::UpdatePreload(nsAtom *aName, const nsAttrValue *aValue,
return;
}
nsCOMPtr<nsIPrefetchService> prefetchService(
do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
nsCOMPtr<nsIPrefetchService> prefetchService(components::Prefetch::Service());
if (!prefetchService) {
return;
}
@ -310,8 +309,7 @@ void Link::UpdatePreload(nsAtom *aName, const nsAttrValue *aValue,
}
void Link::CancelPrefetchOrPreload() {
nsCOMPtr<nsIPrefetchService> prefetchService(
do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
nsCOMPtr<nsIPrefetchService> prefetchService(components::Prefetch::Service());
if (prefetchService) {
nsCOMPtr<nsIURI> uri(GetURI());
if (uri) {

Просмотреть файл

@ -11,7 +11,6 @@
#include "nsIDocShell.h"
#include "nsDocShellLoadState.h"
#include "nsIWebNavigation.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "nsIURL.h"
#include "nsIURIMutator.h"
@ -31,6 +30,7 @@
#include "nsGlobalWindow.h"
#include "mozilla/Likely.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Components.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/LocationBinding.h"
@ -192,8 +192,7 @@ nsresult Location::GetURI(nsIURI** aURI, bool aGetInnermostURI) {
NS_ASSERTION(uri, "nsJARURI screwed up?");
nsCOMPtr<nsIURIFixup> urifixup(do_GetService(NS_URIFIXUP_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIURIFixup> urifixup(components::URIFixup::Service());
return urifixup->CreateExposableURI(uri, aURI);
}

Просмотреть файл

@ -10,13 +10,14 @@
*/
#include "nsContentSink.h"
#include "mozilla/Components.h"
#include "mozilla/dom/Document.h"
#include "mozilla/css/Loader.h"
#include "mozilla/dom/SRILogHelper.h"
#include "nsStyleLinkElement.h"
#include "nsIDocShell.h"
#include "nsILoadContext.h"
#include "nsCPrefetchService.h"
#include "nsIPrefetchService.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsIMIMEHeaderParam.h"
@ -825,8 +826,7 @@ void nsContentSink::PrefetchPreloadHref(const nsAString& aHref,
const nsAString& aAs,
const nsAString& aType,
const nsAString& aMedia) {
nsCOMPtr<nsIPrefetchService> prefetchService(
do_GetService(NS_PREFETCHSERVICE_CONTRACTID));
nsCOMPtr<nsIPrefetchService> prefetchService(components::Prefetch::Service());
if (prefetchService) {
// construct URI using document charset
auto encoding = mDocument->GetDocumentCharacterSet();
@ -1126,7 +1126,7 @@ void nsContentSink::ProcessOfflineManifest(const nsAString& aManifestSpec) {
break;
case CACHE_SELECTION_UPDATE: {
nsCOMPtr<nsIOfflineCacheUpdateService> updateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID);
components::OfflineCacheUpdate::Service();
if (updateService) {
updateService->ScheduleOnDocumentStop(

Просмотреть файл

@ -40,6 +40,7 @@
#include "mozilla/Base64.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/Components.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/dom/BlobURLProtocolHandler.h"
@ -107,7 +108,6 @@
#include "nsContentList.h"
#include "nsContentPolicyUtils.h"
#include "nsContentSecurityManager.h"
#include "nsCPrefetchService.h"
#include "nsCRT.h"
#include "nsCycleCollectionParticipant.h"
#include "nsCycleCollector.h"
@ -1784,7 +1784,7 @@ void nsContentUtils::GetOfflineAppManifest(Document* aDocument, nsIURI** aURI) {
/* static */
bool nsContentUtils::OfflineAppAllowed(nsIURI* aURI) {
nsCOMPtr<nsIOfflineCacheUpdateService> updateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID);
components::OfflineCacheUpdate::Service();
if (!updateService) {
return false;
}
@ -1798,7 +1798,7 @@ bool nsContentUtils::OfflineAppAllowed(nsIURI* aURI) {
/* static */
bool nsContentUtils::OfflineAppAllowed(nsIPrincipal* aPrincipal) {
nsCOMPtr<nsIOfflineCacheUpdateService> updateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID);
components::OfflineCacheUpdate::Service();
if (!updateService) {
return false;
}
@ -1822,7 +1822,7 @@ bool nsContentUtils::MaybeAllowOfflineAppByDefault(nsIPrincipal* aPrincipal) {
if (!allowedByDefault) return false;
nsCOMPtr<nsIOfflineCacheUpdateService> updateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID);
components::OfflineCacheUpdate::Service();
if (!updateService) {
return false;
}

Просмотреть файл

@ -149,7 +149,6 @@
#include "nsContentUtils.h"
#include "nsCSSProps.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "nsIObserverService.h"

Просмотреть файл

@ -95,6 +95,7 @@
#include "mozilla/dom/ToJSValue.h"
#include "nsJSPrincipals.h"
#include "mozilla/Attributes.h"
#include "mozilla/Components.h"
#include "mozilla/Debug.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStates.h"
@ -153,7 +154,6 @@
#include "nsCSSProps.h"
#include "nsIURIFixup.h"
#include "nsIURIMutator.h"
#include "nsCDefaultURIFixup.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "nsIObserverService.h"
@ -4557,7 +4557,7 @@ void nsGlobalWindowOuter::MakeScriptDialogTitle(
if (NS_SUCCEEDED(rv) && uri) {
// remove user:pass for privacy and spoof prevention
nsCOMPtr<nsIURIFixup> fixup(do_GetService(NS_URIFIXUP_CONTRACTID));
nsCOMPtr<nsIURIFixup> fixup(components::URIFixup::Service());
if (fixup) {
nsCOMPtr<nsIURI> fixedURI;
rv = fixup->CreateExposableURI(uri, getter_AddRefs(fixedURI));

Просмотреть файл

@ -74,6 +74,7 @@
#include "nsWidgetsCID.h"
#include "nsContentCID.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/Components.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/Event.h"
@ -2240,9 +2241,8 @@ nsresult nsObjectLoadingContent::LoadObject(bool aNotify, bool aForceLoad,
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(docShell));
NS_ASSERTION(req, "Docshell must be an ifreq");
nsCOMPtr<nsIURILoader> uriLoader(
do_GetService(NS_URI_LOADER_CONTRACTID, &rv));
if (NS_FAILED(rv)) {
nsCOMPtr<nsIURILoader> uriLoader(components::URILoader::Service());
if (NS_WARN_IF(!uriLoader)) {
MOZ_ASSERT_UNREACHABLE("Failed to get uriLoader service");
mFrameLoader->Destroy();
mFrameLoader = nullptr;

Просмотреть файл

@ -20,7 +20,6 @@
#include "nsIDNSListener.h"
#include "nsIWebProgressListener.h"
#include "nsIWebProgress.h"
#include "nsCURILoader.h"
#include "nsIDNSRecord.h"
#include "nsIDNSService.h"
#include "nsICancelable.h"
@ -31,6 +30,7 @@
#include "nsIObserverService.h"
#include "mozilla/dom/Link.h"
#include "mozilla/Components.h"
#include "mozilla/Preferences.h"
using namespace mozilla;
@ -410,8 +410,7 @@ void nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue() {
void nsHTMLDNSPrefetch::nsDeferrals::Activate() {
// Register as an observer for the document loader
nsCOMPtr<nsIWebProgress> progress =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
if (progress)
progress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_DOCUMENT);

Просмотреть файл

@ -114,7 +114,6 @@
#include "mozilla/HangDetails.h"
#include "nsAnonymousTemporaryFile.h"
#include "nsAppRunner.h"
#include "nsCDefaultURIFixup.h"
#include "nsCExternalHandlerService.h"
#include "nsCOMPtr.h"
#include "nsChromeRegistryChrome.h"
@ -4118,7 +4117,7 @@ mozilla::ipc::IPCResult ContentParent::RecvKeywordToURI(
*aPostData = nullptr;
*aURI = void_t();
nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
nsCOMPtr<nsIURIFixup> fixup = components::URIFixup::Service();
if (!fixup) {
return IPC_OK();
}

Просмотреть файл

@ -82,7 +82,6 @@
#include "nsIFrame.h"
#include "nsIURI.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
#include "nsIWebBrowser.h"
#include "nsIWebProgress.h"
#include "nsIXULRuntime.h"

Просмотреть файл

@ -7,9 +7,9 @@
#include "nsDOMOfflineResourceList.h"
#include "nsIScriptSecurityManager.h"
#include "nsError.h"
#include "mozilla/Components.h"
#include "mozilla/dom/DOMStringList.h"
#include "nsIPrefetchService.h"
#include "nsCPrefetchService.h"
#include "nsMemory.h"
#include "nsNetUtil.h"
#include "nsNetCID.h"
@ -120,8 +120,8 @@ nsresult nsDOMOfflineResourceList::Init() {
// Check for in-progress cache updates
nsCOMPtr<nsIOfflineCacheUpdateService> cacheUpdateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
components::OfflineCacheUpdate::Service();
NS_ENSURE_TRUE(cacheUpdateService, NS_ERROR_UNEXPECTED);
uint32_t numUpdates;
rv = cacheUpdateService->GetNumUpdates(&numUpdates);
@ -497,9 +497,9 @@ void nsDOMOfflineResourceList::Update(ErrorResult& aRv) {
}
nsCOMPtr<nsIOfflineCacheUpdateService> updateService =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID, &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
aRv.Throw(rv);
components::OfflineCacheUpdate::Service();
if (NS_WARN_IF(!updateService)) {
aRv.Throw(NS_ERROR_UNEXPECTED);
return;
}

Просмотреть файл

@ -16,7 +16,6 @@
#include "nsContentUtils.h"
#include "nsCORSListenerProxy.h"
#include "nsIStreamListener.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "nsIImageLoadingContent.h"
#include "nsIRedirectHistoryEntry.h"
@ -25,6 +24,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/nsMixedContentBlocker.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/Components.h"
#include "mozilla/Logging.h"
NS_IMPL_ISUPPORTS(nsContentSecurityManager, nsIContentSecurityManager,
@ -380,8 +380,8 @@ static nsresult DoContentSecurityChecks(nsIChannel* aChannel,
// TYPE_DOCUMENT and TYPE_SUBDOCUMENT loads might potentially
// be wyciwyg:// channels. Let's fix up the URI so we can
// perform proper security checks.
nsCOMPtr<nsIURIFixup> urifixup(do_GetService(NS_URIFIXUP_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv) && urifixup) {
nsCOMPtr<nsIURIFixup> urifixup(components::URIFixup::Service());
if (urifixup) {
nsCOMPtr<nsIURI> fixedURI;
rv = urifixup->CreateExposableURI(uri, getter_AddRefs(fixedURI));
if (NS_SUCCEEDED(rv)) {
@ -922,8 +922,8 @@ nsresult nsContentSecurityManager::CheckChannel(nsIChannel* aChannel) {
// TYPE_DOCUMENT and TYPE_SUBDOCUMENT loads might potentially
// be wyciwyg:// channels. Let's fix up the URI so we can
// perform proper security checks.
nsCOMPtr<nsIURIFixup> urifixup(do_GetService(NS_URIFIXUP_CONTRACTID, &rv));
if (NS_SUCCEEDED(rv) && urifixup) {
nsCOMPtr<nsIURIFixup> urifixup(components::URIFixup::Service());
if (urifixup) {
nsCOMPtr<nsIURI> fixedURI;
rv = urifixup->CreateExposableURI(uri, getter_AddRefs(fixedURI));
if (NS_SUCCEEDED(rv)) {

Просмотреть файл

@ -10,14 +10,6 @@
#include "nsIOSPermissionRequest.h"
#include "nsWeakReference.h"
#define NS_OSPERMISSIONREQUEST_CID \
{ \
0x95790842, 0x75a0, 0x430d, { \
0x98, 0xbf, 0xf5, 0xce, 0x37, 0x88, 0xea, 0x6d \
} \
}
#define NS_OSPERMISSIONREQUEST_CONTRACTID "@mozilla.org/ospermissionrequest;1"
namespace mozilla {
namespace dom {
class Promise;

Просмотреть файл

@ -110,8 +110,8 @@ static const char kPrintingPromptService[] =
#include "nsFocusManager.h"
#include "nsRange.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "mozilla/Components.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLFrameElement.h"
#include "nsContentList.h"
@ -298,7 +298,7 @@ static void GetDocumentTitleAndURL(Document* aDoc, nsAString& aTitle,
nsIURI* url = aDoc->GetDocumentURI();
if (!url) return;
nsCOMPtr<nsIURIFixup> urifixup(do_GetService(NS_URIFIXUP_CONTRACTID));
nsCOMPtr<nsIURIFixup> urifixup(components::URIFixup::Service());
if (!urifixup) return;
nsCOMPtr<nsIURI> exposableURI;

Просмотреть файл

@ -13,19 +13,6 @@ nsIURILoader
*/
%{ C++
// {9F6D5D40-90E7-11d3-AF93-00A024FFC08C} -
#define NS_URI_LOADER_CID \
{ 0x9f6d5d40, 0x90e7, 0x11d3, { 0xaf, 0x80, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c } }
#define NS_URI_LOADER_CONTRACTID \
"@mozilla.org/uriloader;1"
/* 057b04d0-0ccf-11d2-beba-00805f8a66dc */
#define NS_DOCUMENTLOADER_SERVICE_CID \
{ 0x057b04d0, 0x0ccf, 0x11d2,{0xbe, 0xba, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc}}
#define NS_DOCUMENTLOADER_SERVICE_CONTRACTID \
"@mozilla.org/docloaderservice;1"
#define NS_CONTENT_HANDLER_CONTRACTID "@mozilla.org/uriloader/content-handler;1"
#define NS_CONTENT_HANDLER_CONTRACTID_PREFIX NS_CONTENT_HANDLER_CONTRACTID "?type="

Просмотреть файл

@ -5,11 +5,11 @@
#include "nspr.h"
#include "mozilla/dom/Document.h"
#include "mozilla/Components.h"
#include "mozilla/Logging.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "nsDocLoader.h"
#include "nsCURILoader.h"
#include "nsNetUtil.h"
#include "nsIHttpChannel.h"
#include "nsIWebNavigation.h"
@ -39,6 +39,7 @@
#include "nsILoadURIDelegate.h"
#include "nsIBrowserDOMWindow.h"
using namespace mozilla;
using mozilla::DebugOnly;
using mozilla::LogLevel;
using mozilla::dom::Document;
@ -198,10 +199,9 @@ already_AddRefed<nsDocLoader> nsDocLoader::GetAsDocLoader(
/* static */
nsresult nsDocLoader::AddDocLoaderAsChildOfRoot(nsDocLoader* aDocLoader) {
nsresult rv;
nsCOMPtr<nsIDocumentLoader> docLoaderService =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
components::DocLoader::Service();
NS_ENSURE_TRUE(docLoaderService, NS_ERROR_UNEXPECTED);
RefPtr<nsDocLoader> rootDocLoader = GetAsDocLoader(docLoaderService);
NS_ENSURE_TRUE(rootDocLoader, NS_ERROR_UNEXPECTED);

Просмотреть файл

@ -39,7 +39,7 @@
#include "nsError.h"
#include "nsICategoryManager.h"
#include "nsCExternalHandlerService.h" // contains contractids for the helper app service
#include "nsCExternalHandlerService.h"
#include "nsIMIMEHeaderParam.h"
#include "nsNetCID.h"

Просмотреть файл

@ -1,19 +1,15 @@
#ifndef ContentHandlerService_h
#define ContentHandlerService_h
#include "mozilla/dom/PHandlerService.h"
#include "nsIHandlerService.h"
#include "nsClassHashtable.h"
#include "HandlerServiceChild.h"
#include "nsIMIMEInfo.h"
#define NS_CONTENTHANDLERSERVICE_CID \
{ \
0xc4b6fb7c, 0xbfb1, 0x49dc, { \
0xa6, 0x5f, 0x03, 0x57, 0x96, 0x52, 0x4b, 0x53 \
} \
}
namespace mozilla {
class HandlerServiceChild;
namespace dom {
class PHandlerServiceChild;

Просмотреть файл

@ -8,14 +8,6 @@
#include "nsIExternalURLHandlerService.h"
// {4BF1F8EF-D947-4BA3-9CD3-8C9A54A63A1C}
#define NS_EXTERNALURLHANDLERSERVICE_CID \
{ \
0x4bf1f8ef, 0xd947, 0x4ba3, { \
0x9c, 0xd3, 0x8c, 0x9a, 0x54, 0xa6, 0x3a, 0x1c \
} \
}
class nsExternalURLHandlerService final : public nsIExternalURLHandlerService {
public:
NS_DECL_ISUPPORTS

Просмотреть файл

@ -14,9 +14,10 @@
#include "nsExternalHelperAppService.h"
#include "nsCExternalHandlerService.h"
#include "nsMIMEInfoImpl.h"
#include "nsCOMPtr.h"
class nsIMimeInfo;
class nsOSHelperAppService : public nsExternalHelperAppService {
public:
virtual ~nsOSHelperAppService();

Просмотреть файл

@ -43,6 +43,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
'nsExternalURLHandlerService.h',
]]
EXPORTS += [
'nsLocalHandlerApp.h',
]
EXPORTS.mozilla.dom += [
'ExternalHelperAppChild.h',
'ExternalHelperAppParent.h',

Просмотреть файл

@ -14,10 +14,6 @@ nsIExternalHelperAppService
%{ C++
/* A7F800E0-4306-11d4-98D0-001083010E9B */
#define NS_EXTERNALHELPERAPPSERVICE_CID \
{ 0xa7f800e0, 0x4306, 0x11d4, { 0x98, 0xd0, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
#define NS_EXTERNALHELPERAPPSERVICE_CONTRACTID \
"@mozilla.org/uriloader/external-helper-app-service;1"
@ -30,29 +26,8 @@ nsIExternalHelperAppService
#define NS_MIMESERVICE_CONTRACTID \
"@mozilla.org/mime;1"
#define NS_EXTERNALPROTOCOLHANDLER_CID \
{ 0xbd6390c8, 0xfbea, 0x11d4, {0x98, 0xf6, 0x0, 0x10, 0x83, 0x1, 0xe, 0x9b } }
/* 9fa83ce7-d0ab-4ed3-938e-afafee435670 */
#define NS_BLOCKEDEXTERNALPROTOCOLHANDLER_CID \
{ 0x9fa83ce7, 0xd0ab, 0x4ed3, {0x93, 0x8e, 0xaf, 0xaf, 0xee, 0x43, 0x56, 0x70 } }
/* bc0017e3-2438-47be-a567-41db58f17627 */
#define NS_LOCALHANDLERAPP_CID \
{ 0xbc0017e3, 0x2438, 0x47be, {0xa5, 0x67, 0x41, 0xdb, 0x58, 0xf1, 0x76, 0x27 } }
/*6c3c274b-4cbf-4bb5-a635-05ad2cbb6535*/
#define NS_DBUSHANDLERAPP_CID \
{ 0x6c3c274b, 0x4cbf, 0x4bb5, {0xa6, 0x35, 0x05, 0xad, 0x2c, 0xbb, 0x65, 0x35 } }
#define NS_DBUSHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/dbus-handler-app;1"
#define NS_LOCALHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/local-handler-app;1"
#define NS_WEBHANDLERAPP_CONTRACTID \
"@mozilla.org/uriloader/web-handler-app;1"
%}

Просмотреть файл

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <dbus/dbus.h>
#include "mozilla/Components.h"
#include "mozilla/DBusHelpers.h"
#include "nsDBusHandlerApp.h"
#include "nsIURI.h"
@ -12,9 +13,12 @@
#include "nsCOMPtr.h"
#include "nsCExternalHandlerService.h"
using namespace mozilla;
// XXX why does nsMIMEInfoImpl have a threadsafe nsISupports? do we need one
// here too?
NS_IMPL_CLASSINFO(nsDBusHandlerApp, nullptr, 0, NS_DBUSHANDLERAPP_CID)
NS_IMPL_CLASSINFO(nsDBusHandlerApp, nullptr, 0,
components::DBusHandlerApp::CID())
NS_IMPL_ISUPPORTS_CI(nsDBusHandlerApp, nsIDBusHandlerApp, nsIHandlerApp)
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -14,10 +14,10 @@
#include "nsExternalHelperAppService.h"
#include "nsCExternalHandlerService.h"
#include "nsMIMEInfoImpl.h"
#include "nsCOMPtr.h"
class nsILineInputStream;
class nsMIMEInfoBase;
class nsOSHelperAppService : public nsExternalHelperAppService {
public:

Просмотреть файл

@ -13,7 +13,6 @@
#include "nsExternalHelperAppService.h"
#include "nsCExternalHandlerService.h"
#include "nsMIMEInfoImpl.h"
#include "nsCOMPtr.h"
#include <windows.h>
@ -24,6 +23,7 @@
#include <shlobj.h>
class nsMIMEInfoWin;
class nsIMIMEInfo;
class nsOSHelperAppService : public nsExternalHelperAppService {
public:

Просмотреть файл

@ -14,10 +14,6 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'prefetch'
EXPORTS += [
'nsCPrefetchService.h',
]
EXPORTS.mozilla.docshell += [
'OfflineCacheUpdateChild.h',
'OfflineCacheUpdateParent.h',

Просмотреть файл

@ -1,34 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCPrefetchService_h__
#define nsCPrefetchService_h__
#include "nsIPrefetchService.h"
/**
* nsPrefetchService : nsIPrefetchService
*/
#define NS_PREFETCHSERVICE_CONTRACTID "@mozilla.org/prefetch-service;1"
#define NS_PREFETCHSERVICE_CID \
{ /* 6b8bdffc-3394-417d-be83-a81b7c0f63bf */ \
0x6b8bdffc, 0x3394, 0x417d, { \
0xbe, 0x83, 0xa8, 0x1b, 0x7c, 0x0f, 0x63, 0xbf \
} \
}
/**
* nsOfflineCacheUpdateService : nsIOfflineCacheUpdateService
*/
#define NS_OFFLINECACHEUPDATESERVICE_CONTRACTID \
"@mozilla.org/offlinecacheupdate-service;1"
#define NS_OFFLINECACHEUPDATESERVICE_CID \
{ /* ec06f3fc-70db-4ecd-94e0-a6e91ca44d8a */ \
0xec06f3fc, 0x70db, 0x4ecd, { \
0x94, 0xe0, 0xa6, 0xe9, 0x1c, 0xa4, 0x4d, 0x8a \
} \
}
#endif // !nsCPrefetchService_h__

Просмотреть файл

@ -5,7 +5,6 @@
#include "nsOfflineCacheUpdate.h"
#include "nsCPrefetchService.h"
#include "nsCURILoader.h"
#include "nsIApplicationCacheContainer.h"
#include "nsIApplicationCacheChannel.h"

Просмотреть файл

@ -9,7 +9,6 @@
#include "OfflineCacheUpdateGlue.h"
#include "nsOfflineCacheUpdate.h"
#include "nsCPrefetchService.h"
#include "nsCURILoader.h"
#include "nsIApplicationCacheContainer.h"
#include "nsIApplicationCacheChannel.h"
@ -28,12 +27,14 @@
#include "nsIPermissionManager.h"
#include "nsIPrincipal.h"
#include "nsNetCID.h"
#include "nsNetUtil.h"
#include "nsServiceManagerUtils.h"
#include "nsStreamUtils.h"
#include "nsThreadUtils.h"
#include "nsProxyRelease.h"
#include "mozilla/Logging.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Components.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"
#include "mozilla/Unused.h"
@ -285,7 +286,8 @@ nsOfflineCacheUpdateService *nsOfflineCacheUpdateService::EnsureService() {
if (!gOfflineCacheUpdateService) {
// Make the service manager hold a long-lived reference to the service
nsCOMPtr<nsIOfflineCacheUpdateService> service =
do_GetService(NS_OFFLINECACHEUPDATESERVICE_CONTRACTID);
components::OfflineCacheUpdate::Service();
Unused << service;
}
return gOfflineCacheUpdateService;

Просмотреть файл

@ -8,6 +8,7 @@
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Attributes.h"
#include "mozilla/CORSMode.h"
#include "mozilla/Components.h"
#include "mozilla/dom/ClientInfo.h"
#include "mozilla/dom/HTMLLinkElement.h"
#include "mozilla/dom/ServiceWorkerDescriptor.h"
@ -18,7 +19,6 @@
#include "nsICategoryManager.h"
#include "nsIObserverService.h"
#include "nsIWebProgress.h"
#include "nsCURILoader.h"
#include "nsICacheInfoChannel.h"
#include "nsIHttpChannel.h"
#include "nsIURL.h"
@ -481,16 +481,14 @@ void nsPrefetchService::DispatchEvent(nsPrefetchNode *node, bool aSuccess) {
void nsPrefetchService::AddProgressListener() {
// Register as an observer for the document loader
nsCOMPtr<nsIWebProgress> progress =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
if (progress)
progress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_DOCUMENT);
}
void nsPrefetchService::RemoveProgressListener() {
// Register as an observer for the document loader
nsCOMPtr<nsIWebProgress> progress =
do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID);
nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
if (progress) progress->RemoveProgressListener(this);
}

Просмотреть файл

@ -5,10 +5,10 @@
#ifndef nsPrefetchService_h__
#define nsPrefetchService_h__
#include "nsCPrefetchService.h"
#include "nsIObserver.h"
#include "nsIInterfaceRequestor.h"
#include "nsIChannelEventSink.h"
#include "nsIPrefetchService.h"
#include "nsIRedirectResultListener.h"
#include "nsIWebProgressListener.h"
#include "nsIStreamListener.h"

Просмотреть файл

@ -24,7 +24,6 @@
#include "nsISpeculativeConnect.h"
#include "nsIURIFixup.h"
#include "nsCategoryManagerUtils.h"
#include "nsCDefaultURIFixup.h"
#include "nsGeoPosition.h"
#include "mozilla/ArrayUtils.h"
@ -740,7 +739,7 @@ already_AddRefed<nsIURI> nsAppShell::ResolveURI(const nsCString& aUriStr) {
return uri.forget();
}
nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
nsCOMPtr<nsIURIFixup> fixup = components::URIFixup::Service();
if (fixup && NS_SUCCEEDED(fixup->CreateFixupURI(aUriStr, 0, nullptr,
getter_AddRefs(uri)))) {
return uri.forget();

Просмотреть файл

@ -24,7 +24,6 @@
#include "nsIXULBrowserWindow.h"
#include "nsIPrincipal.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
#include "nsIWebNavigation.h"
#include "nsDocShellCID.h"
#include "nsIExternalURLHandlerService.h"
@ -32,6 +31,7 @@
#include "nsIWidget.h"
#include "nsWindowWatcher.h"
#include "mozilla/BrowserElementParent.h"
#include "mozilla/Components.h"
#include "mozilla/NullPrincipal.h"
#include "nsDocShell.h"
#include "nsDocShellLoadState.h"
@ -660,7 +660,7 @@ NS_IMETHODIMP nsContentTreeOwner::SetTitle(const nsAString& aTitle) {
//
// remove any user:pass information
//
nsCOMPtr<nsIURIFixup> fixup(do_GetService(NS_URIFIXUP_CONTRACTID));
nsCOMPtr<nsIURIFixup> fixup(components::URIFixup::Service());
if (fixup) {
nsCOMPtr<nsIURI> tmpuri;
nsresult rv =