Merge inbound to mozilla-central. a=merge

This commit is contained in:
shindli 2019-01-30 06:07:01 +02:00
Родитель f65c00428b ba8719ae4a
Коммит f7752f11b1
157 изменённых файлов: 4975 добавлений и 2859 удалений

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

@ -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(

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

@ -13,7 +13,7 @@ add_task(async function findBarDisabledOnSomePages() {
ok(!gFindBar.hidden, "Find bar should be visible");
let urls = [
"about:config",
"about:preferences",
"about:addons",
];

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

@ -42,8 +42,10 @@ var gExceptionPaths = [
// Exclude all search-plugins because they aren't referenced by filename
"resource://search-plugins/",
// This is only in Nightly, and accessed using a direct chrome URL
"chrome://browser/content/aboutconfig/",
// Previous version of "about:config" kept for risk mitigation as a hidden
// page accessed using a direct chrome URL, will be removed in the future.
"chrome://global/content/config.js",
"chrome://global/content/config.xul",
];
// These are not part of the omni.ja file, so we find them only when running

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

@ -53,6 +53,7 @@ static const RedirEntry kRedirMap[] = {
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_CHILD | nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"config", "chrome://browser/content/aboutconfig/aboutconfig.html", 0},
{"tabcrashed", "chrome://browser/content/aboutTabCrashed.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},

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

@ -8,6 +8,3 @@ browser.jar:
content/browser/aboutconfig/aboutconfig.html (content/aboutconfig.html)
content/browser/aboutconfig/aboutconfig.js (content/aboutconfig.js)
content/browser/aboutconfig/background.svg (content/background.svg)
[localization] @AB_CD@.jar:
browser/aboutConfig.ftl (content/aboutconfig.notftl)

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

@ -93,6 +93,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "blocked", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "tabcrashed", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },

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

@ -143,6 +143,7 @@ skip-if = true
[browser_354894_perwindowpb.js]
[browser_367052.js]
[browser_393716.js]
skip-if = debug # Bug 1507747
[browser_394759_basic.js]
# Disabled for intermittent failures, bug 944372.
skip-if = true

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

@ -5,6 +5,15 @@
const URL = "about:config";
add_task(async function setup() {
// Make sure that the field of which we restore the state is visible on load.
await SpecialPowers.pushPrefEnv({
set: [
["browser.aboutConfig.showWarning", false],
],
});
});
/**
* Bug 393716 - Basic tests for getTabState(), setTabState(), and duplicateTab().
*/
@ -52,7 +61,7 @@ add_task(async function test_set_tabstate_and_duplicate() {
"the tab's state was correctly restored");
// add text data
await setInputValue(tab.linkedBrowser, {id: "textbox", value: value3});
await setInputValue(tab.linkedBrowser, {id: "search", value: value3});
// duplicate the tab
let tab2 = ss.duplicateTab(window, tab);
@ -62,7 +71,7 @@ add_task(async function test_set_tabstate_and_duplicate() {
ok(ss.getCustomTabValue(tab2, key2) == value2 &&
tab2.linkedBrowser.currentURI.spec == URL,
"correctly duplicated the tab's state");
let textbox = await getInputValue(tab2.linkedBrowser, {id: "textbox"});
let textbox = await getInputValue(tab2.linkedBrowser, {id: "search"});
is(textbox, value3, "also duplicated text data");
// clean up

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

@ -0,0 +1,266 @@
.. _defining_xpcom_components:
=========================================
Defining XPCOM C++-implemented Components
=========================================
Native XPCOM components are registered at build time, and compiled into static
data structures which allow them to be accessed with little runtime overhead.
Each module which wishes to register components must provide a manifest
describing each component it implements, its type, and how it should be
constructed.
Manifest files are Python data files registered in ``moz.build`` files in a
``XPCOM_MANIFESTS`` file list:
.. code-block:: python
XPCOM_MANIFESTS += [
'components.conf',
]
The files may define any of the following special variables:
.. code-block:: python
# Optional: A function to be called once, the first time any component
# listed in this manifest is instantiated.
InitFunc = 'nsInitFooModule'
# Optional: A function to be called at shutdown if any component listed in
# this manifest has been instantiated.
UnloadFunc = 'nsUnloadFooModule'
# Optional: A processing priority, to determine how early or late the
# manifest is processed. Defaults to 50. In practice, this mainly affects
# the order in which unload functions are called at shutdown, with higher
# priority numbers being called later.
Priority = 10
# Optional: A list of header files to include before calling init or
# unload functions, or any legacy constructor functions.
#
# Any header path beginning with a `/` is loaded relative to the root of
# the source tree, and must not rely on any local includes.
#
# Any relative header path must be exported.
Headers = [
'/foo/nsFooModule.h',
'nsFoo.h',
]
# A list of component classes provided by this module.
Classes = [
{
# ...
},
# ...
]
Class definitions may have the following properties:
``name`` (optional)
If present, this component will generate an entry with the given name in the
``mozilla::components`` namespace in ``mozilla/Components.h``, which gives
easy access to its CID, service, and instance constructors as (e.g.,)
``components::Foo::CID()``, ``components::Foo::Service()``, and
``components::Foo::Create()``, respectively.
``cid``
A UUID string containing this component's CID, in the form
``'{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}'``.
``contract_ids`` (optional)
A list of contract IDs to register for this class.
``categories`` (optional)
A dict of category entries to register for this component's contract ID.
Each key in the dict is the name of the category. Each value is either a
string containing a single entry name, or a list of entry name strings.
``type`` (optional, default=``nsISupports``)
The fully-qualified type of the class implementing this component. Defaults
to ``nsISupports``, but **must** be provided if the ``init_method`` property
is specified, or if neither the ``constructor`` nor ``legacy_constructor``
properties are provided.
``headers`` (optional)
A list of headers to include in order to call this component's constructor,
in the same format as the global ``Headers`` property.
``init_method`` (optional)
The name of a method to call on newly-created instances of this class before
returning them. The method must take no arguments, and must return a
``nsresult``. If it returns failure, that failure is propagated to the
``getService`` or ``createInstance`` caller.
``constructor`` (optional)
The fully-qualified name of a constructor function to call in order to
create instances of this class. This function must be declared in one of the
headers listed in the ``headers`` property, must take no arguments, and must
return ``already_AddRefed<iface>`` where ``iface`` is the interface provided
in the ``type`` property.
This property is incompatible with ``legacy_constructor``.
``legacy_constructor`` (optional)
This property is deprecated, and should not be used in new code.
The fully-qualified name of a constructor function to call in order to
create instances of this class. This function must be declared in one of the
headers listed in the ``headers`` property, and must have the signature
``nsresult(nsISupports* aOuter, const nsID& aIID, void** aResult)``, and
behave equivalently to ``nsIFactory::CreateInstance``.
This property is incompatible with ``constructor``.
``singleton`` (optional, default=``False``)
If true, this component's constructor is expected to return the same
singleton for every call, and no ``mozilla::components::<name>::Create()``
method will be generated for it.
``overridable`` (optional, default=``False``)
If true, this component's contract ID is expected to be overridden by some
tests, and its ``mozilla::components::<name>::Service()`` getter will
therefore look it up by contract ID for every call. This component must,
therefore, provide at least one contract ID in its ``contract_ids`` array.
If false, the ``Service()`` getter will always retrieve the service based on
its static data, and it cannot be overridden.
Note: Enabling this option is expensive, and should not be done when it can
be avoided, or when the getter is used by any hot code.
``external`` (optional, default=``False`` if any ``headers`` are provided, ``True`` otherwise)
If true, a constructor for this component's ``type`` must be defined in
another translation unit, using ``NS_IMPL_COMPONENT_FACTORY(type)``. The
constructor must return an ``already_AddRefed<nsISupports>``, and will be
used to construct instances of this type.
This option should only be used in cases where the headers which define the
component's concrete type cannot be easily included without local includes.
Note: External constructors may not specify an ``init_method``, since the
generated code will not have the necessary type information required to call
it. This option is also incompatible with ``constructor`` and
``legacy_constructor``.
``processes`` (optional, default=``ProcessSelector.ANY_PROCESS``)
An optional specifier restricting which types of process this component may
be loaded in. This must be a property of ``ProcessSelector`` with the same
name as one of the values in the ``Module::ProcessSelector`` enum.
Conditional Compilation
=======================
This manifest may run any appropriate Python code to customize the values of
the ``Classes`` array based on build configuration. To simplify this process,
the following globals are available:
``defined``
A function which returns true if the given build config setting is defined
and true.
``buildconfig``
The ``buildconfig`` python module, with a ``substs`` property containing a
dict of all available build substitutions.
Component Constructors
======================
There are several ways to define component constructors, which vary mostly
depending on how old the code that uses them is:
Class Constructors
------------------
This simplest way to define a component is to include a header defining a
concrete type, and let the component manager call that class's constructor:
.. code-block:: python
'type': 'mozilla::foo::Foo',
'headers': ['mozilla/Foo.h'],
This is generally the preferred method of defining non-singleton constructors,
but may not be practicable for classes which rely on local includes for their
definitions.
Singleton Constructors
----------------------
Singleton classes are generally expected to provide their own constructor
function which caches a singleton instance the first time it is called, and
returns the same instance on subsequent calls. This requires declaring the
constructor in an included header, and implementing it in a separate source
file:
.. code-block:: python
'type': 'mozilla::foo::Foo',
'headers': ['mozilla/Foo.h'],
'constructor': 'mozilla::Foo::GetSingleton',
``Foo.h``
.. code-block:: c++
class Foo final : public nsISupports {
public:
static already_AddRefed<Foo> GetSingleton();
};
``Foo.cpp``
.. code-block:: c++
already_AddRefed<Foo> Foo::GetSingleton() {
// ...
}
External Constructors
---------------------
For types whose headers can't easily be included, constructors can be defined
using a template specialization on an incomplete type:
.. code-block:: python
'type': 'mozilla::foo::Foo',
'external: True,'
``Foo.cpp``
.. code-block:: c++
NS_IMPL_COMPONENT_FACTORY(Foo) {
return do_AddRef(new Foo()).downcast<nsISupports>();
}
Legacy Constructors
-------------------
These should not be used in new code, and are left as an exercise for the
reader.
Registering Categories
======================
Classes which need define category entries with the same value as their
contract ID may do so using the following:
.. code-block:: python
'contract_ids': ['@mozilla.org/foo;1'],
'categories': {
'content-policy': 'm-foo',
'Gecko-Content-Viewers': ['image/jpeg', 'image/png'],
},
This will define each of the following category entries:
* ``"content-policy"`` ``"m-foo",`` ``"@mozilla.org/foo;1"``
* ``"Gecko-Content-Viewers"`` ``"image/jpeg"`` ``"@mozilla.org/foo;1"``
* ``"Gecko-Content-Viewers"`` ``"image/png"`` ``"@mozilla.org/foo;1"``

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

@ -25,6 +25,7 @@ Important Concepts
preprocessor
jar-manifests
defining-binaries
defining-xpcom-components
toolchains
locales
rust

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

@ -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"
@ -1150,7 +1150,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;
}

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

@ -66,33 +66,44 @@ class Selector extends PureComponent {
// matches.
for (let i = 0; i < selectors.length; i++) {
const selector = selectors[i];
// Parse the selector for pseudo classes and attributes, and apply different
// CSS classes for the parsed values.
// NOTE: parsePseudoClassesAndAttributes is a good candidate for memoization.
const parsedSelector = parsePseudoClassesAndAttributes(selector);
for (const parsedText of parsedSelector) {
let selectorSpanClass = matchedSelectors.indexOf(selector) > -1 ?
"ruleview-selector-matched" : "ruleview-selector-unmatched";
output.push(
dom.span(
{
className: matchedSelectors.indexOf(selector) > -1 ?
"ruleview-selector-matched" : "ruleview-selector-unmatched",
},
parsePseudoClassesAndAttributes(selector).map(({ type, value }) => {
let selectorSpanClass = "";
switch (parsedText.type) {
case SELECTOR_ATTRIBUTE:
selectorSpanClass += " ruleview-selector-attribute";
break;
case SELECTOR_ELEMENT:
selectorSpanClass += " ruleview-selector";
break;
case SELECTOR_PSEUDO_CLASS:
selectorSpanClass += PSEUDO_CLASSES.some(p => parsedText.value === p) ?
" ruleview-selector-pseudo-class-lock" :
" ruleview-selector-pseudo-class";
break;
}
switch (type) {
case SELECTOR_ATTRIBUTE:
selectorSpanClass += " ruleview-selector-attribute";
break;
case SELECTOR_ELEMENT:
selectorSpanClass += " ruleview-selector";
break;
case SELECTOR_PSEUDO_CLASS:
selectorSpanClass += PSEUDO_CLASSES.some(p => value === p) ?
" ruleview-selector-pseudo-class-lock" :
" ruleview-selector-pseudo-class";
break;
}
output.push(
dom.span({ className: selectorSpanClass }, parsedText.value)
);
}
return (
dom.span(
{
key: value,
className: selectorSpanClass,
},
value
)
);
})
)
);
// Append a comma separator unless this is the last selector.
if (i < selectors.length - 1) {

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

@ -1,6 +1,6 @@
[DEFAULT]
tags = devtools
subsuite = devtools
tags = devtools-webreplay
subsuite = devtools-webreplay
# Feel free to set this to true if an impending change breaks Web Replay and
# fixing it would be annoying or difficult. This will avoid running all tests
@ -9,8 +9,7 @@ subsuite = devtools
#
# Please file a bug against the 'Core > Web Replay' component if you do so,
# so that the problem can be fixed and tests reenabled.
skip-if = true # See bug 1523364
# skip-if = os != "mac" || debug || !nightly_build
skip-if = os != "mac" || debug || !nightly_build
support-files =
head.js

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

@ -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',

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

@ -72,7 +72,9 @@ static const RedirEntry kRedirMap[] = {
{"checkerboard", "chrome://global/content/aboutCheckerboard.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT},
#if !defined(NIGHTLY_BUILD) || !defined(MOZ_BUILD_APP_IS_BROWSER)
{"config", "chrome://global/content/config.xul", 0},
#endif
#ifdef MOZ_CRASHREPORTER
{"crashes", "chrome://global/content/crashes.xhtml", 0},
#endif

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

@ -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 buildconfig.substs['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,152 +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 },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "config", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#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);
}

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

@ -12,10 +12,10 @@
#include "nsIPrincipal.h"
#include "nsISupportsPrimitives.h"
#include "nsIAppStartup.h"
#include "nsToolkitCompsCID.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "xpcpublic.h"
#include "mozilla/Components.h"
namespace mozilla {
@ -65,8 +65,7 @@ WindowDestroyedEvent::Run() {
case Phase::Destroying: {
bool skipNukeCrossCompartment = false;
#ifndef DEBUG
nsCOMPtr<nsIAppStartup> appStartup =
do_GetService(NS_APPSTARTUP_CONTRACTID);
nsCOMPtr<nsIAppStartup> appStartup = components::AppStartup::Service();
if (appStartup) {
appStartup->GetShuttingDown(&skipNukeCrossCompartment);

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

@ -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,11 +149,6 @@
#include "nsContentUtils.h"
#include "nsCSSProps.h"
#include "nsIURIFixup.h"
#ifndef DEBUG
# include "nsIAppStartup.h"
# include "nsToolkitCompsCID.h"
#endif
#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,11 +154,6 @@
#include "nsCSSProps.h"
#include "nsIURIFixup.h"
#include "nsIURIMutator.h"
#ifndef DEBUG
# include "nsIAppStartup.h"
# include "nsToolkitCompsCID.h"
#endif
#include "nsCDefaultURIFixup.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "nsIObserverService.h"
@ -4561,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;

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

@ -25,7 +25,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=574663
function waitForPaint(win, utils, callback) {
win.document.documentElement.getBoundingClientRect();
if (!utils.isMozAfterPaintPending) {
callback();
win.requestAnimationFrame(function() {
setTimeout(callback);
});
return;
}

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

@ -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);

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

@ -33,6 +33,7 @@
#include "mozilla/AntiTrackingCommon.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/Components.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/DataStorage.h"
#include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
@ -113,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"
@ -180,7 +180,6 @@
#include "nsServiceManagerUtils.h"
#include "nsStyleSheetService.h"
#include "nsThreadUtils.h"
#include "nsToolkitCompsCID.h"
#include "nsWidgetsCID.h"
#include "PreallocatedProcessManager.h"
#include "ProcessPriorityManager.h"
@ -3803,8 +3802,7 @@ mozilla::ipc::IPCResult ContentParent::RecvShowAlert(
return IPC_OK();
}
nsCOMPtr<nsIAlertsService> sysAlerts(
do_GetService(NS_ALERTSERVICE_CONTRACTID));
nsCOMPtr<nsIAlertsService> sysAlerts(components::Alerts::Service());
if (sysAlerts) {
sysAlerts->ShowAlert(aAlert, this);
}
@ -3817,8 +3815,7 @@ mozilla::ipc::IPCResult ContentParent::RecvCloseAlert(
return IPC_OK();
}
nsCOMPtr<nsIAlertsService> sysAlerts(
do_GetService(NS_ALERTSERVICE_CONTRACTID));
nsCOMPtr<nsIAlertsService> sysAlerts(components::Alerts::Service());
if (sysAlerts) {
sysAlerts->CloseAlert(aName, aPrincipal);
}
@ -4120,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"

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

@ -6,6 +6,7 @@
#include "mozilla/dom/Notification.h"
#include "mozilla/Components.h"
#include "mozilla/Encoding.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/JSONWriter.h"
@ -55,7 +56,6 @@
#include "nsServiceManagerUtils.h"
#include "nsStructuredCloneContainer.h"
#include "nsThreadUtils.h"
#include "nsToolkitCompsCID.h"
#include "nsXULAppAPI.h"
namespace mozilla {
@ -653,8 +653,7 @@ void NotificationTelemetryService::RecordDNDSupported() {
return;
}
nsCOMPtr<nsIAlertsService> alertService =
do_GetService(NS_ALERTSERVICE_CONTRACTID);
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
if (!alertService) {
return;
}
@ -1411,8 +1410,7 @@ void Notification::ShowInternal() {
NS_WARNING("Could not persist Notification");
}
nsCOMPtr<nsIAlertsService> alertService =
do_GetService(NS_ALERTSERVICE_CONTRACTID);
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
ErrorResult result;
NotificationPermission permission = NotificationPermission::Denied;
@ -1952,8 +1950,7 @@ void Notification::CloseInternal() {
SetAlertName();
UnpersistNotification();
if (!mIsClosed) {
nsCOMPtr<nsIAlertsService> alertService =
do_GetService(NS_ALERTSERVICE_CONTRACTID);
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
if (alertService) {
nsAutoString alertName;
GetAlertName(alertName);

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

@ -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;
}

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

@ -109,6 +109,7 @@ NS_IMPL_ISUPPORTS(MulticastDNSDeviceProvider, nsIPresentationDeviceProvider,
nsIDNSServiceResolveListener,
nsIPresentationControlServerListener, nsIObserver)
MulticastDNSDeviceProvider::MulticastDNSDeviceProvider() {}
MulticastDNSDeviceProvider::~MulticastDNSDeviceProvider() { Uninit(); }
nsresult MulticastDNSDeviceProvider::Init() {

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

@ -45,7 +45,7 @@ class MulticastDNSDeviceProvider final
NS_DECL_NSIPRESENTATIONCONTROLSERVERLISTENER
NS_DECL_NSIOBSERVER
explicit MulticastDNSDeviceProvider() = default;
explicit MulticastDNSDeviceProvider();
nsresult Init();
nsresult Uninit();

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

@ -25,9 +25,6 @@ function registerMockedFactory(contractId, mockedClassId, mockedFactory) {
originalClassId = "";
originalFactory = null;
}
if (originalFactory) {
registrar.unregisterFactory(originalClassId, originalFactory);
}
registrar.registerFactory(mockedClassId, "", contractId, mockedFactory);
}
@ -42,7 +39,9 @@ function registerOriginalFactory(contractId, mockedClassId, mockedFactory, origi
if (originalFactory) {
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.unregisterFactory(mockedClassId, mockedFactory);
registrar.registerFactory(originalClassId, "", contractId, originalFactory);
// Passing null for the factory remaps the original CID to the
// contract ID.
registrar.registerFactory(originalClassId, "", contractId, null);
}
}

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

@ -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;

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

@ -6,6 +6,7 @@
#include "nsReadConfig.h"
#include "nsJSConfigTriggers.h"
#include "mozilla/Components.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIAppStartup.h"
#include "nsContentUtils.h"
@ -18,13 +19,14 @@
#include "nsIPromptService.h"
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "nsToolkitCompsCID.h"
#include "nsNetUtil.h"
#include "nsString.h"
#include "nsCRT.h"
#include "nspr.h"
#include "nsXULAppAPI.h"
using namespace mozilla;
extern bool sandboxEnabled;
extern mozilla::LazyLogModule MCD;
@ -101,7 +103,7 @@ NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic,
rv = DisplayError();
if (NS_FAILED(rv)) {
nsCOMPtr<nsIAppStartup> appStartup =
do_GetService(NS_APPSTARTUP_CONTRACTID);
components::AppStartup::Service();
if (appStartup) appStartup->Quit(nsIAppStartup::eAttemptQuit);
}
}

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

@ -0,0 +1,10 @@
root:
items:
- type: stacking-context
bounds: [0, 0, 480, 80]
raster-space: screen
items:
- text: "a Bcd Efgh Ijklm Nopqrs Tuvwxyz"
origin: 20.5 50
size: 20
font: "FreeSans.ttf"

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

@ -0,0 +1,10 @@
root:
items:
- type: stacking-context
bounds: [0, 0, 480, 80]
raster-space: local(1.0)
items:
- text: "a Bcd Efgh Ijklm Nopqrs Tuvwxyz"
origin: 20.5 50
size: 20
font: "FreeSans.ttf"

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

@ -68,3 +68,4 @@ fuzzy(1,113) platform(linux) == raster-space.yaml raster-space.png
== shadow-image.yaml shadow-solid-ref.yaml
options(disable-aa) == snap-clip.yaml snap-clip-ref.yaml
platform(linux) == perspective-clip.yaml perspective-clip.png
options(disable-subpixel) == raster-space-snap.yaml raster-space-snap-ref.yaml

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

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "xpcprivate.h"
#include "mozilla/ModuleUtils.h"
#include "mozJSSubScriptLoader.h"
/* Module implementation for the xpconnect library. */
@ -22,16 +21,5 @@
#define MOZJSSUBSCRIPTLOADER_CONTRACTID "@mozilla.org/moz/jssubscript-loader;1"
NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSSubScriptLoader)
NS_DEFINE_NAMED_CID(MOZ_JSSUBSCRIPTLOADER_CID);
#define XPCONNECT_CIDENTRIES \
{&kMOZ_JSSUBSCRIPTLOADER_CID, false, nullptr, \
mozJSSubScriptLoaderConstructor},
#define XPCONNECT_CONTRACTS \
{MOZJSSUBSCRIPTLOADER_CONTRACTID, &kMOZ_JSSUBSCRIPTLOADER_CID},
nsresult xpcModuleCtor();
void xpcModuleDtor();

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

@ -0,0 +1,14 @@
# -*- 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/.
Classes = [
{
'cid': '{929814d6-1dd2-11b2-8e08-82fa0a339b00}',
'contract_ids': ['@mozilla.org/moz/jssubscript-loader;1'],
'type': 'mozJSSubScriptLoader',
'headers': ['/js/xpconnect/loader/mozJSSubScriptLoader.h'],
},
]

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

@ -44,6 +44,10 @@ UNIFIED_SOURCES += [
'XPCWrapper.cpp',
]
XPCOM_MANIFESTS += [
'components.conf',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'

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

@ -45,6 +45,7 @@
#include "mozilla/PendingAnimationTracker.h"
#include "mozilla/PendingFullscreenEvent.h"
#include "mozilla/Preferences.h"
#include "mozilla/StaticPrefs.h"
#include "nsViewManager.h"
#include "GeckoProfiler.h"
#include "nsNPAPIPluginInstance.h"
@ -256,6 +257,19 @@ class RefreshDriverTimer {
return nextTick < TimeStamp::Now() ? Nothing() : Some(nextTick);
}
// Returns null if the RefreshDriverTimer is attached to several
// RefreshDrivers. That may happen for example when there are
// several windows open.
nsPresContext* GetPresContextForOnlyRefreshDriver() {
if (mRootRefreshDrivers.Length() == 1 && mContentRefreshDrivers.IsEmpty()) {
return mRootRefreshDrivers[0]->GetPresContext();
}
if (mContentRefreshDrivers.Length() == 1 && mRootRefreshDrivers.IsEmpty()) {
return mContentRefreshDrivers[0]->GetPresContext();
}
return nullptr;
}
protected:
virtual ~RefreshDriverTimer() {
MOZ_ASSERT(
@ -543,6 +557,37 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
return true;
}
if (StaticPrefs::layout_lower_priority_refresh_driver_during_load()) {
nsPresContext* pctx =
mVsyncRefreshDriverTimer->GetPresContextForOnlyRefreshDriver();
if (pctx && pctx->HadContentfulPaint() && pctx->Document() &&
pctx->Document()->GetReadyStateEnum() <
Document::READYSTATE_COMPLETE) {
nsPIDOMWindowInner* win = pctx->Document()->GetInnerWindow();
if (win) {
dom::Performance* perf = win->GetPerformance();
// Limit slower refresh rate to 5 seconds between the
// first contentful paint and page load.
if (perf && perf->Now() < 5000) {
if (mProcessedVsync) {
mProcessedVsync = false;
// Handle this case similarly to the code above, but just
// use idle queue.
TimeDuration rate = mVsyncRefreshDriverTimer->GetTimerRate();
uint32_t slowRate =
static_cast<uint32_t>(rate.ToMilliseconds() * 4);
nsCOMPtr<nsIRunnable> vsyncEvent = NewRunnableMethod<>(
"RefreshDriverVsyncObserver::NormalPriorityNotify[IDLE]",
this, &RefreshDriverVsyncObserver::NormalPriorityNotify);
NS_DispatchToCurrentThreadQueue(vsyncEvent.forget(), slowRate,
EventQueuePriority::Idle);
}
return true;
}
}
}
}
RefPtr<RefreshDriverVsyncObserver> kungFuDeathGrip(this);
TickRefreshDriver(aVsync.mId, aVsync.mTime);
}
@ -1728,7 +1773,23 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
// situation we don't want to thrash our timer. So instead we
// wait until we get a Notify() call when we have no observers
// before stopping the timer.
StopTimer();
// On top level content pages keep the timer running initially so that we
// paint the page soon enough.
if (!XRE_IsContentProcess() || !presShell || mTestControllingRefreshes ||
!mPresContext->Document()->IsTopLevelContentDocument() || mThrottled ||
gfxPlatform::IsInLayoutAsapMode()) {
StopTimer();
} else if (mPresContext->Document()->GetReadyStateEnum() <
Document::READYSTATE_COMPLETE &&
!mPresContext->HadContentfulPaint()) {
if (mInitialTimerRunningLimit.IsNull()) {
mInitialTimerRunningLimit =
TimeStamp::Now() + TimeDuration::FromSeconds(4.0f);
// Don't let the timer to run forever, so limit to 4s for now.
} else if (mInitialTimerRunningLimit < TimeStamp::Now()) {
StopTimer();
}
}
return;
}

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

@ -539,6 +539,7 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator,
mozilla::TimeStamp mTickVsyncTime;
mozilla::TimeStamp mNextThrottledFrameRequestTick;
mozilla::TimeStamp mNextRecomputeVisibilityTick;
mozilla::TimeStamp mInitialTimerRunningLimit;
// separate arrays for each flush type we support
ObserverArray mObservers[4];

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

@ -0,0 +1,458 @@
# -*- 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/.
Headers = [
'/layout/build/nsLayoutModule.h',
]
UnloadFunc = 'nsLayoutModuleDtor'
# This module's unload function needs to be called as late as possible.
Priority = 100
content_types = [
'application/ecmascript',
'application/javascript',
'application/json',
'application/mathml+xml',
'application/rdf+xml',
'application/vnd.mozilla.xul+xml',
'application/vnd.wap.xhtml+xml',
'application/x-javascript',
'application/x-view-source',
'application/xhtml+xml',
'application/xml',
'image/svg+xml',
'mozilla.application/cached-xul',
'text/cache-manifest',
'text/css',
'text/ecmascript',
'text/html',
'text/javascript',
'text/json',
'text/plain',
'text/rdf',
'text/vtt',
'text/xml',
]
if defined('MOZ_WEBM'):
content_types += [
"audio/webm",
"video/webm",
]
Classes = [
{
'cid': '{1691e1f4-ee41-11d4-9885-00c04fa0cf4b}',
'type': 'nsIFrameTraversal',
},
{
'cid': '{574ce83e-fe9f-4095-b85c-7909abbf7c37}',
'type': 'nsJSURI::Mutator',
'headers': ['nsJSProtocolHandler.h'],
},
{
'cid': '{58f089ee-512a-42d2-a935-d0c874128930}',
'type': 'nsJSURI::Mutator',
'headers': ['nsJSProtocolHandler.h'],
},
{
'cid': '{972d8d8f-f0da-11d4-9885-00c04fa0cf4b}',
'type': 'nsIContentViewer',
},
{
'cid': '{bbe50ef2-80eb-469d-b70d-02858275389f}',
'type': 'mozilla::dom::BlobURL::Mutator',
'headers': ['mozilla/dom/BlobURL.h'],
},
{
'cid': '{f5475c51-59a7-4757-b3d9-e211a9410872}',
'type': 'mozilla::dom::BlobURL::Mutator',
'headers': ['mozilla/dom/BlobURL.h'],
},
{
'cid': '{fe0ff7c3-8e97-448b-9a8a-86afdb9fbbb6}',
'contract_ids': ['@mozilla.org/childprocessmessagemanager;1'],
'legacy_constructor': 'CreateChildMessageManager',
},
{
'cid': '{fc886801-e768-11d4-9885-00c04fa0cf4b}',
'contract_ids': ['@mozilla.org/content/document-loader-factory;1'],
'type': 'nsIDocumentLoaderFactory',
'categories': {'Gecko-Content-Viewers': content_types},
},
{
'cid': '{0ddf4df8-4dbb-4133-8b79-9afb966514f5}',
'contract_ids': ['@mozilla.org/content/plugin/document-loader-factory;1'],
'type': 'nsIDocumentLoaderFactory',
},
{
'cid': '{3b55e72e-ab7e-431b-89c0-3b06a8b14016}',
'contract_ids': ['@mozilla.org/content/style-sheet-service;1'],
'type': 'nsStyleSheetService',
'headers': ['nsStyleSheetService.h'],
'init_method': 'Init',
},
{
'cid': '{cdcc1ab8-3cea-4e6c-a294-a651fa35227f}',
'contract_ids': ['@mozilla.org/contentsecuritymanager;1'],
'type': 'nsContentSecurityManager',
'headers': ['mozilla/dom/nsContentSecurityManager.h'],
},
{
'cid': '{09d9ed1a-e5d4-4004-bfe0-27ceb923d9ac}',
'contract_ids': ['@mozilla.org/cspcontext;1'],
'type': 'nsCSPContext',
'headers': ['mozilla/dom/nsCSPContext.h'],
},
{
'cid': '{8d2f40b2-4875-4c95-97d9-3f7dca2cb460}',
'contract_ids': ['@mozilla.org/cspservice;1'],
'type': 'CSPService',
'headers': ['mozilla/dom/nsCSPService.h'],
'categories': {'content-policy': 'CSPService', 'net-channel-event-sinks': 'CSPService'},
},
{
'cid': '{1147d32c-215b-4014-b180-07fe7aedf915}',
'contract_ids': ['@mozilla.org/data-document-content-policy;1'],
'type': 'nsDataDocumentContentPolicy',
'headers': ['/dom/base/nsDataDocumentContentPolicy.h'],
'categories': {'content-policy': '@mozilla.org/data-document-content-policy;1'},
},
{
'cid': '{ecba5203-77da-465a-865e-78b7af10d8f7}',
'contract_ids': ['@mozilla.org/devicesensors;1'],
'type': 'nsDeviceSensors',
'headers': ['nsDeviceSensors.h'],
},
{
'cid': '{38bd0634-0fd4-46f0-b85f-13ced889eeec}',
'contract_ids': ['@mozilla.org/docshell/structured-clone-container;1'],
'type': 'nsStructuredCloneContainer',
'headers': ['nsStructuredCloneContainer.h'],
},
{
'cid': '{3160e271-138d-4cc7-9d63-6429f16957c7}',
'contract_ids': ['@mozilla.org/dom/dom-request-service;1'],
'singleton': True,
'type': 'mozilla::dom::DOMRequestService',
'headers': ['mozilla/dom/DOMRequest.h'],
'constructor': 'mozilla::dom::DOMRequestService::FactoryCreate',
},
{
'cid': '{656db07c-aa80-49e4-bce8-e431baae697d}',
'contract_ids': ['@mozilla.org/dom/localStorage-manager;1'],
'legacy_constructor': 'LocalStorageManagerConstructor',
},
{
'cid': '{5a75c25a-5e7e-4d90-8f7c-07eb15cc0aa8}',
'contract_ids': ['@mozilla.org/dom/quota-manager-service;1'],
'singleton': True,
'type': 'mozilla::dom::quota::QuotaManagerService',
'headers': ['mozilla/dom/quota/QuotaManagerService.h'],
'constructor': 'mozilla::dom::quota::QuotaManagerService::FactoryCreate',
'categories': {'idle-daily': 'QuotaManagerService'},
},
{
'cid': '{ae2793c0-2ba3-4adb-9c5e-c23525812c64}',
'contract_ids': ['@mozilla.org/dom/sdb-connection;1'],
'legacy_constructor': 'mozilla::dom::SDBConnection::Create',
'headers': ['mozilla/dom/SDBConnection.h'],
},
{
'cid': '{62ec8731-55ad-4246-b2ea-f26c1fe19d2d}',
'contract_ids': ['@mozilla.org/dom/workers/workerdebuggermanager;1'],
'singleton': True,
'type': 'mozilla::dom::WorkerDebuggerManager',
'headers': ['mozilla/dom/WorkerDebuggerManager.h'],
'constructor': 'mozilla::dom::WorkerDebuggerManager::GetInstance',
},
{
'cid': '{baa34652-f1f1-4185-b224-244ee82a413a}',
'contract_ids': ['@mozilla.org/eventlistenerservice;1'],
'type': 'nsIEventListenerService',
},
{
'cid': '{e8ee88b0-5571-4086-a45b-39a716906bdb}',
'contract_ids': ['@mozilla.org/expandedprincipal;1'],
'type': 'ExpandedPrincipal',
'headers': ['/caps/ExpandedPrincipal.h'],
},
{
'cid': '{cf7fd51f-aba2-44c1-9ff0-11f7508efcd4}',
'contract_ids': ['@mozilla.org/focus-manager;1'],
'type': 'nsIFocusManager',
},
{
'cid': '{7b121f7e-ebe4-43ab-9410-dc9087a1dba6}',
'contract_ids': ['@mozilla.org/gecko-media-plugin-service;1'],
'singleton': True,
'type': 'mozilla::gmp::GeckoMediaPluginService',
'headers': ['GMPService.h'],
'constructor': 'mozilla::gmp::GeckoMediaPluginService::GetGeckoMediaPluginService',
},
{
'cid': '{01e1c3ff-094a-d048-44b4-62d29c7b4f39}',
'contract_ids': ['@mozilla.org/geolocation;1'],
'singleton': True,
'type': 'mozilla::dom::Geolocation',
'headers': ['/dom/geolocation/nsGeolocation.h'],
'constructor': 'mozilla::dom::Geolocation::NonWindowSingleton',
},
{
'cid': '{130b016f-fad7-4526-bc7f-827dabf79265}',
'contract_ids': ['@mozilla.org/globalmessagemanager;1'],
'legacy_constructor': 'CreateGlobalMessageManager',
},
{
'cid': '{bfcb82c2-5611-4318-90d6-baf4a7864252}',
'contract_ids': ['@mozilla.org/inspector/deep-tree-walker;1'],
'type': 'inDeepTreeWalker',
'headers': ['/layout/inspector/inDeepTreeWalker.h'],
},
{
'cid': '{0e3afd3d-eb60-4c2b-963b-56d7c439f124}',
'contract_ids': ['@mozilla.org/layout/content-policy;1'],
'legacy_constructor': 'CreateContentPolicy',
},
{
'cid': '{4aef38b7-6364-4e23-a5e7-12f837fbbd9c}',
'contract_ids': [
'@mozilla.org/layout/contentserializer;1?mimetype=application/vnd.mozilla.xul+xml',
'@mozilla.org/layout/contentserializer;1?mimetype=application/xml',
'@mozilla.org/layout/contentserializer;1?mimetype=image/svg+xml',
'@mozilla.org/layout/contentserializer;1?mimetype=text/xml',
],
'type': 'nsIContentSerializer',
'legacy_constructor': 'CreateXMLContentSerializer',
},
{
'cid': '{e7c2aaf5-c11a-4954-9dbf-e28edec1fd91}',
'contract_ids': ['@mozilla.org/layout/contentserializer;1?mimetype=application/xhtml+xml'],
'legacy_constructor': 'CreateXHTMLContentSerializer',
},
{
'cid': '{9d3f70da-86e9-11d4-95ec-00b0d03e37b7}',
'contract_ids': ['@mozilla.org/layout/contentserializer;1?mimetype=text/html'],
'type': 'nsIContentSerializer',
'legacy_constructor': 'CreateHTMLContentSerializer',
},
{
'cid': '{6030f7ef-32ed-46a7-9a63-6a5d3f90445f}',
'contract_ids': ['@mozilla.org/layout/contentserializer;1?mimetype=text/plain'],
'legacy_constructor': 'CreatePlainTextSerializer',
},
{
'cid': '{abc622ea-9655-4123-80d9-22621bdd5465}',
'contract_ids': ['@mozilla.org/mediaManagerService;1'],
'singleton': True,
'type': 'nsIMediaManagerService',
'headers': ['mozilla/MediaManager.h'],
'constructor': 'mozilla::MediaManager::GetInstance',
},
{
'cid': '{daf1461b-bf29-4f88-8d0e-4bcdf332c862}',
'contract_ids': ['@mozilla.org/mixedcontentblocker;1'],
'type': 'nsMixedContentBlocker',
'headers': ['mozilla/dom/nsMixedContentBlocker.h'],
'categories': {
'content-policy': '@mozilla.org/mixedcontentblocker;1',
'net-channel-event-sinks': '@mozilla.org/mixedcontentblocker;1',
},
},
{
'cid': '{4bbe1b96-8956-457f-a03f-9c27435f2afa}',
'contract_ids': ['@mozilla.org/net/osfileconstantsservice;1'],
'singleton': True,
'type': 'mozilla::OSFileConstantsService',
'headers': ['mozilla/OSFileConstants.h'],
'constructor': 'mozilla::OSFileConstantsService::GetOrCreate',
},
{
'cid': '{bfc310d2-38a0-11d3-8cd3-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=javascript'],
'legacy_constructor': 'nsJSProtocolHandler::Create',
'headers': ['nsJSProtocolHandler.h'],
},
{
'cid': '{ac9e3e82-bfbd-4f26-941e-f58c8ee178c1}',
'contract_ids': ['@mozilla.org/no-data-protocol-content-policy;1'],
'type': 'nsNoDataProtocolContentPolicy',
'headers': ['/dom/base/nsNoDataProtocolContentPolicy.h'],
'categories': {'content-policy': '@mozilla.org/no-data-protocol-content-policy;1'},
},
{
'cid': '{5995b782-6a0e-4066-aac5-276f0a9ad8cf}',
'contract_ids': ['@mozilla.org/notificationTelemetryService;1'],
'type': 'mozilla::dom::NotificationTelemetryService',
'headers': ['mozilla/dom/Notification.h'],
'init_method': 'Init',
},
{
'cid': '{bd066e5f-146f-4472-8331-7bfd05b1ed90}',
'contract_ids': ['@mozilla.org/nullprincipal;1'],
'type': 'mozilla::NullPrincipal',
'headers': ['/caps/NullPrincipal.h'],
'init_method': 'Init',
},
{
'cid': '{2a058404-fb85-44ec-8cfd-e8cbdc988dc1}',
'contract_ids': ['@mozilla.org/parentprocessmessagemanager;1'],
'legacy_constructor': 'CreateParentMessageManager',
},
{
'cid': '{af7b24cb-893f-41bb-961f-5a69388e27c3}',
'contract_ids': ['@mozilla.org/parserutils;1'],
'type': 'nsParserUtils',
'headers': ['nsParserUtils.h'],
},
{
'cid': '{e1e79dec-4085-4994-ac5b-744b016697e6}',
'contract_ids': ['@mozilla.org/presentation-device/manager;1'],
'type': 'mozilla::dom::PresentationDeviceManager',
'headers': ['mozilla/dom/PresentationDeviceManager.h'],
'categories': {'profile-after-change': 'PresentationDeviceManager'},
},
{
'cid': '{1d9bb10c-c0ab-4fe8-9e4f-4058b8519832}',
'contract_ids': ['@mozilla.org/presentation/presentationservice;1'],
'singleton': True,
'type': 'nsIPresentationService',
'constructor': 'NS_CreatePresentationService',
'headers': ['nsIPresentationService.h', '/layout/build/nsLayoutModule.h'],
'categories': {'profile-after-change': 'PresentationService'},
},
{
'cid': '{c9d023f4-6228-4c07-8b1d-9c19573faa27}',
'contract_ids': ['@mozilla.org/presentation/presentationtcpsessiontransport;1'],
'type': 'mozilla::dom::PresentationTCPSessionTransport',
'headers': ['mozilla/dom/PresentationTCPSessionTransport.h'],
},
{
'cid': '{653e0e4d-3ee4-45fa-b272-97c20bc01eb8}',
'contract_ids': ['@mozilla.org/principal;1'],
'type': 'mozilla::ContentPrincipal',
'headers': ['/caps/ContentPrincipal.h'],
},
{
'cid': '{2fc2d3e3-020f-404e-b06a-6ecf3ea2334a}',
'contract_ids': ['@mozilla.org/push/Notifier;1'],
'type': 'mozilla::dom::PushNotifier',
'headers': ['mozilla/dom/PushNotifier.h'],
},
{
'cid': '{f68037ec-2790-44c5-8e5f-df5da58b93a7}',
'contract_ids': ['@mozilla.org/scriptable-content-iterator;1'],
'type': 'ScriptableContentIterator',
'headers': ['mozilla/ScriptableContentIterator.h'],
},
{
'cid': '{1950539a-90f0-4d22-b5af-71329c68fa35}',
'contract_ids': ['@mozilla.org/scripterror;1'],
'type': 'nsScriptError',
'headers': ['/dom/bindings/nsScriptError.h'],
},
{
'cid': '{7ee2a4c0-4b93-17d3-ba18-0060b0f199a2}',
'contract_ids': ['@mozilla.org/scriptsecuritymanager;1'],
'legacy_constructor': 'Construct_nsIScriptSecurityManager',
},
{
'cid': '{c74bde32-bcc7-4840-8430-c733351b212a}',
'contract_ids': ['@mozilla.org/serviceworkers/manager;1'],
'singleton': True,
'type': 'mozilla::dom::ServiceWorkerManager',
'headers': ['mozilla/dom/ServiceWorkerManager.h'],
'constructor': 'mozilla::dom::ServiceWorkerManager::GetInstance',
},
{
'cid': '{69da374a-fda3-4a93-9fbc-d9304f66a7fe}',
'contract_ids': ['@mozilla.org/storage/activity-service;1'],
'singleton': True,
'type': 'mozilla::dom::StorageActivityService',
'headers': ['mozilla/StaticPtr.h', 'mozilla/dom/StorageActivityService.h'],
'constructor': 'mozilla::dom::StorageActivityService::GetOrCreate',
},
{
'cid': '{4a6212db-accb-11d3-b765-0060b0b6cecb}',
'contract_ids': ['@mozilla.org/systemprincipal;1'],
'singleton': True,
'type': 'nsIPrincipal',
'headers': ['nsScriptSecurityManager.h', '/caps/SystemPrincipal.h'],
'constructor': 'nsScriptSecurityManager::SystemPrincipalSingletonConstructor',
},
{
'cid': '{caaab47f-1e31-478e-8919-970904e9cb72}',
'contract_ids': ['@mozilla.org/text-input-processor;1'],
'type': 'mozilla::TextInputProcessor',
'headers': ['mozilla/TextInputProcessor.h'],
},
{
'cid': '{08c6cc8b-cfb0-421d-b1f7-683ff2989681}',
'contract_ids': ['@mozilla.org/thirdpartyutil;1'],
'type': 'ThirdPartyUtil',
'headers': ['/dom/base/ThirdPartyUtil.h'],
'init_method': 'Init',
},
{
'cid': '{31689828-da66-49a6-870c-df62b83fe789}',
'contract_ids': ['@mozilla.org/websocketevent/service;1'],
'singleton': True,
'type': 'mozilla::net::WebSocketEventService',
'headers': ['mozilla/net/WebSocketEventService.h'],
'constructor': 'mozilla::net::WebSocketEventService::GetOrCreate',
},
]
if defined('DEBUG'):
Classes += [
{
'cid': '{NS_LAYOUT_DEBUGGER_CID}',
'type': 'nsILayoutDebugger',
},
]
if defined('MOZ_WEBSPEECH'):
Classes += [
{
'cid': '{7090524d-5574-4492-a77f-d8d558ced59d}',
'contract_ids': ['@mozilla.org/synth-voice-registry;1'],
'singleton': True,
'type': 'mozilla::dom::nsSynthVoiceRegistry',
'headers': ['mozilla/dom/nsSynthVoiceRegistry.h'],
'constructor': 'mozilla::dom::nsSynthVoiceRegistry::GetInstanceForService',
},
]
if defined('MOZ_WEBSPEECH_TEST_BACKEND'):
Classes += [
{
'cid': '{48c345e7-9929-4f9a-a563-f478222dabcd}',
'contract_ids': ['@mozilla.org/webspeech/service;1?name=fake'],
'type': 'mozilla::FakeSpeechRecognitionService',
'headers': ['mozilla/dom/FakeSpeechRecognitionService.h'],
},
]
if defined('ACCESSIBILITY'):
Classes += [
{
'cid': '{3b265b69-f813-48ff-880d-d88d101af404}',
'contract_ids': ['@mozilla.org/accessibilityService;1'],
'type': 'nsIAccessibilityService',
},
]
if buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android':
Classes += [
{
'cid': '{1f15dbc8-bfaa-45de-8a46-08e2e26326b0}',
'contract_ids': ['@mozilla.org/widget/hapticfeedback;1'],
'type': 'nsHapticFeedback',
'headers': ['/dom/system/android/nsHapticFeedback.h'],
},
]

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

@ -71,11 +71,9 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
'/dom/system/android',
]
if CONFIG['MOZ_WEBSPEECH']:
LOCAL_INCLUDES += [
'/dom/media/webspeech/recognition',
'/dom/media/webspeech/synth',
]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul'

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

@ -7,6 +7,7 @@
#include "base/basictypes.h"
#include "XPCModule.h"
#include "mozilla/Components.h"
#include "mozilla/ModuleUtils.h"
#include "nsImageModule.h"
#include "nsLayoutStatics.h"
@ -19,63 +20,30 @@
#include "nsFrameMessageManager.h"
#include "nsHTMLContentSerializer.h"
#include "nsHTMLParts.h"
#include "nsIComponentManager.h"
#include "nsIContentSerializer.h"
#include "nsIContentViewer.h"
#include "nsIController.h"
#include "nsIControllers.h"
#include "nsIFactory.h"
#include "nsIIdleService.h"
#include "nsHTMLStyleSheet.h"
#include "nsILayoutDebugger.h"
#include "nsNameSpaceManager.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsIScriptError.h"
#include "nsCaret.h"
#include "nsPlainTextSerializer.h"
#include "nsXMLContentSerializer.h"
#include "nsXHTMLContentSerializer.h"
#include "nsContentAreaDragDrop.h"
#include "nsIFrameTraversal.h"
#include "nsLayoutCID.h"
#include "nsStyleSheetService.h"
#include "nsFocusManager.h"
#include "ThirdPartyUtil.h"
#include "nsStructuredCloneContainer.h"
#include "gfxPlatform.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/dom/quota/QuotaManagerService.h"
#include "nsIEventListenerService.h"
#include "nsIMessageManager.h"
// Transformiix stuff
#include "mozilla/dom/XPathEvaluator.h"
// view stuff
#include "nsContentCreatorFunctions.h"
#include "nsGlobalWindowCommands.h"
#include "nsJSProtocolHandler.h"
#include "nsIControllerContext.h"
#include "nsZipArchive.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/BlobURL.h"
#include "mozilla/dom/DOMRequest.h"
#include "mozilla/dom/SDBConnection.h"
#include "mozilla/dom/LocalStorageCommon.h"
#include "mozilla/dom/LocalStorageManager.h"
#include "mozilla/dom/LocalStorageManager2.h"
#include "mozilla/dom/quota/QuotaManagerService.h"
#include "mozilla/dom/ServiceWorkerManager.h"
#include "mozilla/dom/StorageActivityService.h"
#include "mozilla/dom/WorkerDebuggerManager.h"
#include "mozilla/dom/Notification.h"
#include "mozilla/OSFileConstants.h"
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
# include "mozilla/dom/FakeSpeechRecognitionService.h"
#endif
#ifdef MOZ_WEBSPEECH
# include "mozilla/dom/nsSynthVoiceRegistry.h"
#endif
@ -89,22 +57,13 @@ using mozilla::dom::PushNotifier;
} \
}
// Editor stuff
#include "mozilla/EditorController.h" //CID
#include "nsScriptSecurityManager.h"
#include "ExpandedPrincipal.h"
#include "mozilla/ContentPrincipal.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/SystemPrincipal.h"
#include "nsNetCID.h"
#if defined(MOZ_WIDGET_ANDROID)
# include "nsHapticFeedback.h"
#endif
#include "nsParserUtils.h"
#include "nsHTMLCanvasFrame.h"
class nsIDocumentLoaderFactory;
#define PRODUCT_NAME "Gecko"
@ -121,101 +80,11 @@ class nsIDocumentLoaderFactory;
static void Shutdown();
#include "nsGeolocation.h"
#include "nsDeviceSensors.h"
#include "mozilla/dom/nsContentSecurityManager.h"
#include "mozilla/dom/nsCSPService.h"
#include "mozilla/dom/nsCSPContext.h"
#include "nsIMediaManager.h"
#include "mozilla/dom/nsMixedContentBlocker.h"
#include "mozilla/net/WebSocketEventService.h"
#include "nsIPresentationService.h"
#include "MediaManager.h"
#include "GMPService.h"
#include "mozilla/dom/PresentationDeviceManager.h"
#include "mozilla/dom/PresentationTCPSessionTransport.h"
#include "nsScriptError.h"
#include "nsBaseCommandController.h"
#include "nsControllerCommandTable.h"
#include "mozilla/TextInputProcessor.h"
#include "mozilla/ScriptableContentIterator.h"
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::net;
using mozilla::dom::quota::QuotaManagerService;
using mozilla::gmp::GeckoMediaPluginService;
#define NS_HAPTICFEEDBACK_CID \
{ \
0x1f15dbc8, 0xbfaa, 0x45de, { \
0x8a, 0x46, 0x08, 0xe2, 0xe2, 0x63, 0x26, 0xb0 \
} \
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserUtils)
// PresentationDeviceManager
/* e1e79dec-4085-4994-ac5b-744b016697e6 */
#define PRESENTATION_DEVICE_MANAGER_CID \
{ \
0xe1e79dec, 0x4085, 0x4994, { \
0xac, 0x5b, 0x74, 0x4b, 0x01, 0x66, 0x97, 0xe6 \
} \
}
#define PRESENTATION_TCP_SESSION_TRANSPORT_CID \
{ \
0xc9d023f4, 0x6228, 0x4c07, { \
0x8b, 0x1d, 0x9c, 0x19, 0x57, 0x3f, 0xaa, 0x27 \
} \
}
already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
// Factory Constructor
typedef mozilla::dom::BlobURL::Mutator BlobURLMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(BlobURLMutator)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService,
DOMRequestService::FactoryCreate)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManagerService,
QuotaManagerService::FactoryCreate)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
ServiceWorkerManager::GetInstance)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WorkerDebuggerManager,
WorkerDebuggerManager::GetInstance)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(StorageActivityService,
StorageActivityService::GetOrCreate)
#ifdef MOZ_WEBSPEECH
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
nsSynthVoiceRegistry, nsSynthVoiceRegistry::GetInstanceForService)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
#if defined(ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
MediaManager::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(TextInputProcessor)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPresentationService,
NS_CreatePresentationService)
NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationTCPSessionTransport)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NotificationTelemetryService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(PushNotifier)
NS_GENERIC_FACTORY_CONSTRUCTOR(ScriptableContentIterator)
//-----------------------------------------------------------------------------
@ -271,43 +140,39 @@ nsresult NS_NewGlobalMessageManager(nsISupports** aResult);
nsresult NS_NewParentProcessMessageManager(nsISupports** aResult);
nsresult NS_NewChildProcessMessageManager(nsISupports** aResult);
#define MAKE_CTOR(ctor_, iface_, func_) \
static nsresult ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) { \
*aResult = nullptr; \
if (aOuter) return NS_ERROR_NO_AGGREGATION; \
iface_* inst; \
nsresult rv = func_(&inst); \
if (NS_SUCCEEDED(rv)) { \
rv = inst->QueryInterface(aIID, aResult); \
NS_RELEASE(inst); \
} \
return rv; \
#define MAKE_CTOR(ctor_, iface_, func_) \
nsresult ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) { \
*aResult = nullptr; \
if (aOuter) return NS_ERROR_NO_AGGREGATION; \
iface_* inst; \
nsresult rv = func_(&inst); \
if (NS_SUCCEEDED(rv)) { \
rv = inst->QueryInterface(aIID, aResult); \
NS_RELEASE(inst); \
} \
return rv; \
}
// As above, but expects
// already_AddRefed<nsIFoo> NS_NewFoo();
// instead of
// nsresult NS_NewFoo(nsIFoo**);
#define MAKE_CTOR2(ctor_, iface_, func_) \
static nsresult ctor_(nsISupports* aOuter, REFNSIID aIID, void** aResult) { \
*aResult = nullptr; \
if (aOuter) { \
return NS_ERROR_NO_AGGREGATION; \
} \
nsCOMPtr<iface_> inst = func_(); \
inst.forget(aResult); \
return NS_OK; \
#define MAKE_GENERIC_CTOR(iface_, func_) \
NS_IMPL_COMPONENT_FACTORY(iface_) { \
nsCOMPtr<iface_> inst; \
if (NS_SUCCEEDED(func_(getter_AddRefs(inst)))) { \
return inst.forget(); \
} \
return nullptr; \
}
#define MAKE_GENERIC_CTOR2(iface_, func_) \
NS_IMPL_COMPONENT_FACTORY(iface_) { return func_(); }
#ifdef DEBUG
MAKE_CTOR(CreateNewLayoutDebugger, nsILayoutDebugger, NS_NewLayoutDebugger)
MAKE_GENERIC_CTOR(nsILayoutDebugger, NS_NewLayoutDebugger)
#endif
MAKE_CTOR(CreateNewFrameTraversal, nsIFrameTraversal, NS_CreateFrameTraversal)
MAKE_GENERIC_CTOR(nsIFrameTraversal, NS_CreateFrameTraversal)
NS_GENERIC_FACTORY_CONSTRUCTOR(inDeepTreeWalker)
MAKE_GENERIC_CTOR2(nsIContentViewer, NS_NewContentViewer)
MAKE_CTOR2(CreateContentViewer, nsIContentViewer, NS_NewContentViewer)
MAKE_CTOR(CreateXMLContentSerializer, nsIContentSerializer,
NS_NewXMLContentSerializer)
MAKE_CTOR(CreateHTMLContentSerializer, nsIContentSerializer,
@ -317,23 +182,16 @@ MAKE_CTOR(CreateXHTMLContentSerializer, nsIContentSerializer,
MAKE_CTOR(CreatePlainTextSerializer, nsIContentSerializer,
NS_NewPlainTextSerializer)
MAKE_CTOR(CreateContentPolicy, nsIContentPolicy, NS_NewContentPolicy)
MAKE_CTOR(CreateContentDLF, nsIDocumentLoaderFactory,
NS_NewContentDocumentLoaderFactory)
MAKE_CTOR(CreateEventListenerService, nsIEventListenerService,
NS_NewEventListenerService)
MAKE_GENERIC_CTOR(nsIDocumentLoaderFactory, NS_NewContentDocumentLoaderFactory)
MAKE_GENERIC_CTOR(nsIEventListenerService, NS_NewEventListenerService)
MAKE_CTOR(CreateGlobalMessageManager, nsISupports, NS_NewGlobalMessageManager)
MAKE_CTOR(CreateParentMessageManager, nsISupports,
NS_NewParentProcessMessageManager)
MAKE_CTOR(CreateChildMessageManager, nsISupports,
NS_NewChildProcessMessageManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDataDocumentContentPolicy)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoDataProtocolContentPolicy)
MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManager)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStyleSheetService, Init)
typedef nsJSURI::Mutator nsJSURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURIMutator)
MAKE_GENERIC_CTOR(nsIFocusManager, NS_NewFocusManager)
// views are not refcounted, so this is the same as
// NS_GENERIC_FACTORY_CONSTRUCTOR without the NS_ADDREF/NS_RELEASE
@ -358,62 +216,14 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSURIMutator)
return rv; \
}
#define NS_GEOLOCATION_CID \
{ \
0x1E1C3FF, 0x94A, 0xD048, { \
0x44, 0xB4, 0x62, 0xD2, 0x9C, 0x7B, 0x4F, 0x39 \
} \
}
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(Geolocation,
Geolocation::NonWindowSingleton)
#define NS_WEBSOCKETEVENT_SERVICE_CID \
{ \
0x31689828, 0xda66, 0x49a6, { \
0x87, 0x0c, 0xdf, 0x62, 0xb8, 0x3f, 0xe7, 0x89 \
} \
}
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketEventService,
WebSocketEventService::GetOrCreate)
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsContentSecurityManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsCSPContext)
NS_GENERIC_FACTORY_CONSTRUCTOR(CSPService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMixedContentBlocker)
NS_GENERIC_FACTORY_CONSTRUCTOR(ContentPrincipal)
NS_GENERIC_FACTORY_CONSTRUCTOR(ExpandedPrincipal)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
SystemPrincipal,
nsScriptSecurityManager::SystemPrincipalSingletonConstructor)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NullPrincipal, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStructuredCloneContainer)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(OSFileConstantsService,
OSFileConstantsService::GetOrCreate);
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
GeckoMediaPluginService,
GeckoMediaPluginService::GetGeckoMediaPluginService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptError)
#ifdef ACCESSIBILITY
# include "xpcAccessibilityService.h"
MAKE_CTOR(CreateA11yService, nsIAccessibilityService,
NS_GetAccessibilityService)
MAKE_GENERIC_CTOR(nsIAccessibilityService, NS_GetAccessibilityService)
#endif
static nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter,
REFNSIID aIID,
void** aResult) {
nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) return NS_ERROR_NULL_POINTER;
*aResult = nullptr;
if (aOuter) return NS_ERROR_NO_AGGREGATION;
@ -424,86 +234,8 @@ static nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter,
return NS_OK;
}
#ifdef DEBUG
NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGER_CID);
#endif
NS_DEFINE_NAMED_CID(NS_FRAMETRAVERSAL_CID);
NS_DEFINE_NAMED_CID(IN_DEEPTREEWALKER_CID);
NS_DEFINE_NAMED_CID(NS_CONTENT_VIEWER_CID);
NS_DEFINE_NAMED_CID(NS_XMLCONTENTSERIALIZER_CID);
NS_DEFINE_NAMED_CID(NS_XHTMLCONTENTSERIALIZER_CID);
NS_DEFINE_NAMED_CID(NS_HTMLCONTENTSERIALIZER_CID);
NS_DEFINE_NAMED_CID(NS_PLAINTEXTSERIALIZER_CID);
NS_DEFINE_NAMED_CID(NS_PARSERUTILS_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_DATADOCUMENTCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_NODATAPROTOCOLCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_CONTENT_DOCUMENT_LOADER_FACTORY_CID);
NS_DEFINE_NAMED_CID(NS_JSPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_JSURI_CID);
NS_DEFINE_NAMED_CID(NS_JSURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_PLUGINDOCLOADERFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_STYLESHEETSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURI_CID);
NS_DEFINE_NAMED_CID(NS_HOSTOBJECTURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_SDBCONNECTION_CID);
NS_DEFINE_NAMED_CID(NS_DOMLOCALSTORAGEMANAGER_CID);
NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID);
NS_DEFINE_NAMED_CID(QUOTAMANAGER_SERVICE_CID);
NS_DEFINE_NAMED_CID(SERVICEWORKERMANAGER_CID);
NS_DEFINE_NAMED_CID(STORAGEACTIVITYSERVICE_CID);
NS_DEFINE_NAMED_CID(NOTIFICATIONTELEMETRYSERVICE_CID);
NS_DEFINE_NAMED_CID(PUSHNOTIFIER_CID);
NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTSECURITYMANAGER_CID);
NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_CSPCONTEXT_CID);
NS_DEFINE_NAMED_CID(NS_MIXEDCONTENTBLOCKER_CID);
NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_PARENTPROCESSMESSAGEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_CHILDPROCESSMESSAGEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_SCRIPTSECURITYMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID);
NS_DEFINE_NAMED_CID(NS_EXPANDEDPRINCIPAL_CID);
NS_DEFINE_NAMED_CID(NS_SYSTEMPRINCIPAL_CID);
NS_DEFINE_NAMED_CID(NS_NULLPRINCIPAL_CID);
NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID);
NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID);
NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
#if defined(ANDROID)
NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
#endif
NS_DEFINE_NAMED_CID(OSFILECONSTANTSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_MEDIAMANAGERSERVICE_CID);
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_DEFINE_NAMED_CID(NS_FAKE_SPEECH_RECOGNITION_SERVICE_CID);
#endif
#ifdef MOZ_WEBSPEECH
NS_DEFINE_NAMED_CID(NS_SYNTHVOICEREGISTRY_CID);
#endif
#ifdef ACCESSIBILITY
NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(GECKO_MEDIA_PLUGIN_SERVICE_CID);
NS_DEFINE_NAMED_CID(PRESENTATION_SERVICE_CID);
NS_DEFINE_NAMED_CID(PRESENTATION_DEVICE_MANAGER_CID);
NS_DEFINE_NAMED_CID(PRESENTATION_TCP_SESSION_TRANSPORT_CID);
NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
NS_DEFINE_NAMED_CID(NS_SCRIPTERROR_CID);
NS_DEFINE_NAMED_CID(SCRIPTABLE_CONTENT_ITERATOR_CID);
static nsresult LocalStorageManagerConstructor(nsISupports* aOuter,
REFNSIID aIID, void** aResult) {
nsresult LocalStorageManagerConstructor(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (NextGenLocalStorageEnabled()) {
RefPtr<LocalStorageManager2> manager = new LocalStorageManager2();
return manager->QueryInterface(aIID, aResult);
@ -513,181 +245,20 @@ static nsresult LocalStorageManagerConstructor(nsISupports* aOuter,
return manager->QueryInterface(aIID, aResult);
}
static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
// clang-format off
XPCONNECT_CIDENTRIES
#ifdef DEBUG
{ &kNS_LAYOUT_DEBUGGER_CID, false, nullptr, CreateNewLayoutDebugger },
#endif
{ &kNS_FRAMETRAVERSAL_CID, false, nullptr, CreateNewFrameTraversal },
{ &kIN_DEEPTREEWALKER_CID, false, nullptr, inDeepTreeWalkerConstructor },
{ &kNS_CONTENT_VIEWER_CID, false, nullptr, CreateContentViewer },
{ &kNS_XMLCONTENTSERIALIZER_CID, false, nullptr, CreateXMLContentSerializer },
{ &kNS_HTMLCONTENTSERIALIZER_CID, false, nullptr, CreateHTMLContentSerializer },
{ &kNS_XHTMLCONTENTSERIALIZER_CID, false, nullptr, CreateXHTMLContentSerializer },
{ &kNS_PLAINTEXTSERIALIZER_CID, false, nullptr, CreatePlainTextSerializer },
{ &kNS_PARSERUTILS_CID, false, nullptr, nsParserUtilsConstructor },
{ &kNS_CONTENTPOLICY_CID, false, nullptr, CreateContentPolicy },
{ &kNS_DATADOCUMENTCONTENTPOLICY_CID, false, nullptr, nsDataDocumentContentPolicyConstructor },
{ &kNS_NODATAPROTOCOLCONTENTPOLICY_CID, false, nullptr, nsNoDataProtocolContentPolicyConstructor },
{ &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID, false, nullptr, CreateContentDLF },
{ &kNS_JSPROTOCOLHANDLER_CID, false, nullptr, nsJSProtocolHandler::Create },
{ &kNS_JSURI_CID, false, nullptr, nsJSURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_JSURIMUTATOR_CID, false, nullptr, nsJSURIMutatorConstructor },
{ &kNS_PLUGINDOCLOADERFACTORY_CID, false, nullptr, CreateContentDLF },
{ &kNS_STYLESHEETSERVICE_CID, false, nullptr, nsStyleSheetServiceConstructor },
{ &kNS_HOSTOBJECTURI_CID, false, nullptr, BlobURLMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_HOSTOBJECTURIMUTATOR_CID, false, nullptr, BlobURLMutatorConstructor },
{ &kNS_SDBCONNECTION_CID, false, nullptr, SDBConnection::Create },
{ &kNS_DOMLOCALSTORAGEMANAGER_CID, false, nullptr, LocalStorageManagerConstructor },
{ &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor },
{ &kQUOTAMANAGER_SERVICE_CID, false, nullptr, QuotaManagerServiceConstructor },
{ &kSERVICEWORKERMANAGER_CID, false, nullptr, ServiceWorkerManagerConstructor },
{ &kSTORAGEACTIVITYSERVICE_CID, false, nullptr, StorageActivityServiceConstructor },
{ &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },
{ &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor },
{ &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor },
{ &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
{ &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
{ &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
#endif
#ifdef MOZ_WEBSPEECH
{ &kNS_SYNTHVOICEREGISTRY_CID, true, nullptr, nsSynthVoiceRegistryConstructor },
#endif
{ &kNS_CONTENTSECURITYMANAGER_CID, false, nullptr, nsContentSecurityManagerConstructor },
{ &kCSPSERVICE_CID, false, nullptr, CSPServiceConstructor },
{ &kNS_CSPCONTEXT_CID, false, nullptr, nsCSPContextConstructor },
{ &kNS_MIXEDCONTENTBLOCKER_CID, false, nullptr, nsMixedContentBlockerConstructor },
{ &kNS_EVENTLISTENERSERVICE_CID, false, nullptr, CreateEventListenerService },
{ &kNS_GLOBALMESSAGEMANAGER_CID, false, nullptr, CreateGlobalMessageManager },
{ &kNS_PARENTPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateParentMessageManager },
{ &kNS_CHILDPROCESSMESSAGEMANAGER_CID, false, nullptr, CreateChildMessageManager },
{ &kNS_SCRIPTSECURITYMANAGER_CID, false, nullptr, Construct_nsIScriptSecurityManager },
{ &kNS_PRINCIPAL_CID, false, nullptr, ContentPrincipalConstructor },
{ &kNS_EXPANDEDPRINCIPAL_CID, false, nullptr, ExpandedPrincipalConstructor },
{ &kNS_SYSTEMPRINCIPAL_CID, false, nullptr, SystemPrincipalConstructor },
{ &kNS_NULLPRINCIPAL_CID, false, nullptr, NullPrincipalConstructor },
{ &kNS_DEVICE_SENSORS_CID, false, nullptr, nsDeviceSensorsConstructor },
#if defined(ANDROID)
{ &kNS_HAPTICFEEDBACK_CID, false, nullptr, nsHapticFeedbackConstructor },
#endif
{ &kTHIRDPARTYUTIL_CID, false, nullptr, ThirdPartyUtilConstructor },
{ &kNS_STRUCTUREDCLONECONTAINER_CID, false, nullptr, nsStructuredCloneContainerConstructor },
{ &kOSFILECONSTANTSSERVICE_CID, true, nullptr, OSFileConstantsServiceConstructor },
{ &kGECKO_MEDIA_PLUGIN_SERVICE_CID, true, nullptr, GeckoMediaPluginServiceConstructor },
{ &kNS_MEDIAMANAGERSERVICE_CID, false, nullptr, nsIMediaManagerServiceConstructor },
#ifdef ACCESSIBILITY
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
#endif
{ &kPRESENTATION_SERVICE_CID, false, nullptr, nsIPresentationServiceConstructor },
{ &kPRESENTATION_DEVICE_MANAGER_CID, false, nullptr, PresentationDeviceManagerConstructor },
{ &kPRESENTATION_TCP_SESSION_TRANSPORT_CID, false, nullptr, PresentationTCPSessionTransportConstructor },
{ &kTEXT_INPUT_PROCESSOR_CID, false, nullptr, TextInputProcessorConstructor },
{ &kNS_SCRIPTERROR_CID, false, nullptr, nsScriptErrorConstructor },
{ &kSCRIPTABLE_CONTENT_ITERATOR_CID, false, nullptr, ScriptableContentIteratorConstructor },
{ nullptr }
// clang-format on
};
static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
// clang-format off
XPCONNECT_CONTRACTS
{ "@mozilla.org/inspector/deep-tree-walker;1", &kIN_DEEPTREEWALKER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/xml", &kNS_XMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xml", &kNS_XMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/xhtml+xml", &kNS_XHTMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "image/svg+xml", &kNS_XMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/html", &kNS_HTMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "application/vnd.mozilla.xul+xml", &kNS_XMLCONTENTSERIALIZER_CID },
{ NS_CONTENTSERIALIZER_CONTRACTID_PREFIX "text/plain", &kNS_PLAINTEXTSERIALIZER_CID },
{ NS_PARSERUTILS_CONTRACTID, &kNS_PARSERUTILS_CID },
{ NS_CONTENTPOLICY_CONTRACTID, &kNS_CONTENTPOLICY_CID },
{ NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, &kNS_DATADOCUMENTCONTENTPOLICY_CID },
{ NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, &kNS_NODATAPROTOCOLCONTENTPOLICY_CID },
{ CONTENT_DLF_CONTRACTID, &kNS_CONTENT_DOCUMENT_LOADER_FACTORY_CID },
{ NS_JSPROTOCOLHANDLER_CONTRACTID, &kNS_JSPROTOCOLHANDLER_CID },
{ PLUGIN_DLF_CONTRACTID, &kNS_PLUGINDOCLOADERFACTORY_CID },
{ NS_STYLESHEETSERVICE_CONTRACTID, &kNS_STYLESHEETSERVICE_CID },
{ NS_SDBCONNECTION_CONTRACTID, &kNS_SDBCONNECTION_CID },
{ "@mozilla.org/dom/localStorage-manager;1", &kNS_DOMLOCALSTORAGEMANAGER_CID },
{ DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID },
{ QUOTAMANAGER_SERVICE_CONTRACTID, &kQUOTAMANAGER_SERVICE_CID },
{ SERVICEWORKERMANAGER_CONTRACTID, &kSERVICEWORKERMANAGER_CID },
{ STORAGE_ACTIVITY_SERVICE_CONTRACTID, &kSTORAGEACTIVITYSERVICE_CID },
{ NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID },
{ PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID },
{ WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID },
{ "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
{ "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },
#endif
#ifdef MOZ_WEBSPEECH
{ NS_SYNTHVOICEREGISTRY_CONTRACTID, &kNS_SYNTHVOICEREGISTRY_CID },
#endif
{ NS_CONTENTSECURITYMANAGER_CONTRACTID, &kNS_CONTENTSECURITYMANAGER_CID },
{ CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID },
{ NS_CSPCONTEXT_CONTRACTID, &kNS_CSPCONTEXT_CID },
{ NS_MIXEDCONTENTBLOCKER_CONTRACTID, &kNS_MIXEDCONTENTBLOCKER_CID },
{ NS_EVENTLISTENERSERVICE_CONTRACTID, &kNS_EVENTLISTENERSERVICE_CID },
{ NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID },
{ NS_PARENTPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_PARENTPROCESSMESSAGEMANAGER_CID },
{ NS_CHILDPROCESSMESSAGEMANAGER_CONTRACTID, &kNS_CHILDPROCESSMESSAGEMANAGER_CID },
{ NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
{ NS_PRINCIPAL_CONTRACTID, &kNS_PRINCIPAL_CID },
{ NS_EXPANDEDPRINCIPAL_CONTRACTID, &kNS_EXPANDEDPRINCIPAL_CID },
{ NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID },
{ NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID },
{ NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID },
#if defined(ANDROID)
{ "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID },
#endif
{ THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
{ NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
{ OSFILECONSTANTSSERVICE_CONTRACTID, &kOSFILECONSTANTSSERVICE_CID },
{ MEDIAMANAGERSERVICE_CONTRACTID, &kNS_MEDIAMANAGERSERVICE_CID },
#ifdef ACCESSIBILITY
{ "@mozilla.org/accessibilityService;1", &kNS_ACCESSIBILITY_SERVICE_CID },
#endif
{ "@mozilla.org/gecko-media-plugin-service;1", &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
{ PRESENTATION_SERVICE_CONTRACTID, &kPRESENTATION_SERVICE_CID },
{ PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
{ PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID, &kPRESENTATION_TCP_SESSION_TRANSPORT_CID },
{ "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
{ NS_SCRIPTERROR_CONTRACTID, &kNS_SCRIPTERROR_CID },
{ "@mozilla.org/scriptable-content-iterator;1", &kSCRIPTABLE_CONTENT_ITERATOR_CID },
{ nullptr }
};
static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
{ "content-policy", NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID, NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID },
{ "content-policy", NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID, NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID },
{ "content-policy", "CSPService", CSPSERVICE_CONTRACTID },
{ "content-policy", NS_MIXEDCONTENTBLOCKER_CONTRACTID, NS_MIXEDCONTENTBLOCKER_CONTRACTID },
{ "net-channel-event-sinks", "CSPService", CSPSERVICE_CONTRACTID },
{ "net-channel-event-sinks", NS_MIXEDCONTENTBLOCKER_CONTRACTID, NS_MIXEDCONTENTBLOCKER_CONTRACTID },
{ "app-startup", "Script Security Manager", "service," NS_SCRIPTSECURITYMANAGER_CONTRACTID },
{ "app-startup", "Push Notifier", "service," PUSHNOTIFIER_CONTRACTID },
// clang-format off
{ "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID },
{ OBSERVER_TOPIC_IDLE_DAILY, "QuotaManagerService", QUOTAMANAGER_SERVICE_CONTRACTID },
CONTENTDLF_CATEGORIES
{ "profile-after-change", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID },
{ "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID },
{ "profile-after-change", "Notification Telemetry Service", NOTIFICATIONTELEMETRYSERVICE_CONTRACTID },
{ nullptr }
{nullptr}
// clang-format on
};
static nsresult Initialize() {
// nsLayoutModuleInitialize should be called first.
MOZ_RELEASE_ASSERT(gInitialized);
return NS_OK;
}
void nsLayoutModuleDtor() {
if (XRE_GetProcessType() == GeckoProcessType_GPU ||
XRE_GetProcessType() == GeckoProcessType_VR ||
XRE_GetProcessType() == GeckoProcessType_RDD) {
return;
}
static void LayoutModuleDtor() {
Shutdown();
nsContentUtils::XPCOMShutdown();
@ -701,9 +272,12 @@ static void LayoutModuleDtor() {
xpcModuleDtor();
}
static const mozilla::Module kLayoutModule = {
mozilla::Module::kVersion, kLayoutCIDs, kLayoutContracts,
kLayoutCategories, nullptr, Initialize,
LayoutModuleDtor};
static const mozilla::Module kLayoutModule = {mozilla::Module::kVersion,
nullptr,
nullptr,
kLayoutCategories,
nullptr,
nullptr,
nullptr};
NSMODULE_DEFN(nsLayoutModule) = &kLayoutModule;

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

@ -9,9 +9,37 @@
#include "nscore.h"
class nsIPresentationService;
// This function initializes various layout statics, as well as XPConnect.
// It should be called only once, and before the first time any XPCOM module in
// nsLayoutModule is used.
void nsLayoutModuleInitialize();
void nsLayoutModuleDtor();
nsresult CreateXMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateHTMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateXHTMLContentSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreatePlainTextSerializer(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateContentPolicy(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateGlobalMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateParentMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult CreateChildMessageManager(nsISupports* aOuter, const nsID& aIID,
void** aResult);
nsresult Construct_nsIScriptSecurityManager(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult LocalStorageManagerConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
#endif // nsLayoutModule_h

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

@ -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;

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

@ -922,6 +922,12 @@ VARCACHE_PREF(
bool, true
)
VARCACHE_PREF(
"layout.lower_priority_refresh_driver_during_load",
layout_lower_priority_refresh_driver_during_load,
bool, true
)
// Pref to control enabling scroll anchoring.
#ifndef ANDROID
#define PREF_VALUE true

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

@ -148,6 +148,7 @@ EXPORTS += [
'nsSerializationHelper.h',
'nsSimpleNestedURI.h',
'nsSimpleURI.h',
'nsStandardURL.h',
'nsStreamListenerWrapper.h',
'nsURIHashKey.h',
'nsURLHelper.h',

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

@ -8,6 +8,7 @@
#include "nsIUDPSocket.h"
#include "mozilla/Mutex.h"
#include "mozilla/net/DNS.h"
#include "nsIOutputStream.h"
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"

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

@ -0,0 +1,622 @@
# -*- 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/.
Headers = [
'/netwerk/build/nsNetModule.h'
]
InitFunc = 'nsNetStartup'
UnloadFunc = 'nsNetShutdown'
Classes = [
{
'cid': '{3014dde6-aa1c-41db-87d0-48764a3710f6}',
'contract_ids': ['@mozilla.org/io/arraybuffer-input-stream;1'],
'type': 'ArrayBufferInputStream',
'headers': ['/netwerk/base/ArrayBufferInputStream.h'],
},
{
'cid': '{62d4b190-3642-4450-b019-d1c1fba56025}',
'contract_ids': ['@mozilla.org/load-context-info-factory;1'],
'type': 'mozilla::net::LoadContextInfoFactory',
'headers': ['mozilla/LoadContextInfo.h'],
},
{
'cid': '{ea70b098-5014-4e21-aee1-75e6b2c4b8e0}',
'contract_ids': [
'@mozilla.org/netwerk/cache-storage-service;1',
'@mozilla.org/network/cache-storage-service;1',
],
'singleton': True,
'type': 'mozilla::net::CacheStorageService',
'headers': ['CacheStorageService.h'],
},
{
'cid': '{02bf7a2a-39d8-4a23-a50c-2cbb085ab7a5}',
'contract_ids': ['@mozilla.org/network/application-cache-service;1'],
'singleton': True,
'type': 'nsApplicationCacheService',
'headers': ['nsApplicationCacheService.h'],
},
{
'cid': '{e746a8b1-c97a-4fc5-baa4-66607521bd08}',
'contract_ids': ['@mozilla.org/network/async-stream-copier;1'],
'type': 'nsAsyncStreamCopier',
'headers': ['/netwerk/base/nsAsyncStreamCopier.h'],
},
{
'cid': '{6eae857e-4ba9-11e3-9b39-b4036188709b}',
'contract_ids': ['@mozilla.org/network/atomic-file-output-stream;1'],
'type': 'nsAtomicFileOutputStream',
'headers': ['nsFileStreams.h'],
},
{
'cid': '{62147d1e-ef6a-40e8-aaf8-d039f5caaa81}',
'contract_ids': ['@mozilla.org/network/background-file-saver;1?mode=outputstream'],
'type': 'mozilla::net::BackgroundFileSaverOutputStream',
'headers': ['/netwerk/base/BackgroundFileSaver.h'],
'init_method': 'Init',
},
{
'cid': '{208de7fc-a781-4031-bbae-cc0de539f61a}',
'contract_ids': ['@mozilla.org/network/background-file-saver;1?mode=streamlistener'],
'type': 'mozilla::net::BackgroundFileSaverStreamListener',
'headers': ['/netwerk/base/BackgroundFileSaver.h'],
'init_method': 'Init',
},
{
'cid': '{a2027ec6-ba0d-4c72-805d-148233f5f33c}',
'contract_ids': ['@mozilla.org/network/binary-detector;1'],
'legacy_constructor': 'CreateNewBinaryDetectorFactory',
},
{
'cid': '{9226888e-da08-11d3-8cda-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/buffered-input-stream;1'],
'legacy_constructor': 'nsBufferedInputStream::Create',
'headers': ['/netwerk/base/nsBufferedStreams.h'],
},
{
'cid': '{9868b4ce-da08-11d3-8cda-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/buffered-output-stream;1'],
'legacy_constructor': 'nsBufferedOutputStream::Create',
'headers': ['/netwerk/base/nsBufferedStreams.h'],
},
{
'cid': '{6c84aec9-29a5-4264-8fbc-bee8f922ea67}',
'contract_ids': ['@mozilla.org/network/cache-service;1'],
'legacy_constructor': 'nsCacheServiceConstructor',
},
{
'cid': '{bdbe0555-fc3d-4f7b-9205-c309ceb2d641}',
'contract_ids': ['@mozilla.org/network/captive-portal-service;1'],
'singleton': True,
'type': 'nsICaptivePortalService',
'constructor': 'mozilla::net::CaptivePortalService::GetSingleton',
'headers': ['mozilla/net/CaptivePortalService.h'],
},
{
'cid': '{c79eb3c6-091a-45a6-8544-5a8d1ab79537}',
'contract_ids': ['@mozilla.org/network/dashboard;1'],
'type': 'mozilla::net::Dashboard',
'headers': ['mozilla/net/Dashboard.h'],
},
{
'cid': '{b0ff4572-dae4-4bef-a092-83c1b88f6be9}',
'contract_ids': ['@mozilla.org/network/dns-service;1'],
'singleton': True,
'type': 'nsIDNSService',
'constructor': 'nsDNSService::GetXPCOMSingleton',
'headers': ['/netwerk/dns/nsDNSService2.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{510a86bb-6019-4ed1-bb4f-965cffd23ece}',
'contract_ids': ['@mozilla.org/network/downloader;1'],
'type': 'nsDownloader',
'headers': ['/netwerk/base/nsDownloader.h'],
},
{
'cid': '{cb9abbae-66b6-4609-8594-5c4ff300888e}',
'contract_ids': ['@mozilla.org/network/effective-tld-service;1'],
'singleton': True,
'type': 'nsEffectiveTLDService',
'headers': ['/netwerk/dns/nsEffectiveTLDService.h'],
'init_method': 'Init',
},
{
'cid': '{be9a53ae-c7e9-11d3-8cda-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/file-input-stream;1'],
'legacy_constructor': 'nsFileInputStream::Create',
'headers': ['nsFileStreams.h'],
},
{
'cid': '{c272fee0-c7e9-11d3-8cda-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/file-output-stream;1'],
'legacy_constructor': 'nsFileOutputStream::Create',
'headers': ['nsFileStreams.h'],
},
{
'cid': '{15629ada-a41c-4a09-961f-6553cd60b1a2}',
'contract_ids': ['@mozilla.org/network/http-activity-distributor;1'],
'type': 'mozilla::net::nsHttpActivityDistributor',
'headers': ['/netwerk/protocol/http/nsHttpActivityDistributor.h'],
},
{
'cid': '{36b63ef3-e0fa-4c49-9fd4-e065e85568f4}',
'contract_ids': ['@mozilla.org/network/http-auth-manager;1'],
'type': 'mozilla::net::nsHttpAuthManager',
'headers': ['/netwerk/protocol/http/nsHttpAuthManager.h'],
'init_method': 'Init',
},
{
'cid': '{62b778a6-bce3-456b-8c31-2865fbb68c91}',
'contract_ids': ['@mozilla.org/network/idn-service;1'],
'type': 'nsIDNService',
'headers': ['/netwerk/dns/nsIDNService.h'],
'init_method': 'Init',
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{a62af1ba-79b3-4896-8aaf-b148bfce4280}',
'contract_ids': ['@mozilla.org/network/incremental-download;1'],
'legacy_constructor': 'net_NewIncrementalDownload',
},
{
'cid': '{5d6352a3-b9c3-4fa3-87aa-b2a3c6e5a501}',
'contract_ids': ['@mozilla.org/network/incremental-stream-loader;1'],
'legacy_constructor': 'nsIncrementalStreamLoader::Create',
'headers': ['/netwerk/base/nsIncrementalStreamLoader.h'],
},
{
'cid': '{6ddb050c-0d04-11d4-986e-00c04fa0cf4a}',
'contract_ids': ['@mozilla.org/network/input-stream-channel;1'],
'type': 'mozilla::net::nsInputStreamChannel',
'headers': ['/netwerk/base/nsInputStreamChannel.h'],
'init_method': 'Init',
},
{
'cid': '{ccd0e960-7947-4635-b70e-4c661b63d675}',
'contract_ids': ['@mozilla.org/network/input-stream-pump;1'],
'type': 'nsInputStreamPump',
'headers': ['nsInputStreamPump.h'],
},
{
'cid': '{9ac9e770-18bc-11d3-9337-00104ba0fd40}',
'contract_ids': [
'@mozilla.org/network/io-service;1',
'@mozilla.org/network/util;1',
],
'singleton': True,
'type': 'mozilla::net::nsIOService',
'headers': ['/netwerk/base/nsIOService.h'],
'constructor': 'mozilla::net::nsIOService::GetInstance',
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{e1c61582-2a84-11d3-8cce-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/load-group;1'],
'legacy_constructor': 'nsLoadGroupConstructor',
},
{
'cid': '{1f4dbcf7-245c-4c8c-943d-8a1da0495e8a}',
'contract_ids': ['@mozilla.org/network/mime-hdrparam;1'],
'type': 'nsMIMEHeaderParamImpl',
'headers': ['/netwerk/mime/nsMIMEHeaderParamImpl.h'],
},
{
'cid': '{58a1c31c-1dd2-11b2-a3f6-d36949d48268}',
'contract_ids': ['@mozilla.org/network/mime-input-stream;1'],
'legacy_constructor': 'nsMIMEInputStreamConstructor',
'headers': ['nsMIMEInputStream.h'],
},
{
'cid': '{2693457e-3ba5-4455-991f-5350946adb12}',
'contract_ids': ['@mozilla.org/network/network-connectivity-service;1'],
'singleton': True,
'type': 'nsINetworkConnectivityService',
'constructor': 'mozilla::net::NetworkConnectivityService::GetSingleton',
'headers': ['mozilla/net/NetworkConnectivityService.h'],
},
{
'cid': '{969adfdf-7221-4419-aecf-05f8faf00c9b}',
'contract_ids': ['@mozilla.org/network/predictor;1'],
'singleton': True,
'legacy_constructor': 'mozilla::net::Predictor::Create',
'headers': ['mozilla/net/Predictor.h'],
},
{
'cid': '{e9b301c0-e0e4-11d3-a1a8-0050041caf44}',
'contract_ids': ['@mozilla.org/network/protocol-proxy-service;1'],
'singleton': True,
'type': 'mozilla::net::nsProtocolProxyService',
'headers': ['/netwerk/base/nsProtocolProxyService.h'],
'init_method': 'Init',
},
{
'cid': '{3decd6c8-30ef-11d3-8cd0-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/protocol/about;1?what=blank'],
'legacy_constructor': 'nsAboutBlank::Create',
'headers': ['/netwerk/protocol/about/nsAboutBlank.h'],
},
{
'cid': '{9158c470-86e4-11d4-9be2-00e09872a416}',
'contract_ids': ['@mozilla.org/network/protocol/about;1?what=cache'],
'legacy_constructor': 'nsAboutCache::Create',
'headers': ['/netwerk/protocol/about/nsAboutCache.h'],
},
{
'cid': '{7fa5237d-b0eb-438f-9e50-ca0166e63788}',
'contract_ids': ['@mozilla.org/network/protocol/about;1?what=cache-entry'],
'type': 'nsAboutCacheEntry',
'headers': ['/netwerk/protocol/about/nsAboutCacheEntry.h'],
},
{
'cid': '{9e3b6c90-2f75-11d3-8cd0-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=about'],
'singleton': True,
'type': 'mozilla::net::nsAboutProtocolHandler',
'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
},
{
'cid': '{b6ed3030-6183-11d3-a178-0050041caf44}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=data'],
'singleton': True,
'legacy_constructor': 'nsDataHandler::Create',
'headers': ['/netwerk/protocol/data/nsDataHandler.h'],
},
{
'cid': '{fbc81170-1f69-11d3-9344-00104ba0fd40}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=file'],
'singleton': True,
'type': 'nsFileProtocolHandler',
'headers': ['mozilla/net/nsFileProtocolHandler.h'],
'init_method': 'Init',
},
{
'cid': '{25029490-f132-11d2-9588-00805f369f95}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=ftp'],
'singleton': True,
'type': 'nsFtpProtocolHandler',
'headers': ['/netwerk/protocol/ftp/nsFtpProtocolHandler.h'],
'init_method': 'Init',
},
{
'cid': '{4f47e42e-4d23-4dd3-bfda-eb29255e9ea3}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=http'],
'singleton': True,
'type': 'mozilla::net::nsHttpHandler',
},
{
'cid': '{dccbe7e4-7750-466b-a557-5ea36c8ff24e}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=https'],
'singleton': True,
'type': 'mozilla::net::nsHttpsHandler',
},
{
'cid': '{aea16cd0-f020-4138-b068-0716c4a15b5a}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-extension'],
'singleton': True,
'type': 'mozilla::net::ExtensionProtocolHandler',
'headers': ['mozilla/net/ExtensionProtocolHandler.h'],
'constructor': 'mozilla::net::ExtensionProtocolHandler::GetSingleton',
},
{
'cid': '{1423e739-782c-4081-b5d8-fe6fba68c0ef}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-safe-about'],
'singleton': True,
'type': 'mozilla::net::nsSafeAboutProtocolHandler',
'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
},
{
'cid': '{e64f152a-9f07-11d3-8cda-0060b0fc14a3}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=resource'],
'singleton': True,
'type': 'nsResProtocolHandler',
'headers': ['/netwerk/protocol/res/nsResProtocolHandler.h'],
'init_method': 'Init',
},
{
'cid': '{9c7ec5d1-23f9-11d5-aea8-8fcc0793e97f}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=view-source'],
'singleton': True,
'type': 'mozilla::net::nsViewSourceHandler',
'headers': ['/netwerk/protocol/viewsource/nsViewSourceHandler.h'],
},
{
'cid': '{dc01db59-a513-4c90-824b-085cce06c0aa}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=ws'],
'singleton': True,
'legacy_constructor': 'mozilla::net::WebSocketChannelConstructor',
},
{
'cid': '{dc01dbbb-a5bb-4cbb-82bb-085cce06c0bb}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=wss'],
'singleton': True,
'legacy_constructor': 'mozilla::net::WebSocketSSLChannelConstructor',
},
{
'cid': '{e7509b46-2eb2-410a-9d7c-c3ce73284d01}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=wyciwyg'],
'singleton': True,
'type': 'nsWyciwygProtocolHandler',
'headers': ['/netwerk/protocol/wyciwyg/nsWyciwygProtocolHandler.h'],
},
{
'cid': '{a181af0d-68b8-4308-94db-d4f859058215}',
'contract_ids': ['@mozilla.org/network/safe-file-output-stream;1'],
'type': 'nsAtomicFileOutputStream',
'headers': ['nsFileStreams.h'],
},
{
'cid': '{d6ef593d-a429-4b14-a887-d9e2f765d9ed}',
'contract_ids': ['@mozilla.org/network/serialization-helper;1'],
'type': 'nsSerializationHelper',
'headers': ['nsSerializationHelper.h'],
},
{
'cid': '{2ec62893-3b35-48fa-ab1d-5e68a9f45f08}',
'contract_ids': ['@mozilla.org/network/server-socket;1'],
'type': 'mozilla::net::nsServerSocket',
'headers': ['/netwerk/base/nsServerSocket.h'],
},
{
'cid': '{fb8cbf4e-4701-4ba1-b1d6-5388e041fb67}',
'contract_ids': ['@mozilla.org/network/simple-stream-listener;1'],
'type': 'mozilla::net::nsSimpleStreamListener',
'headers': ['/netwerk/base/nsSimpleStreamListener.h'],
},
{
'cid': '{2be14592-28d4-4a83-8fe9-08e778849f6e}',
'contract_ids': ['@mozilla.org/network/simple-uri-mutator;1'],
'type': 'mozilla::net::nsSimpleURI::Mutator',
'headers': ['nsSimpleURI.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{ad56b25f-e6bb-4db3-9f7b-5b7db33fd2b1}',
'contract_ids': ['@mozilla.org/network/socket-transport-service;1'],
'singleton': True,
'type': 'mozilla::net::nsSocketTransportService',
'headers': ['/netwerk/base/nsSocketTransportService2.h'],
'init_method': 'Init',
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{ce7d7da0-fb28-44a3-8c7b-000c165918f4}',
'contract_ids': ['@mozilla.org/network/standard-url-mutator;1'],
'type': 'mozilla::net::nsStandardURL::Mutator',
'headers': ['/netwerk/base/nsStandardURL.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{831f8f13-7aa8-485f-b02e-77c881cc5773}',
'contract_ids': ['@mozilla.org/network/stream-listener-tee;1'],
'type': 'mozilla::net::nsStreamListenerTee',
'headers': ['/netwerk/base/nsStreamListenerTee.h'],
},
{
'cid': '{5ba6d920-d4e9-11d3-a1a5-0050041caf44}',
'contract_ids': ['@mozilla.org/network/stream-loader;1'],
'legacy_constructor': 'mozilla::net::nsStreamLoader::Create',
'headers': ['/netwerk/base/nsStreamLoader.h'],
},
{
'cid': '{0885d4f8-f7b8-4cda-902e-94ba38bc256e}',
'contract_ids': ['@mozilla.org/network/stream-transport-service;1'],
'type': 'mozilla::net::nsStreamTransportService',
'headers': ['/netwerk/base/nsStreamTransportService.h'],
'init_method': 'Init',
},
{
'cid': '{4c39159c-cd90-4dd3-97a7-06af5e6d84c4}',
'contract_ids': ['@mozilla.org/network/throttlequeue;1'],
'type': 'mozilla::net::ThrottleQueue',
'headers': ['/netwerk/base/ThrottleQueue.h'],
},
{
'cid': '{1813cbb4-c98e-4622-8c7d-839167f3f272}',
'contract_ids': ['@mozilla.org/network/tls-server-socket;1'],
'type': 'mozilla::net::TLSServerSocket',
'headers': ['/netwerk/base/TLSServerSocket.h'],
},
{
'cid': '{c9f74572-7b8e-4fec-bb4a-03c0d3021bd6}',
'contract_ids': ['@mozilla.org/network/udp-socket;1'],
'type': 'mozilla::net::nsUDPSocket',
'headers': ['/netwerk/base/nsUDPSocket.h'],
},
{
'cid': '{ff41913b-546a-4bff-9201-dc9b2c032eba}',
'contract_ids': ['@mozilla.org/network/url-parser;1?auth=maybe'],
'type': 'nsStdURLParser',
'headers': ['nsURLParsers.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{78804a84-8173-42b6-bb94-789f0816a810}',
'contract_ids': ['@mozilla.org/network/url-parser;1?auth=no'],
'type': 'nsNoAuthURLParser',
'headers': ['nsURLParsers.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{275d800e-3f60-4896-adb7-d7f390ce0e42}',
'contract_ids': ['@mozilla.org/network/url-parser;1?auth=yes'],
'type': 'nsAuthURLParser',
'headers': ['nsURLParsers.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{892ffeb0-3f80-11d3-a16c-0050041caf44}',
'contract_ids': ['@mozilla.org/streamConverters;1'],
'legacy_constructor': 'CreateNewStreamConvServiceFactory',
},
{
'cid': '{cf0f71fd-fafd-4e2b-9fdc-134d972e16e2}',
'contract_ids': ['@mozilla.org/streamconv;1?from=application/http-index-format&to=text/html'],
'legacy_constructor': 'nsIndexedToHTML::Create',
'headers': ['/netwerk/streamconv/converters/nsIndexedToHTML.h'],
},
{
'cid': '{7d7008a0-c49a-11d3-9b22-0080c7cb1080}',
'contract_ids': ['@mozilla.org/streamconv;1?from=application/x-unknown-content-type&to=*/*'],
'legacy_constructor': 'CreateNewUnknownDecoderFactory',
},
{
'cid': '{66230b2b-17fa-4bd3-abf4-07986151022d}',
'contract_ids': [
'@mozilla.org/streamconv;1?from=br&to=uncompressed',
'@mozilla.org/streamconv;1?from=compress&to=uncompressed',
'@mozilla.org/streamconv;1?from=deflate&to=uncompressed',
'@mozilla.org/streamconv;1?from=gzip&to=uncompressed',
'@mozilla.org/streamconv;1?from=x-compress&to=uncompressed',
'@mozilla.org/streamconv;1?from=x-gzip&to=uncompressed',
],
'legacy_constructor': 'CreateNewHTTPCompressConvFactory',
},
{
'cid': '{7584ce90-5b25-11d3-a175-0050041caf44}',
'contract_ids': [
'@mozilla.org/streamconv;1?from=multipart/byteranges&to=*/*',
'@mozilla.org/streamconv;1?from=multipart/mixed&to=*/*',
'@mozilla.org/streamconv;1?from=multipart/x-mixed-replace&to=*/*',
],
'legacy_constructor': 'CreateNewMultiMixedConvFactory',
},
{
'cid': '{14c0e880-623e-11d3-a178-0050041caf44}',
'contract_ids': ['@mozilla.org/streamconv;1?from=text/ftp-dir&to=application/http-index-format'],
'legacy_constructor': 'CreateNewFTPDirListingConv',
},
{
'cid': '{77c0e42a-1dd2-11b2-8ebf-edc6606f2f4b}',
'contract_ids': ['@mozilla.org/txttohtmlconv;1'],
'legacy_constructor': 'CreateNewTXTToHTMLConvFactory',
},
{
'cid': '{2f277c00-0eaf-4ddb-b936-41326ba48aae}',
'contract_ids': [],
'type': 'mozilla::net::nsNestedAboutURI::Mutator',
'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
},
{
'cid': '{56388dad-287b-4240-a785-85c394012503}',
'contract_ids': [],
'type': 'mozilla::net::nsSimpleNestedURI::Mutator',
'headers': ['nsSimpleNestedURI.h'],
},
{
'cid': '{9c4e9d49-ce64-4ca3-acef-3075c5e5aba7}',
'contract_ids': [],
'type': 'mozilla::net::nsSimpleNestedURI::Mutator',
'headers': ['nsSimpleNestedURI.h'],
},
{
'cid': '{b0054ef3-b096-483d-8242-4ee36b7b2115}',
'contract_ids': [],
'type': 'mozilla::net::nsNestedAboutURI::Mutator',
'headers': ['/netwerk/protocol/about/nsAboutProtocolHandler.h'],
},
{
'cid': '{b3cfeb91-332a-46c9-ad97-93ff39841494}',
'contract_ids': [],
'type': 'mozilla::net::SubstitutingURL::Mutator',
'headers': ['mozilla/net/SubstitutingURL.h'],
},
{
'cid': '{de9472d0-8034-11d3-9399-00104ba0fd40}',
'contract_ids': [],
'type': 'mozilla::net::nsStandardURL::Mutator',
'headers': ['/netwerk/base/nsStandardURL.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
{
'cid': '{dea9657c-18cf-4984-bde9-ccef5d8ab473}',
'contract_ids': [],
'type': 'mozilla::net::SubstitutingURL::Mutator',
'headers': ['mozilla/net/SubstitutingURL.h'],
},
{
'cid': '{e0da1d70-2f7b-11d3-8cd0-0060b0fc14a3}',
'contract_ids': [],
'type': 'mozilla::net::nsSimpleURI::Mutator',
'headers': ['nsSimpleURI.h'],
'processes': ProcessSelector.ALLOW_IN_SOCKET_PROCESS,
},
]
if defined('NECKO_COOKIES'):
Classes += [
{
'cid': '{c375fa80-150f-11d6-a618-0010a401eb10}',
'contract_ids': [
'@mozilla.org/cookieService;1',
'@mozilla.org/cookiemanager;1',
],
'singleton': True,
'type': 'nsICookieService',
'constructor': 'nsCookieService::GetXPCOMSingleton',
'headers': ['/netwerk/cookie/nsCookieService.h'],
},
]
if defined('NECKO_WIFI'):
Classes += [
{
'cid': '{3ff8fb9f-ee63-48df-89f0-dace0242fd82}',
'contract_ids': ['@mozilla.org/wifi/monitor;1'],
'singleton': True,
'type': 'nsWifiMonitor',
'headers': ['/netwerk/wifi/nsWifiMonitor.h'],
},
]
if buildconfig.substs['OS_ARCH'] in ('WINNT', 'Darwin', 'Linux'):
Classes += [
{
'cid': '{296d0900-f8ef-4df0-9c35-db5862abc58d}',
'contract_ids': ['@mozilla.org/network-info-service;1'],
'type': 'mozilla::net::nsNetworkInfoService',
'headers': ['/netwerk/base/nsNetworkInfoService.h'],
'init_method': 'Init',
},
]
toolkit = buildconfig.substs['MOZ_WIDGET_TOOLKIT']
link_service = None
if toolkit == 'windows':
link_service = {
'type': 'nsNotifyAddrListener',
'headers': ['/netwerk/system/win32/nsNotifyAddrListener.h'],
'init_method': 'Init',
}
elif toolkit == 'cocoa':
link_service = {
'type': 'nsNetworkLinkService',
'headers': ['/netwerk/system/mac/nsNetworkLinkService.h'],
'init_method': 'Init',
}
elif toolkit == 'android':
link_service = {
'type': 'nsAndroidNetworkLinkService',
'headers': ['/netwerk/system/android/nsAndroidNetworkLinkService.h'],
}
elif buildconfig.substs['OS_ARCH'] == 'Linux':
link_service = {
'type': 'nsNotifyAddrListener',
'headers': ['/netwerk/system/linux/nsNotifyAddrListener_Linux.h'],
'init_method': 'Init',
}
if link_service:
Classes += [
dict({
'cid': '{75a500a2-0030-40f7-86f8-63f225b940ae}',
'contract_ids': ['@mozilla.org/network/network-link-service;1'],
'singleton': True,
}, **link_service)
]

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

@ -12,6 +12,10 @@ SOURCES += [
'nsNetModule.cpp',
]
XPCOM_MANIFESTS += [
'components.conf',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
@ -41,35 +45,6 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
'/netwerk/protocol/gio',
]
if CONFIG['OS_ARCH'] == 'WINNT':
LOCAL_INCLUDES += [
'/netwerk/system/win32',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
LOCAL_INCLUDES += [
'/netwerk/system/mac',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
LOCAL_INCLUDES += [
'/netwerk/system/android',
]
elif CONFIG['OS_ARCH'] == 'Linux':
LOCAL_INCLUDES += [
'/netwerk/system/linux',
]
if CONFIG['NECKO_COOKIES']:
LOCAL_INCLUDES += [
'/netwerk/cookie',
]
if CONFIG['NECKO_WIFI']:
LOCAL_INCLUDES += [
'/netwerk/wifi',
]
LOCAL_INCLUDES += [
'!/netwerk/dns',

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

@ -11,30 +11,20 @@
#include "nsCOMPtr.h"
#include "nsIClassInfoImpl.h"
#include "mozilla/Components.h"
#include "mozilla/ModuleUtils.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsICategoryManager.h"
#include "nscore.h"
#include "nsSimpleURI.h"
#include "nsSimpleNestedURI.h"
#include "nsLoadGroup.h"
#include "nsStreamLoader.h"
#include "nsIncrementalStreamLoader.h"
#include "nsFileStreams.h"
#include "nsBufferedStreams.h"
#include "nsMIMEInputStream.h"
#include "nsSOCKSSocketProvider.h"
#include "nsCacheService.h"
#include "nsDiskCacheDeviceSQL.h"
#include "nsApplicationCacheService.h"
#include "nsMimeTypes.h"
#include "nsDNSPrefetch.h"
#include "nsAboutProtocolHandler.h"
#include "nsXULAppAPI.h"
#include "nsCategoryCache.h"
#include "nsIContentSniffer.h"
#include "Predictor.h"
#include "nsStandardURL.h"
#include "nsIThreadPool.h"
#include "mozilla/net/BackgroundChannelRegistrar.h"
#include "mozilla/net/NeckoChild.h"
@ -47,185 +37,21 @@
# define BUILD_NETWORK_INFO_SERVICE 1
#endif
using namespace mozilla;
typedef nsCategoryCache<nsIContentSniffer> ContentSnifferCache;
ContentSnifferCache* gNetSniffers = nullptr;
ContentSnifferCache* gDataSniffers = nullptr;
///////////////////////////////////////////////////////////////////////////////
#include "nsIOService.h"
typedef mozilla::net::nsIOService nsIOService;
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIOService, nsIOService::GetInstance)
#include "nsDNSService2.h"
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIDNSService,
nsDNSService::GetXPCOMSingleton)
#include "nsProtocolProxyService.h"
typedef mozilla::net::nsProtocolProxyService nsProtocolProxyService;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsProtocolProxyService, Init)
#include "nsStreamTransportService.h"
typedef mozilla::net::nsStreamTransportService nsStreamTransportService;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStreamTransportService, Init)
#include "nsSocketTransportService2.h"
typedef mozilla::net::nsSocketTransportService nsSocketTransportService;
#undef LOG
#undef LOG_ENABLED
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSocketTransportService, Init)
#include "nsServerSocket.h"
typedef mozilla::net::nsServerSocket nsServerSocket;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsServerSocket)
#include "TLSServerSocket.h"
typedef mozilla::net::TLSServerSocket TLSServerSocket;
NS_GENERIC_FACTORY_CONSTRUCTOR(TLSServerSocket)
#include "nsUDPSocket.h"
typedef mozilla::net::nsUDPSocket nsUDPSocket;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUDPSocket)
#include "nsAsyncStreamCopier.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAsyncStreamCopier)
#include "nsInputStreamPump.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsInputStreamPump)
#include "nsInputStreamChannel.h"
typedef mozilla::net::nsInputStreamChannel nsInputStreamChannel;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsInputStreamChannel, Init)
#include "nsDownloader.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloader)
#include "BackgroundFileSaver.h"
namespace mozilla {
namespace net {
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverOutputStream, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(BackgroundFileSaverStreamListener, Init)
} // namespace net
} // namespace mozilla
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomicFileOutputStream)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeFileOutputStream)
#define static
typedef mozilla::net::nsLoadGroup nsLoadGroup;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLoadGroup, Init)
#include "ArrayBufferInputStream.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(ArrayBufferInputStream)
#include "nsEffectiveTLDService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEffectiveTLDService, Init)
#include "nsSerializationHelper.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSerializationHelper)
#include "CacheStorageService.h"
typedef mozilla::net::CacheStorageService CacheStorageService;
NS_GENERIC_FACTORY_CONSTRUCTOR(CacheStorageService)
#include "LoadContextInfo.h"
typedef mozilla::net::LoadContextInfoFactory LoadContextInfoFactory;
NS_GENERIC_FACTORY_CONSTRUCTOR(LoadContextInfoFactory)
///////////////////////////////////////////////////////////////////////////////
#include "mozilla/net/CaptivePortalService.h"
namespace mozilla {
namespace net {
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICaptivePortalService,
CaptivePortalService::GetSingleton)
} // namespace net
} // namespace mozilla
#include "mozilla/net/NetworkConnectivityService.h"
namespace mozilla {
namespace net {
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
nsINetworkConnectivityService, NetworkConnectivityService::GetSingleton)
} // namespace net
} // namespace mozilla
///////////////////////////////////////////////////////////////////////////////
extern nsresult net_NewIncrementalDownload(nsISupports*, const nsIID&, void**);
#define NS_INCREMENTALDOWNLOAD_CID \
{ /* a62af1ba-79b3-4896-8aaf-b148bfce4280 */ \
0xa62af1ba, 0x79b3, 0x4896, { \
0x8a, 0xaf, 0xb1, 0x48, 0xbf, 0xce, 0x42, 0x80 \
} \
}
///////////////////////////////////////////////////////////////////////////////
#include "nsMIMEHeaderParamImpl.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMIMEHeaderParamImpl)
///////////////////////////////////////////////////////////////////////////////
#include "nsSimpleStreamListener.h"
typedef mozilla::net::nsSimpleStreamListener nsSimpleStreamListener;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleStreamListener)
///////////////////////////////////////////////////////////////////////////////
#include "nsStreamListenerTee.h"
typedef mozilla::net::nsStreamListenerTee nsStreamListenerTee;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
///////////////////////////////////////////////////////////////////////////////
#ifdef NECKO_COOKIES
# include "nsCookieService.h"
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsICookieService,
nsCookieService::GetXPCOMSingleton)
#endif
///////////////////////////////////////////////////////////////////////////////
#ifdef NECKO_WIFI
# include "nsWifiMonitor.h"
# undef LOG
# undef LOG_ENABLED
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWifiMonitor)
#endif
#undef static
///////////////////////////////////////////////////////////////////////////////
// protocols
///////////////////////////////////////////////////////////////////////////////
// about:blank is mandatory
#include "nsAboutProtocolHandler.h"
#include "nsAboutBlank.h"
typedef mozilla::net::nsAboutProtocolHandler nsAboutProtocolHandler;
typedef mozilla::net::nsSafeAboutProtocolHandler nsSafeAboutProtocolHandler;
typedef mozilla::net::nsNestedAboutURI::Mutator nsNestedAboutURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafeAboutProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNestedAboutURIMutator)
// about
#include "nsAboutCache.h"
#include "nsAboutCacheEntry.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheService)
// file
#include "nsFileProtocolHandler.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFileProtocolHandler, Init)
// ftp
#include "nsFtpProtocolHandler.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
// http/https
#include "nsHttpHandler.h"
#include "Http2Compression.h"
@ -236,46 +62,27 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFtpProtocolHandler, Init)
#include "ThrottleQueue.h"
#undef LOG
#undef LOG_ENABLED
namespace mozilla {
namespace net {
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsHttpHandler,
nsHttpHandler::GetInstance)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpsHandler, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsHttpAuthManager, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHttpActivityDistributor)
NS_GENERIC_FACTORY_CONSTRUCTOR(ThrottleQueue)
} // namespace net
} // namespace mozilla
#include "mozilla/net/Dashboard.h"
namespace mozilla {
namespace net {
NS_GENERIC_FACTORY_CONSTRUCTOR(Dashboard)
} // namespace net
} // namespace mozilla
NS_IMPL_COMPONENT_FACTORY(net::nsHttpHandler) {
return net::nsHttpHandler::GetInstance().downcast<nsIHttpProtocolHandler>();
}
// resource
#include "nsResProtocolHandler.h"
#include "ExtensionProtocolHandler.h"
#include "SubstitutingProtocolHandler.h"
typedef mozilla::net::ExtensionProtocolHandler ExtensionProtocolHandler;
typedef mozilla::net::SubstitutingURL::Mutator SubstitutingURLMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsResProtocolHandler, Init)
NS_IMPL_COMPONENT_FACTORY(net::nsHttpsHandler) {
auto handler = MakeRefPtr<net::nsHttpsHandler>();
namespace mozilla {
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ExtensionProtocolHandler,
ExtensionProtocolHandler::GetSingleton)
NS_GENERIC_FACTORY_CONSTRUCTOR(SubstitutingURLMutator)
} // namespace mozilla
if (NS_FAILED(handler->Init())) {
return nullptr;
}
return handler.forget().downcast<nsIHttpProtocolHandler>();
}
#include "nsViewSourceHandler.h"
typedef mozilla::net::nsViewSourceHandler nsViewSourceHandler;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewSourceHandler)
#include "nsDataHandler.h"
#include "nsCacheService.h"
#include "nsWyciwygProtocolHandler.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWyciwygProtocolHandler)
nsresult nsCacheServiceConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult) {
return nsCacheService::Create(aOuter, aIID, aResult);
}
#include "WebSocketChannel.h"
#include "WebSocketChannelChild.h"
@ -292,23 +99,23 @@ static BaseWebSocketChannel* WebSocketChannelConstructor(bool aSecure) {
return new WebSocketChannel;
}
#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure) \
static nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
void** aResult) { \
nsresult rv; \
\
BaseWebSocketChannel* inst; \
\
*aResult = nullptr; \
if (nullptr != aOuter) { \
rv = NS_ERROR_NO_AGGREGATION; \
return rv; \
} \
inst = WebSocketChannelConstructor(secure); \
NS_ADDREF(inst); \
rv = inst->QueryInterface(aIID, aResult); \
NS_RELEASE(inst); \
return rv; \
#define WEB_SOCKET_HANDLER_CONSTRUCTOR(type, secure) \
nsresult type##Constructor(nsISupports* aOuter, REFNSIID aIID, \
void** aResult) { \
nsresult rv; \
\
BaseWebSocketChannel* inst; \
\
*aResult = nullptr; \
if (nullptr != aOuter) { \
rv = NS_ERROR_NO_AGGREGATION; \
return rv; \
} \
inst = WebSocketChannelConstructor(secure); \
NS_ADDREF(inst); \
rv = inst->QueryInterface(aIID, aResult); \
NS_RELEASE(inst); \
return rv; \
}
WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketChannel, false)
@ -319,42 +126,6 @@ WEB_SOCKET_HANDLER_CONSTRUCTOR(WebSocketSSLChannel, true)
///////////////////////////////////////////////////////////////////////////////
#include "nsURLParsers.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoAuthURLParser)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAuthURLParser)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStdURLParser)
#include "nsStandardURL.h"
typedef mozilla::net::nsStandardURL::Mutator nsStandardURLMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStandardURLMutator)
typedef mozilla::net::nsSimpleURI::Mutator nsSimpleURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleURIMutator)
typedef mozilla::net::nsSimpleNestedURI::Mutator nsSimpleNestedURIMutator;
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSimpleNestedURIMutator)
///////////////////////////////////////////////////////////////////////////////
#include "nsIDNService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init)
///////////////////////////////////////////////////////////////////////////////
#if defined(XP_WIN)
# include "nsNotifyAddrListener.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
#elif defined(MOZ_WIDGET_COCOA)
# include "nsNetworkLinkService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkLinkService, Init)
#elif defined(MOZ_WIDGET_ANDROID)
# include "nsAndroidNetworkLinkService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidNetworkLinkService)
#elif defined(XP_LINUX)
# include "nsNotifyAddrListener_Linux.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
#endif
///////////////////////////////////////////////////////////////////////////////
#include "nsFTPDirListingConv.h"
nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
@ -366,12 +137,6 @@ nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result);
///////////////////////////////////////////////////////////////////////////////
#ifdef BUILD_NETWORK_INFO_SERVICE
# include "nsNetworkInfoService.h"
typedef mozilla::net::nsNetworkInfoService nsNetworkInfoService;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkInfoService, Init)
#endif // BUILD_NETWORK_INFO_SERVICE
#include "nsIndexedToHTML.h"
nsresult NS_NewMultiMixedConv(nsMultiMixedConv** result);
@ -408,9 +173,8 @@ static const mozilla::Module::CategoryEntry kNeckoCategories[] = {
NS_BINARYDETECTOR_CATEGORYENTRY,
{nullptr}};
static nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
REFNSIID aIID,
void** aResult) {
nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
@ -432,8 +196,8 @@ static nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
return rv;
}
static nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
@ -455,8 +219,8 @@ static nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID,
return rv;
}
static nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter,
REFNSIID aIID, void** aResult) {
nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
@ -478,8 +242,8 @@ static nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter,
return rv;
}
static nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter,
REFNSIID aIID, void** aResult) {
nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
@ -501,9 +265,8 @@ static nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter,
return rv;
}
static nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
REFNSIID aIID,
void** aResult) {
nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
if (!aResult) {
return NS_ERROR_INVALID_POINTER;
}
@ -525,8 +288,8 @@ static nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
return rv;
}
static nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter,
REFNSIID aIID, void** aResult) {
nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult rv;
if (!aResult) {
@ -551,8 +314,8 @@ static nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter,
return rv;
}
static nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter,
REFNSIID aIID, void** aResult) {
nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, REFNSIID aIID,
void** aResult) {
nsresult rv;
if (!aResult) {
@ -579,13 +342,13 @@ static nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter,
// Module implementation for the net library
// Net module startup hook
static nsresult nsNetStartup() {
nsresult nsNetStartup() {
mozilla::net::nsStandardURL::InitGlobalObjects();
return NS_OK;
}
// Net module shutdown hook
static void nsNetShutdown() {
void nsNetShutdown() {
// Release the url parser that the stdurl is holding.
mozilla::net::nsStandardURL::ShutdownGlobalObjects();
@ -615,329 +378,13 @@ static void nsNetShutdown() {
gDataSniffers = nullptr;
}
NS_DEFINE_NAMED_CID(NS_IOSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_STREAMTRANSPORTSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SOCKETTRANSPORTSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SERVERSOCKET_CID);
NS_DEFINE_NAMED_CID(NS_TLSSERVERSOCKET_CID);
NS_DEFINE_NAMED_CID(NS_UDPSOCKET_CID);
NS_DEFINE_NAMED_CID(NS_DNSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_IDNSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_EFFECTIVETLDSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SIMPLEURI_CID);
NS_DEFINE_NAMED_CID(NS_SIMPLEURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_SIMPLENESTEDURI_CID);
NS_DEFINE_NAMED_CID(NS_SIMPLENESTEDURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_ASYNCSTREAMCOPIER_CID);
NS_DEFINE_NAMED_CID(NS_INPUTSTREAMPUMP_CID);
NS_DEFINE_NAMED_CID(NS_INPUTSTREAMCHANNEL_CID);
NS_DEFINE_NAMED_CID(NS_STREAMLOADER_CID);
NS_DEFINE_NAMED_CID(NS_INCREMENTALSTREAMLOADER_CID);
NS_DEFINE_NAMED_CID(NS_DOWNLOADER_CID);
NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_BACKGROUNDFILESAVERSTREAMLISTENER_CID);
NS_DEFINE_NAMED_CID(NS_SIMPLESTREAMLISTENER_CID);
NS_DEFINE_NAMED_CID(NS_STREAMLISTENERTEE_CID);
NS_DEFINE_NAMED_CID(NS_LOADGROUP_CID);
NS_DEFINE_NAMED_CID(NS_LOCALFILEINPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_LOCALFILEOUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_ATOMICLOCALFILEOUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_SAFELOCALFILEOUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_INCREMENTALDOWNLOAD_CID);
NS_DEFINE_NAMED_CID(NS_STDURLPARSER_CID);
NS_DEFINE_NAMED_CID(NS_NOAUTHURLPARSER_CID);
NS_DEFINE_NAMED_CID(NS_AUTHURLPARSER_CID);
NS_DEFINE_NAMED_CID(NS_STANDARDURL_CID);
NS_DEFINE_NAMED_CID(NS_STANDARDURLMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_ARRAYBUFFERINPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_BUFFEREDINPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_BUFFEREDOUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_MIMEINPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_PROTOCOLPROXYSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_STREAMCONVERTERSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_DASHBOARD_CID);
NS_DEFINE_NAMED_CID(NS_FTPDIRLISTINGCONVERTER_CID);
NS_DEFINE_NAMED_CID(NS_NSINDEXEDTOHTMLCONVERTER_CID);
NS_DEFINE_NAMED_CID(NS_MULTIMIXEDCONVERTER_CID);
NS_DEFINE_NAMED_CID(NS_UNKNOWNDECODER_CID);
NS_DEFINE_NAMED_CID(NS_BINARYDETECTOR_CID);
NS_DEFINE_NAMED_CID(NS_HTTPCOMPRESSCONVERTER_CID);
NS_DEFINE_NAMED_CID(MOZITXTTOHTMLCONV_CID);
NS_DEFINE_NAMED_CID(NS_MIMEHEADERPARAM_CID);
NS_DEFINE_NAMED_CID(NS_FILEPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPSPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPAUTHMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_HTTPACTIVITYDISTRIBUTOR_CID);
NS_DEFINE_NAMED_CID(NS_THROTTLEQUEUE_CID);
NS_DEFINE_NAMED_CID(NS_FTPPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_RESPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_EXTENSIONPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_SUBSTITUTINGURL_CID);
NS_DEFINE_NAMED_CID(NS_SUBSTITUTINGURLMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_ABOUTPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_SAFEABOUTPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_ABOUT_BLANK_MODULE_CID);
NS_DEFINE_NAMED_CID(NS_NESTEDABOUTURI_CID);
NS_DEFINE_NAMED_CID(NS_NESTEDABOUTURIMUTATOR_CID);
NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_MODULE_CID);
NS_DEFINE_NAMED_CID(NS_ABOUT_CACHE_ENTRY_MODULE_CID);
NS_DEFINE_NAMED_CID(NS_CACHESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHESERVICE_CID);
#ifdef NECKO_COOKIES
NS_DEFINE_NAMED_CID(NS_COOKIEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_COOKIESERVICE_CID);
#endif
#ifdef NECKO_WIFI
NS_DEFINE_NAMED_CID(NS_WIFI_MONITOR_COMPONENT_CID);
#endif
NS_DEFINE_NAMED_CID(NS_DATAPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_VIEWSOURCEHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_WYCIWYGPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_WEBSOCKETPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_WEBSOCKETSSLPROTOCOLHANDLER_CID);
#if defined(XP_WIN)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#elif defined(MOZ_WIDGET_COCOA)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#elif defined(MOZ_WIDGET_ANDROID)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#elif defined(XP_LINUX)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
NS_DEFINE_NAMED_CID(NS_CACHE_STORAGE_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_NSILOADCONTEXTINFOFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_NETWORKPREDICTOR_CID);
NS_DEFINE_NAMED_CID(NS_CAPTIVEPORTAL_CID);
NS_DEFINE_NAMED_CID(NS_NETWORKCONNECTIVITYSERVICE_CID);
#ifdef BUILD_NETWORK_INFO_SERVICE
NS_DEFINE_NAMED_CID(NETWORKINFOSERVICE_CID);
#endif // BUILD_NETWORK_INFO_SERVICE
static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
// clang-format off
{ &kNS_IOSERVICE_CID, false, nullptr, nsIOServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_STREAMTRANSPORTSERVICE_CID, false, nullptr, nsStreamTransportServiceConstructor },
{ &kNS_SOCKETTRANSPORTSERVICE_CID, false, nullptr, nsSocketTransportServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_SERVERSOCKET_CID, false, nullptr, nsServerSocketConstructor },
{ &kNS_TLSSERVERSOCKET_CID, false, nullptr, TLSServerSocketConstructor },
{ &kNS_UDPSOCKET_CID, false, nullptr, nsUDPSocketConstructor },
{ &kNS_DNSSERVICE_CID, false, nullptr, nsIDNSServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_IDNSERVICE_CID, false, nullptr, nsIDNServiceConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_EFFECTIVETLDSERVICE_CID, false, nullptr, nsEffectiveTLDServiceConstructor },
{ &kNS_SIMPLEURI_CID, false, nullptr, nsSimpleURIMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS }, // do_CreateInstance returns mutator
{ &kNS_SIMPLEURIMUTATOR_CID, false, nullptr, nsSimpleURIMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_SIMPLENESTEDURI_CID, false, nullptr, nsSimpleNestedURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_SIMPLENESTEDURIMUTATOR_CID, false, nullptr, nsSimpleNestedURIMutatorConstructor },
{ &kNS_ASYNCSTREAMCOPIER_CID, false, nullptr, nsAsyncStreamCopierConstructor },
{ &kNS_INPUTSTREAMPUMP_CID, false, nullptr, nsInputStreamPumpConstructor },
{ &kNS_INPUTSTREAMCHANNEL_CID, false, nullptr, nsInputStreamChannelConstructor },
{ &kNS_STREAMLOADER_CID, false, nullptr, mozilla::net::nsStreamLoader::Create },
{ &kNS_INCREMENTALSTREAMLOADER_CID, false, nullptr, nsIncrementalStreamLoader::Create },
{ &kNS_DOWNLOADER_CID, false, nullptr, nsDownloaderConstructor },
{ &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID, false, nullptr,
mozilla::net::BackgroundFileSaverOutputStreamConstructor },
{ &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID, false, nullptr,
mozilla::net::BackgroundFileSaverStreamListenerConstructor },
{ &kNS_SIMPLESTREAMLISTENER_CID, false, nullptr, nsSimpleStreamListenerConstructor },
{ &kNS_STREAMLISTENERTEE_CID, false, nullptr, nsStreamListenerTeeConstructor },
{ &kNS_LOADGROUP_CID, false, nullptr, nsLoadGroupConstructor },
{ &kNS_LOCALFILEINPUTSTREAM_CID, false, nullptr, nsFileInputStream::Create },
{ &kNS_LOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsFileOutputStream::Create },
{ &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsAtomicFileOutputStreamConstructor },
{ &kNS_SAFELOCALFILEOUTPUTSTREAM_CID, false, nullptr, nsSafeFileOutputStreamConstructor },
{ &kNS_INCREMENTALDOWNLOAD_CID, false, nullptr, net_NewIncrementalDownload },
{ &kNS_STDURLPARSER_CID, false, nullptr, nsStdURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_NOAUTHURLPARSER_CID, false, nullptr, nsNoAuthURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_AUTHURLPARSER_CID, false, nullptr, nsAuthURLParserConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_STANDARDURL_CID, false, nullptr, nsStandardURLMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS }, // do_CreateInstance returns mutator
{ &kNS_STANDARDURLMUTATOR_CID, false, nullptr, nsStandardURLMutatorConstructor, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ &kNS_ARRAYBUFFERINPUTSTREAM_CID, false, nullptr, ArrayBufferInputStreamConstructor },
{ &kNS_BUFFEREDINPUTSTREAM_CID, false, nullptr, nsBufferedInputStream::Create },
{ &kNS_BUFFEREDOUTPUTSTREAM_CID, false, nullptr, nsBufferedOutputStream::Create },
{ &kNS_MIMEINPUTSTREAM_CID, false, nullptr, nsMIMEInputStreamConstructor },
{ &kNS_PROTOCOLPROXYSERVICE_CID, true, nullptr, nsProtocolProxyServiceConstructor },
{ &kNS_STREAMCONVERTERSERVICE_CID, false, nullptr, CreateNewStreamConvServiceFactory },
{ &kNS_DASHBOARD_CID, false, nullptr, mozilla::net::DashboardConstructor },
{ &kNS_FTPDIRLISTINGCONVERTER_CID, false, nullptr, CreateNewFTPDirListingConv },
{ &kNS_NSINDEXEDTOHTMLCONVERTER_CID, false, nullptr, nsIndexedToHTML::Create },
{ &kNS_MULTIMIXEDCONVERTER_CID, false, nullptr, CreateNewMultiMixedConvFactory },
{ &kNS_UNKNOWNDECODER_CID, false, nullptr, CreateNewUnknownDecoderFactory },
{ &kNS_BINARYDETECTOR_CID, false, nullptr, CreateNewBinaryDetectorFactory },
{ &kNS_HTTPCOMPRESSCONVERTER_CID, false, nullptr, CreateNewHTTPCompressConvFactory },
{ &kMOZITXTTOHTMLCONV_CID, false, nullptr, CreateNewTXTToHTMLConvFactory },
{ &kNS_MIMEHEADERPARAM_CID, false, nullptr, nsMIMEHeaderParamImplConstructor },
{ &kNS_FILEPROTOCOLHANDLER_CID, false, nullptr, nsFileProtocolHandlerConstructor },
{ &kNS_HTTPPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpHandlerConstructor },
{ &kNS_HTTPSPROTOCOLHANDLER_CID, false, nullptr, mozilla::net::nsHttpsHandlerConstructor },
{ &kNS_HTTPAUTHMANAGER_CID, false, nullptr, mozilla::net::nsHttpAuthManagerConstructor },
{ &kNS_HTTPACTIVITYDISTRIBUTOR_CID, false, nullptr, mozilla::net::nsHttpActivityDistributorConstructor },
{ &kNS_THROTTLEQUEUE_CID, false, nullptr, mozilla::net::ThrottleQueueConstructor },
{ &kNS_FTPPROTOCOLHANDLER_CID, false, nullptr, nsFtpProtocolHandlerConstructor },
{ &kNS_RESPROTOCOLHANDLER_CID, false, nullptr, nsResProtocolHandlerConstructor },
{ &kNS_EXTENSIONPROTOCOLHANDLER_CID, false, nullptr, mozilla::ExtensionProtocolHandlerConstructor },
{ &kNS_SUBSTITUTINGURL_CID, false, nullptr, mozilla::SubstitutingURLMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_SUBSTITUTINGURLMUTATOR_CID, false, nullptr, mozilla::SubstitutingURLMutatorConstructor },
{ &kNS_ABOUTPROTOCOLHANDLER_CID, false, nullptr, nsAboutProtocolHandlerConstructor },
{ &kNS_SAFEABOUTPROTOCOLHANDLER_CID, false, nullptr, nsSafeAboutProtocolHandlerConstructor },
{ &kNS_ABOUT_BLANK_MODULE_CID, false, nullptr, nsAboutBlank::Create },
{ &kNS_NESTEDABOUTURI_CID, false, nullptr, nsNestedAboutURIMutatorConstructor }, // do_CreateInstance returns mutator
{ &kNS_NESTEDABOUTURIMUTATOR_CID, false, nullptr, nsNestedAboutURIMutatorConstructor },
{ &kNS_ABOUT_CACHE_MODULE_CID, false, nullptr, nsAboutCache::Create },
{ &kNS_ABOUT_CACHE_ENTRY_MODULE_CID, false, nullptr, nsAboutCacheEntryConstructor },
{ &kNS_CACHESERVICE_CID, false, nullptr, nsCacheService::Create },
{ &kNS_APPLICATIONCACHESERVICE_CID, false, nullptr, nsApplicationCacheServiceConstructor },
#ifdef NECKO_COOKIES
{ &kNS_COOKIEMANAGER_CID, false, nullptr, nsICookieServiceConstructor },
{ &kNS_COOKIESERVICE_CID, false, nullptr, nsICookieServiceConstructor },
#endif
#ifdef NECKO_WIFI
{ &kNS_WIFI_MONITOR_COMPONENT_CID, false, nullptr, nsWifiMonitorConstructor },
#endif
{ &kNS_DATAPROTOCOLHANDLER_CID, false, nullptr, nsDataHandler::Create },
{ &kNS_VIEWSOURCEHANDLER_CID, false, nullptr, nsViewSourceHandlerConstructor },
{ &kNS_WYCIWYGPROTOCOLHANDLER_CID, false, nullptr, nsWyciwygProtocolHandlerConstructor },
{ &kNS_WEBSOCKETPROTOCOLHANDLER_CID, false, nullptr,
mozilla::net::WebSocketChannelConstructor },
{ &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID, false, nullptr,
mozilla::net::WebSocketSSLChannelConstructor },
#if defined(XP_WIN)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
#elif defined(MOZ_WIDGET_COCOA)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNetworkLinkServiceConstructor },
#elif defined(MOZ_WIDGET_ANDROID)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsAndroidNetworkLinkServiceConstructor },
#elif defined(XP_LINUX)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
#endif
{ &kNS_SERIALIZATION_HELPER_CID, false, nullptr, nsSerializationHelperConstructor },
{ &kNS_CACHE_STORAGE_SERVICE_CID, false, nullptr, CacheStorageServiceConstructor },
{ &kNS_NSILOADCONTEXTINFOFACTORY_CID, false, nullptr, LoadContextInfoFactoryConstructor },
{ &kNS_NETWORKPREDICTOR_CID, false, nullptr, mozilla::net::Predictor::Create },
{ &kNS_CAPTIVEPORTAL_CID, false, nullptr, mozilla::net::nsICaptivePortalServiceConstructor },
{ &kNS_NETWORKCONNECTIVITYSERVICE_CID, false, nullptr, mozilla::net::nsINetworkConnectivityServiceConstructor },
#ifdef BUILD_NETWORK_INFO_SERVICE
{ &kNETWORKINFOSERVICE_CID, false, nullptr, nsNetworkInfoServiceConstructor },
#endif
{ nullptr }
// clang-format on
};
static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
// clang-format off
{ NS_IOSERVICE_CONTRACTID, &kNS_IOSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_NETUTIL_CONTRACTID, &kNS_IOSERVICE_CID },
{ NS_STREAMTRANSPORTSERVICE_CONTRACTID, &kNS_STREAMTRANSPORTSERVICE_CID },
{ NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &kNS_SOCKETTRANSPORTSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_SERVERSOCKET_CONTRACTID, &kNS_SERVERSOCKET_CID },
{ NS_TLSSERVERSOCKET_CONTRACTID, &kNS_TLSSERVERSOCKET_CID },
{ NS_UDPSOCKET_CONTRACTID, &kNS_UDPSOCKET_CID },
{ NS_DNSSERVICE_CONTRACTID, &kNS_DNSSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_IDNSERVICE_CONTRACTID, &kNS_IDNSERVICE_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_EFFECTIVETLDSERVICE_CONTRACTID, &kNS_EFFECTIVETLDSERVICE_CID },
{ NS_SIMPLEURIMUTATOR_CONTRACTID, &kNS_SIMPLEURIMUTATOR_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_ASYNCSTREAMCOPIER_CONTRACTID, &kNS_ASYNCSTREAMCOPIER_CID },
{ NS_INPUTSTREAMPUMP_CONTRACTID, &kNS_INPUTSTREAMPUMP_CID },
{ NS_INPUTSTREAMCHANNEL_CONTRACTID, &kNS_INPUTSTREAMCHANNEL_CID },
{ NS_STREAMLOADER_CONTRACTID, &kNS_STREAMLOADER_CID },
{ NS_INCREMENTALSTREAMLOADER_CONTRACTID, &kNS_INCREMENTALSTREAMLOADER_CID },
{ NS_DOWNLOADER_CONTRACTID, &kNS_DOWNLOADER_CID },
{ NS_BACKGROUNDFILESAVEROUTPUTSTREAM_CONTRACTID, &kNS_BACKGROUNDFILESAVEROUTPUTSTREAM_CID },
{ NS_BACKGROUNDFILESAVERSTREAMLISTENER_CONTRACTID, &kNS_BACKGROUNDFILESAVERSTREAMLISTENER_CID },
{ NS_SIMPLESTREAMLISTENER_CONTRACTID, &kNS_SIMPLESTREAMLISTENER_CID },
{ NS_STREAMLISTENERTEE_CONTRACTID, &kNS_STREAMLISTENERTEE_CID },
{ NS_LOADGROUP_CONTRACTID, &kNS_LOADGROUP_CID },
{ NS_LOCALFILEINPUTSTREAM_CONTRACTID, &kNS_LOCALFILEINPUTSTREAM_CID },
{ NS_LOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_LOCALFILEOUTPUTSTREAM_CID },
{ NS_ATOMICLOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_ATOMICLOCALFILEOUTPUTSTREAM_CID },
{ NS_SAFELOCALFILEOUTPUTSTREAM_CONTRACTID, &kNS_SAFELOCALFILEOUTPUTSTREAM_CID },
{ NS_INCREMENTALDOWNLOAD_CONTRACTID, &kNS_INCREMENTALDOWNLOAD_CID },
{ NS_STDURLPARSER_CONTRACTID, &kNS_STDURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_NOAUTHURLPARSER_CONTRACTID, &kNS_NOAUTHURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_AUTHURLPARSER_CONTRACTID, &kNS_AUTHURLPARSER_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_STANDARDURLMUTATOR_CONTRACTID, &kNS_STANDARDURLMUTATOR_CID, mozilla::Module::ALLOW_IN_SOCKET_PROCESS },
{ NS_ARRAYBUFFERINPUTSTREAM_CONTRACTID, &kNS_ARRAYBUFFERINPUTSTREAM_CID },
{ NS_BUFFEREDINPUTSTREAM_CONTRACTID, &kNS_BUFFEREDINPUTSTREAM_CID },
{ NS_BUFFEREDOUTPUTSTREAM_CONTRACTID, &kNS_BUFFEREDOUTPUTSTREAM_CID },
{ NS_MIMEINPUTSTREAM_CONTRACTID, &kNS_MIMEINPUTSTREAM_CID },
{ NS_PROTOCOLPROXYSERVICE_CONTRACTID, &kNS_PROTOCOLPROXYSERVICE_CID },
{ NS_STREAMCONVERTERSERVICE_CONTRACTID, &kNS_STREAMCONVERTERSERVICE_CID },
{ NS_DASHBOARD_CONTRACTID, &kNS_DASHBOARD_CID },
{ NS_ISTREAMCONVERTER_KEY FTP_TO_INDEX, &kNS_FTPDIRLISTINGCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY INDEX_TO_HTML, &kNS_NSINDEXEDTOHTMLCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY MULTI_MIXED_X, &kNS_MULTIMIXEDCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY MULTI_BYTERANGES, &kNS_MULTIMIXEDCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY MULTI_MIXED, &kNS_MULTIMIXEDCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY UNKNOWN_CONTENT, &kNS_UNKNOWNDECODER_CID },
{ NS_BINARYDETECTOR_CONTRACTID, &kNS_BINARYDETECTOR_CID },
{ NS_ISTREAMCONVERTER_KEY GZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY XGZIP_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY BROTLI_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY COMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY XCOMPRESS_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ NS_ISTREAMCONVERTER_KEY DEFLATE_TO_UNCOMPRESSED, &kNS_HTTPCOMPRESSCONVERTER_CID },
{ MOZ_TXTTOHTMLCONV_CONTRACTID, &kMOZITXTTOHTMLCONV_CID },
{ NS_MIMEHEADERPARAM_CONTRACTID, &kNS_MIMEHEADERPARAM_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "file", &kNS_FILEPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &kNS_HTTPPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "https", &kNS_HTTPSPROTOCOLHANDLER_CID },
{ NS_HTTPAUTHMANAGER_CONTRACTID, &kNS_HTTPAUTHMANAGER_CID },
{ NS_HTTPACTIVITYDISTRIBUTOR_CONTRACTID, &kNS_HTTPACTIVITYDISTRIBUTOR_CID },
{ NS_THROTTLEQUEUE_CONTRACTID, &kNS_THROTTLEQUEUE_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ftp", &kNS_FTPPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "resource", &kNS_RESPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-extension", &kNS_EXTENSIONPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "about", &kNS_ABOUTPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-safe-about", &kNS_SAFEABOUTPROTOCOLHANDLER_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "blank", &kNS_ABOUT_BLANK_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache", &kNS_ABOUT_CACHE_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "cache-entry", &kNS_ABOUT_CACHE_ENTRY_MODULE_CID },
{ NS_CACHESERVICE_CONTRACTID, &kNS_CACHESERVICE_CID },
{ NS_APPLICATIONCACHESERVICE_CONTRACTID, &kNS_APPLICATIONCACHESERVICE_CID },
#ifdef NECKO_COOKIES
{ NS_COOKIEMANAGER_CONTRACTID, &kNS_COOKIEMANAGER_CID },
{ NS_COOKIESERVICE_CONTRACTID, &kNS_COOKIESERVICE_CID },
#endif
#ifdef NECKO_WIFI
{ NS_WIFI_MONITOR_CONTRACTID, &kNS_WIFI_MONITOR_COMPONENT_CID },
#endif
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "data", &kNS_DATAPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "view-source", &kNS_VIEWSOURCEHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wyciwyg", &kNS_WYCIWYGPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ws", &kNS_WEBSOCKETPROTOCOLHANDLER_CID },
{ NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wss", &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID },
#if defined(XP_WIN)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#elif defined(MOZ_WIDGET_COCOA)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#elif defined(MOZ_WIDGET_ANDROID)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#elif defined(XP_LINUX)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#endif
{ NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
{ NS_CACHE_STORAGE_SERVICE_CONTRACTID, &kNS_CACHE_STORAGE_SERVICE_CID },
{ NS_CACHE_STORAGE_SERVICE_CONTRACTID2, &kNS_CACHE_STORAGE_SERVICE_CID },
{ NS_NSILOADCONTEXTINFOFACTORY_CONTRACTID, &kNS_NSILOADCONTEXTINFOFACTORY_CID },
{ NS_NETWORKPREDICTOR_CONTRACTID, &kNS_NETWORKPREDICTOR_CID },
{ NS_CAPTIVEPORTAL_CONTRACTID, &kNS_CAPTIVEPORTAL_CID },
{ NS_NETWORKCONNECTIVITYSERVICE_CONTRACTID, &kNS_NETWORKCONNECTIVITYSERVICE_CID },
#ifdef BUILD_NETWORK_INFO_SERVICE
{ NETWORKINFOSERVICE_CONTRACT_ID, &kNETWORKINFOSERVICE_CID },
#endif
{ nullptr }
// clang-format on
};
static const mozilla::Module kNeckoModule = {
mozilla::Module::kVersion,
kNeckoCIDs,
kNeckoContracts,
kNeckoCategories,
nullptr,
nsNetStartup,
nsNetShutdown,
mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
static const mozilla::Module kNeckoModule = {mozilla::Module::kVersion,
nullptr,
nullptr,
kNeckoCategories,
nullptr,
nullptr,
nullptr,
mozilla::Module::ALLOW_IN_SOCKET_PROCESS};
NSMODULE_DEFN(necko) = &kNeckoModule;

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

@ -0,0 +1,47 @@
/* -*- Mode: C++; 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/. */
#ifndef nsNetModule_h
#define nsNetModule_h
#include "nsID.h"
class nsISupports;
nsresult nsNetStartup();
void nsNetShutdown();
nsresult CreateNewStreamConvServiceFactory(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult CreateNewFTPDirListingConv(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewMultiMixedConvFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewTXTToHTMLConvFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewHTTPCompressConvFactory(nsISupports* aOuter,
const nsIID& aIID, void** aResult);
nsresult CreateNewUnknownDecoderFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult CreateNewBinaryDetectorFactory(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult nsLoadGroupConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult nsCacheServiceConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
extern nsresult net_NewIncrementalDownload(nsISupports*, const nsIID&, void**);
namespace mozilla {
namespace net {
nsresult WebSocketChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
nsresult WebSocketSSLChannelConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aResult);
}
}
#endif

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

@ -39,6 +39,7 @@
#include "nsIOutputStream.h"
#include "nsIStreamConverterService.h"
#include "nsNetUtil.h"
#include "nsURLHelper.h"
#include "prio.h"
#include "SimpleChannel.h"

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

@ -9,6 +9,7 @@
#include "mozilla/Unused.h"
#include "SubstitutingProtocolHandler.h"
#include "SubstitutingURL.h"
#include "nsIChannel.h"
#include "nsIIOService.h"
#include "nsIFile.h"

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

@ -9,10 +9,8 @@
#include "nsISubstitutingProtocolHandler.h"
#include "nsIOService.h"
#include "nsISubstitutionObserver.h"
#include "nsDataHashtable.h"
#include "nsStandardURL.h"
#include "mozilla/chrome/RegistryMessageUtils.h"
#include "mozilla/Maybe.h"
@ -117,49 +115,6 @@ class SubstitutingProtocolHandler {
bool mEnforceFileOrJar;
};
// SubstitutingURL : overrides nsStandardURL::GetFile to provide nsIFile
// resolution
class SubstitutingURL : public nsStandardURL {
public:
virtual nsStandardURL* StartClone() override;
virtual MOZ_MUST_USE nsresult EnsureFile() override;
NS_IMETHOD GetClassIDNoAlloc(nsCID* aCID) override;
private:
explicit SubstitutingURL() : nsStandardURL(true) {}
explicit SubstitutingURL(bool aSupportsFileURL) : nsStandardURL(true) {
MOZ_ASSERT(aSupportsFileURL);
}
virtual nsresult Clone(nsIURI** aURI) override {
return nsStandardURL::Clone(aURI);
}
public:
class Mutator : public TemplatedMutator<SubstitutingURL> {
NS_DECL_ISUPPORTS
public:
explicit Mutator() = default;
private:
virtual ~Mutator() = default;
SubstitutingURL* Create() override { return new SubstitutingURL(); }
};
NS_IMETHOD Mutate(nsIURIMutator** aMutator) override {
RefPtr<SubstitutingURL::Mutator> mutator = new SubstitutingURL::Mutator();
nsresult rv = mutator->InitFromURI(this);
if (NS_FAILED(rv)) {
return rv;
}
mutator.forget(aMutator);
return NS_OK;
}
friend BaseURIMutator<SubstitutingURL>;
friend TemplatedMutator<SubstitutingURL>;
};
} // namespace net
} // namespace mozilla

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

@ -0,0 +1,63 @@
/* -*- 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 SubstitutingURL_h
#define SubstitutingURL_h
#include "nsStandardURL.h"
class nsIIOService;
namespace mozilla {
namespace net {
// SubstitutingURL : overrides nsStandardURL::GetFile to provide nsIFile
// resolution
class SubstitutingURL : public nsStandardURL {
public:
virtual nsStandardURL* StartClone() override;
virtual MOZ_MUST_USE nsresult EnsureFile() override;
NS_IMETHOD GetClassIDNoAlloc(nsCID* aCID) override;
private:
explicit SubstitutingURL() : nsStandardURL(true) {}
explicit SubstitutingURL(bool aSupportsFileURL) : nsStandardURL(true) {
MOZ_ASSERT(aSupportsFileURL);
}
virtual nsresult Clone(nsIURI** aURI) override {
return nsStandardURL::Clone(aURI);
}
public:
class Mutator : public TemplatedMutator<SubstitutingURL> {
NS_DECL_ISUPPORTS
public:
explicit Mutator() = default;
private:
virtual ~Mutator() = default;
SubstitutingURL* Create() override { return new SubstitutingURL(); }
};
NS_IMETHOD Mutate(nsIURIMutator** aMutator) override {
RefPtr<SubstitutingURL::Mutator> mutator = new SubstitutingURL::Mutator();
nsresult rv = mutator->InitFromURI(this);
if (NS_FAILED(rv)) {
return rv;
}
mutator.forget(aMutator);
return NS_OK;
}
friend BaseURIMutator<SubstitutingURL>;
friend TemplatedMutator<SubstitutingURL>;
};
} // namespace net
} // namespace mozilla
#endif /* SubstitutingURL_h */

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

@ -15,6 +15,7 @@ XPIDL_MODULE = 'necko_res'
EXPORTS.mozilla.net += [
'ExtensionProtocolHandler.h',
'SubstitutingProtocolHandler.h',
'SubstitutingURL.h',
]
UNIFIED_SOURCES += [

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

@ -11,7 +11,6 @@
#include "nsIResProtocolHandler.h"
#include "nsInterfaceHashtable.h"
#include "nsWeakReference.h"
#include "nsStandardURL.h"
class nsISubstitutionObserver;

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

@ -127,13 +127,13 @@ class TestPACMan : public ::testing::Test {
virtual void SetUp() {
ASSERT_EQ(NS_OK, GetNetworkProxyType(&originalNetworkProxyTypePref));
nsFactoryEntry* factoryEntry =
nsComponentManagerImpl::gComponentManager->GetFactoryEntry(
kNS_TESTDHCPCLIENTSERVICE_CID);
if (factoryEntry) {
nsresult rv =
nsComponentManagerImpl::gComponentManager->UnregisterFactory(
kNS_TESTDHCPCLIENTSERVICE_CID, factoryEntry->mFactory);
nsCOMPtr<nsIFactory> factory;
nsresult rv = nsComponentManagerImpl::gComponentManager->GetClassObject(
kNS_TESTDHCPCLIENTSERVICE_CID, NS_GET_IID(nsIFactory),
getter_AddRefs(factory));
if (NS_SUCCEEDED(rv) && factory) {
rv = nsComponentManagerImpl::gComponentManager->UnregisterFactory(
kNS_TESTDHCPCLIENTSERVICE_CID, factory);
ASSERT_EQ(NS_OK, rv);
}
nsComponentManagerImpl::gComponentManager->RegisterModule(

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

@ -36,4 +36,4 @@ FINAL_LIBRARY = 'xul-gtest'
LOCAL_INCLUDES += [
'!/xpcom',
'/xpcom/components'
]
]

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

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Classifier.h"
#include "mozilla/Components.h"
#include "mozilla/ErrorNames.h"
#include "mozilla/net/AsyncUrlChannelClassifier.h"
#include "mozilla/net/UrlClassifierCommon.h"
@ -92,7 +93,7 @@ class URIData {
data->mURI = aURI;
nsCOMPtr<nsIUrlClassifierUtils> utilsService =
do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);
components::UrlClassifierUtils::Service();
if (NS_WARN_IF(!utilsService)) {
return NS_ERROR_FAILURE;
}

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

@ -24,6 +24,7 @@
#include "nsIUrlClassifierFeature.h"
#include "nsPrintfCString.h"
#include "mozilla/Components.h"
#include "mozilla/ErrorNames.h"
#include "mozilla/Logging.h"
#include "mozilla/Preferences.h"
@ -369,7 +370,7 @@ nsresult nsChannelClassifier::SendThreatHitReport(nsIChannel* aChannel,
}
nsCOMPtr<nsIURIClassifier> uriClassifier =
do_GetService(NS_URLCLASSIFIERDBSERVICE_CONTRACTID);
components::UrlClassifierDB::Service();
if (!uriClassifier) {
return NS_ERROR_UNEXPECTED;
}

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

@ -42,6 +42,7 @@ from mozbuild.frontend.data import (
StaticLibrary,
UnifiedSources,
XPIDLModule,
XPCOMComponentManifests,
WebIDLCollection,
)
from mozbuild.jar import (
@ -148,6 +149,9 @@ class CommonBackend(BuildBackend):
list(sorted(obj.all_regular_sources())),
obj.unified_source_mapping)
elif isinstance(obj, XPCOMComponentManifests):
self._handle_xpcom_collection(obj)
elif isinstance(obj, UnifiedSources):
# Unified sources aren't relevant to artifact builds.
if self.environment.is_artifact_build:
@ -369,6 +373,20 @@ class CommonBackend(BuildBackend):
manager.expected_build_output_files(),
manager.GLOBAL_DEFINE_FILES)
def _handle_xpcom_collection(self, manifests):
components_dir = mozpath.join(manifests.topobjdir,
'xpcom', 'components')
# The code generators read their configuration from this file, so it
# needs to be written early.
o = dict(
manifests=sorted(manifests.all_sources()),
)
conf_file = mozpath.join(components_dir, 'manifest-lists.json')
with self._write_file(conf_file) as fh:
json.dump(o, fh, sort_keys=True, indent=2)
def _write_unified_file(self, unified_file, source_filenames,
output_directory, poison_windows_h=False):
with self._write_file(mozpath.join(output_directory, unified_file)) as f:

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

@ -1766,6 +1766,13 @@ VARIABLES = {
as ``MODULE``.
"""),
'XPCOM_MANIFESTS': (ContextDerivedTypedList(SourcePath, StrictOrderingOnAppendList), list,
"""XPCOM Component Manifest Files.
This is a list of files that define XPCOM components to be added
to the component registry.
"""),
'PREPROCESSED_IPDL_SOURCES': (StrictOrderingOnAppendList, list,
"""Preprocessed IPDL source files.

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

@ -373,6 +373,20 @@ class IPDLCollection(ContextDerived):
return sorted(set(p for p, _ in self.unified_source_mapping))
class XPCOMComponentManifests(ContextDerived):
"""Collects XPCOM manifest files during the build."""
def __init__(self, context):
ContextDerived.__init__(self, context)
self.manifests = set()
def all_sources(self):
return self.manifests
def all_source_files(self):
return []
class LinkageWrongKindError(Exception):
"""Error thrown when trying to link objects of the wrong kind"""

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

@ -72,6 +72,7 @@ from .data import (
TestManifest,
UnifiedSources,
VariablePassthru,
XPCOMComponentManifests,
XPIDLModule,
)
from mozpack.chrome.manifest import (
@ -213,12 +214,17 @@ class TreeMetadataEmitter(LoggingMixin):
('IPDL_SOURCES', lambda c: c.sources),
('PREPROCESSED_IPDL_SOURCES', lambda c: c.preprocessed_sources),
]
xpcom_attrs = [
('XPCOM_MANIFESTS', lambda c: c.manifests),
]
idl_sources = {}
for root, cls, attrs in ((self.config.substs.get('WEBIDL_ROOT'),
WebIDLCollection, webidl_attrs),
(self.config.substs.get('IPDL_ROOT'),
IPDLCollection, ipdl_attrs)):
IPDLCollection, ipdl_attrs),
(self.config.substs.get('XPCOM_ROOT'),
XPCOMComponentManifests, xpcom_attrs)):
if root:
collection = cls(contexts[root])
for var, src_getter in attrs:
@ -1164,6 +1170,7 @@ class TreeMetadataEmitter(LoggingMixin):
'WEBIDL_FILES',
'IPDL_SOURCES',
'PREPROCESSED_IPDL_SOURCES',
'XPCOM_MANIFESTS',
)
for context_var in idl_vars:
for name in context.get(context_var, []):

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

@ -0,0 +1,187 @@
# -*- 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/.
Headers = [
'/security/manager/ssl/nsNSSModule.h',
]
Classes = [
{
'cid': '{4cb64dfd-ca98-4e24-befd-0d9285a33bcb}',
'contract_ids': ['@mozilla.org/psm;1'],
'type': 'nsNSSComponent',
'headers': ['nsNSSComponent.h'],
'init_method': 'Init',
},
{
'cid': '{c94f4a30-64d7-11d4-9960-00b0d02354a0}',
'contract_ids': [
'@mozilla.org/security/psmdownload;1',
'@mozilla.org/uriloader/psm-external-content-listener;1',
],
'type': 'mozilla::psm::PSMContentListener',
'headers': ['mozilla/psm/PSMContentListener.h'],
'init_method': 'init',
'categories': {
'external-uricontentlisteners': [
'application/x-x509-ca-cert',
'application/x-x509-email-cert',
'application/x-x509-server-cert',
'application/x-x509-user-cert',
],
},
},
{
'cid': '{9ef18451-a157-4d17-8132-47afef213689}',
'contract_ids': ['@mozilla.org/nss_errors_service;1'],
'type': 'mozilla::psm::NSSErrorsService',
'headers': ['NSSErrorsService.h'],
'init_method': 'Init',
},
{
'cid': '{23ad3531-11d2-4e8e-805a-6a752e91681a}',
'contract_ids': ['@mozilla.org/security/nssversion;1'],
'type': 'nsNSSVersion',
'headers': ['/security/manager/ssl/nsNSSVersion.h'],
},
{
'cid': '{cc75499a-1dd1-11b2-8a82-ca410ac907b8}',
'contract_ids': ['@mozilla.org/secure_browser_ui;1'],
'type': 'nsSecureBrowserUIImpl',
'headers': ['/security/manager/ssl/nsSecureBrowserUIImpl.h'],
},
{
'cid': '{47402be2-e653-45d0-8daa-9f0dce0ac148}',
'contract_ids': ['@mozilla.org/security/local-cert-service;1'],
'type': 'mozilla::LocalCertService',
'headers': ['/security/manager/ssl/LocalCertService.h'],
},
{
'cid': '{0ae53c0f-8ea2-4916-bedc-717443c3e185}',
'contract_ids': ['@mozilla.org/layout/form-processor;1'],
'legacy_constructor': 'nsKeygenFormProcessor::Create',
'headers': ['/security/manager/ssl/nsKeygenHandler.h'],
},
{
'cid': '{0c4f1ddc-1dd2-11b2-9d95-f2fdf113044b}',
'contract_ids': ['@mozilla.org/security/sdr;1'],
'type': 'SecretDecoderRing',
'legacy_constructor': 'mozilla::psm::NSSConstructor<SecretDecoderRing>',
},
{
'cid': '{b084a2ce-1dd1-11b2-bf10-8324f8e065cc}',
'contract_ids': ['@mozilla.org/security/pk11tokendb;1'],
'type': 'nsPK11TokenDB',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsPK11TokenDB>',
},
{
'cid': '{ff9fbcd7-9517-4334-b97a-ceed78909974}',
'contract_ids': ['@mozilla.org/security/pkcs11moduledb;1'],
'type': 'mozilla::psm::PKCS11ModuleDB',
'legacy_constructor': 'mozilla::psm::NSSConstructor<mozilla::psm::PKCS11ModuleDB>',
},
{
'cid': '{660a3226-915c-4ffb-bb20-8985a632df05}',
'contract_ids': [],
'type': 'nsNSSCertificate',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsNSSCertificate>',
},
{
'cid': '{fb0bbc5c-452e-4783-b32c-80124693d871}',
'contract_ids': ['@mozilla.org/security/x509certdb;1'],
'type': 'nsNSSCertificateDB',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsNSSCertificateDB>',
},
{
'cid': '{959fb165-6517-487f-ab9b-d8913be53197}',
'contract_ids': ['@mozilla.org/security/x509certlist;1'],
'type': 'nsNSSCertList',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsNSSCertList>',
},
{
'cid': '{36a1d3b3-d886-4317-96ff-87b0005cfef7}',
'contract_ids': ['@mozilla.org/security/hash;1'],
'type': 'nsCryptoHash',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsCryptoHash>',
},
{
'cid': '{a496d0a2-dff7-4e23-bd65-1ca742fa178a}',
'contract_ids': ['@mozilla.org/security/hmac;1'],
'type': 'nsCryptoHMAC',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsCryptoHMAC>',
},
{
'cid': '{9d383ddd-6856-4187-8485-f36195b29a0e}',
'contract_ids': ['@mozilla.org/security/keyobject;1'],
'type': 'nsKeyObject',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsKeyObject>',
},
{
'cid': '{2a35dd47-b026-4e8d-b6b7-5740f61ab902}',
'contract_ids': ['@mozilla.org/security/keyobjectfactory;1'],
'type': 'nsKeyObjectFactory',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsKeyObjectFactory>',
},
{
'cid': '{45a5fe2f-c350-4b86-962d-02d5aaaa955a}',
'contract_ids': ['@mozilla.org/security/contentsignatureverifier;1'],
'type': 'ContentSignatureVerifier',
'legacy_constructor': 'mozilla::psm::NSSConstructor<ContentSignatureVerifier>',
},
{
'cid': '{67ba681d-5485-4fff-952c-2ee337ffdcd6}',
'contract_ids': ['@mozilla.org/security/certoverride;1'],
'type': 'nsCertOverrideService',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsCertOverrideService>',
},
{
'cid': '{be65e2b7-fe46-4e0f-88e0-4b385db4d68a}',
'contract_ids': ['@mozilla.org/security/random-generator;1'],
'type': 'nsRandomGenerator',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsRandomGenerator>',
},
{
'cid': '{16786594-0296-4471-8096-8f84497ca428}',
'contract_ids': [],
'type': 'mozilla::psm::TransportSecurityInfo',
'legacy_constructor':
'mozilla::psm::NSSConstructor<mozilla::psm::TransportSecurityInfo>',
},
{
'cid': '{16955eee-6c48-4152-9309-c42a465138a1}',
'contract_ids': ['@mozilla.org/ssservice;1'],
'type': 'nsSiteSecurityService',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsSiteSecurityService>',
},
{
'cid': '{11aefd53-2fbb-4c92-a0c1-053212ae42d0}',
'contract_ids': ['@mozilla.org/security/certblocklist;1'],
'type': 'CertBlocklist',
'legacy_constructor': 'mozilla::psm::NSSConstructor<CertBlocklist>',
},
{
'cid': '{57972956-5718-42d2-8070-b3fc72212eaf}',
'contract_ids': ['@mozilla.org/security/oskeystore;1'],
'type': 'OSKeyStore',
'legacy_constructor': 'mozilla::psm::NSSConstructor<OSKeyStore>',
},
{
'cid': '{4fe082ae-6ff0-4b41-b24f-eaa664f6e46a}',
'contract_ids': ['@mozilla.org/security/osreauthenticator;1'],
'type': 'OSReauthenticator',
'legacy_constructor': 'mozilla::psm::NSSConstructor<OSReauthenticator>',
},
]
if defined('MOZ_XUL'):
Classes += [
{
'cid': '{4ea60761-31d6-491d-9e34-4b53a26c416c}',
'contract_ids': ['@mozilla.org/security/nsCertTree;1'],
'type': 'nsCertTree',
'legacy_constructor': 'mozilla::psm::NSSConstructor<nsCertTree>',
},
]

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

@ -51,6 +51,10 @@ if CONFIG['MOZ_XUL']:
XPIDL_MODULE = 'pipnss'
XPCOM_MANIFESTS += [
'components.conf',
]
# These aren't actually used in production code yet, so we don't want to
# ship them with the browser.
TESTING_JS_MODULES.psm += [

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

@ -4,6 +4,8 @@
* 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 "nsNSSModule.h"
#include "CertBlocklist.h"
#include "ContentSignatureVerifier.h"
#include "NSSErrorsService.h"
@ -11,6 +13,7 @@
#include "PSMContentListener.h"
#include "SecretDecoderRing.h"
#include "TransportSecurityInfo.h"
#include "mozilla/MacroArgs.h"
#include "mozilla/ModuleUtils.h"
#include "mozilla/SyncRunnable.h"
#include "nsCURILoader.h"
@ -114,154 +117,44 @@ static nsresult Constructor(nsISupports* aOuter, REFNSIID aIID,
return Instantiate<InstanceClass, InitMethod>(aIID, aResult);
}
} // namespace psm
} // namespace mozilla
using namespace mozilla::psm;
namespace {
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(PSMContentListener, init)
typedef mozilla::psm::NSSErrorsService NSSErrorsService;
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NSSErrorsService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSVersion)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSecureBrowserUIImpl)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNSSComponent, Init)
NS_DEFINE_NAMED_CID(NS_NSSCOMPONENT_CID);
NS_DEFINE_NAMED_CID(NS_SECRETDECODERRING_CID);
NS_DEFINE_NAMED_CID(NS_PK11TOKENDB_CID);
NS_DEFINE_NAMED_CID(NS_PKCS11MODULEDB_CID);
NS_DEFINE_NAMED_CID(NS_PSMCONTENTLISTEN_CID);
NS_DEFINE_NAMED_CID(NS_X509CERT_CID);
NS_DEFINE_NAMED_CID(NS_X509CERTDB_CID);
NS_DEFINE_NAMED_CID(NS_X509CERTLIST_CID);
NS_DEFINE_NAMED_CID(NS_FORMPROCESSOR_CID);
#ifdef MOZ_XUL
NS_DEFINE_NAMED_CID(NS_CERTTREE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_CRYPTO_HASH_CID);
NS_DEFINE_NAMED_CID(NS_CRYPTO_HMAC_CID);
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECT_CID);
NS_DEFINE_NAMED_CID(NS_KEYMODULEOBJECTFACTORY_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTSIGNATUREVERIFIER_CID);
NS_DEFINE_NAMED_CID(NS_CERTOVERRIDE_CID);
NS_DEFINE_NAMED_CID(NS_RANDOMGENERATOR_CID);
NS_DEFINE_NAMED_CID(TRANSPORTSECURITYINFO_CID);
NS_DEFINE_NAMED_CID(NS_NSSERRORSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_NSSVERSION_CID);
NS_DEFINE_NAMED_CID(NS_SECURE_BROWSER_UI_CID);
NS_DEFINE_NAMED_CID(NS_SITE_SECURITY_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_CERT_BLOCKLIST_CID);
NS_DEFINE_NAMED_CID(NS_OSKEYSTORE_CID);
NS_DEFINE_NAMED_CID(NS_OSREAUTHENTICATOR_CID);
#define IMPL(type, ...) \
template <> \
nsresult NSSConstructor<type>(nsISupports * aOuter, const nsIID& aIID, \
void** aResult) { \
return Constructor<type, __VA_ARGS__>(aOuter, aIID, aResult); \
}
// Components that require main thread initialization could cause a deadlock
// in necko code (bug 1418752). To prevent it we initialize all such components
// on main thread in advance in net_EnsurePSMInit(). Update that function when
// new component with ThreadRestriction::MainThreadOnly is added.
static const mozilla::Module::CIDEntry kNSSCIDs[] = {
{&kNS_NSSCOMPONENT_CID, false, nullptr, nsNSSComponentConstructor},
{&kNS_SECRETDECODERRING_CID, false, nullptr,
Constructor<SecretDecoderRing>},
{&kNS_PK11TOKENDB_CID, false, nullptr, Constructor<nsPK11TokenDB>},
{&kNS_PKCS11MODULEDB_CID, false, nullptr, Constructor<PKCS11ModuleDB>},
{&kNS_PSMCONTENTLISTEN_CID, false, nullptr, PSMContentListenerConstructor},
{&kNS_X509CERT_CID, false, nullptr,
Constructor<nsNSSCertificate, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_X509CERTDB_CID, false, nullptr, Constructor<nsNSSCertificateDB>},
{&kNS_X509CERTLIST_CID, false, nullptr,
Constructor<nsNSSCertList, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_FORMPROCESSOR_CID, false, nullptr, nsKeygenFormProcessor::Create},
IMPL(SecretDecoderRing, nullptr)
IMPL(nsPK11TokenDB, nullptr)
IMPL(PKCS11ModuleDB, nullptr)
IMPL(nsNSSCertificate, nullptr, ProcessRestriction::AnyProcess)
IMPL(nsNSSCertificateDB, nullptr)
IMPL(nsNSSCertList, nullptr, ProcessRestriction::AnyProcess)
#ifdef MOZ_XUL
{&kNS_CERTTREE_CID, false, nullptr, Constructor<nsCertTree>},
IMPL(nsCertTree, nullptr)
#endif
{&kNS_CRYPTO_HASH_CID, false, nullptr,
Constructor<nsCryptoHash, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_CRYPTO_HMAC_CID, false, nullptr,
Constructor<nsCryptoHMAC, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_KEYMODULEOBJECT_CID, false, nullptr,
Constructor<nsKeyObject, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_KEYMODULEOBJECTFACTORY_CID, false, nullptr,
Constructor<nsKeyObjectFactory, nullptr, ProcessRestriction::AnyProcess>},
{&kNS_CONTENTSIGNATUREVERIFIER_CID, false, nullptr,
Constructor<ContentSignatureVerifier>},
{&kNS_CERTOVERRIDE_CID, false, nullptr,
Constructor<nsCertOverrideService, &nsCertOverrideService::Init,
ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly>},
{&kNS_RANDOMGENERATOR_CID, false, nullptr,
Constructor<nsRandomGenerator, nullptr, ProcessRestriction::AnyProcess>},
{&kTRANSPORTSECURITYINFO_CID, false, nullptr,
Constructor<TransportSecurityInfo, nullptr,
ProcessRestriction::AnyProcess>},
{&kNS_NSSERRORSSERVICE_CID, false, nullptr, NSSErrorsServiceConstructor},
{&kNS_NSSVERSION_CID, false, nullptr, nsNSSVersionConstructor},
{&kNS_SECURE_BROWSER_UI_CID, false, nullptr,
nsSecureBrowserUIImplConstructor},
{&kNS_SITE_SECURITY_SERVICE_CID, false, nullptr,
Constructor<nsSiteSecurityService, &nsSiteSecurityService::Init,
ProcessRestriction::AnyProcess,
ThreadRestriction::MainThreadOnly>},
{&kNS_CERT_BLOCKLIST_CID, false, nullptr,
Constructor<CertBlocklist, &CertBlocklist::Init,
ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly>},
{&kNS_OSKEYSTORE_CID, false, nullptr,
Constructor<OSKeyStore, nullptr, ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly>},
{&kNS_OSREAUTHENTICATOR_CID, false, nullptr,
Constructor<OSReauthenticator, nullptr,
ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly>},
{nullptr}};
IMPL(nsCryptoHash, nullptr, ProcessRestriction::AnyProcess)
IMPL(nsCryptoHMAC, nullptr, ProcessRestriction::AnyProcess)
IMPL(nsKeyObject, nullptr, ProcessRestriction::AnyProcess)
IMPL(nsKeyObjectFactory, nullptr, ProcessRestriction::AnyProcess)
IMPL(ContentSignatureVerifier, nullptr)
IMPL(nsCertOverrideService, &nsCertOverrideService::Init,
ProcessRestriction::ParentProcessOnly, ThreadRestriction::MainThreadOnly)
IMPL(nsRandomGenerator, nullptr, ProcessRestriction::AnyProcess)
IMPL(TransportSecurityInfo, nullptr, ProcessRestriction::AnyProcess)
IMPL(nsSiteSecurityService, &nsSiteSecurityService::Init,
ProcessRestriction::AnyProcess, ThreadRestriction::MainThreadOnly)
IMPL(CertBlocklist, &CertBlocklist::Init, ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly)
IMPL(OSKeyStore, nullptr, ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly)
IMPL(OSReauthenticator, nullptr, ProcessRestriction::ParentProcessOnly,
ThreadRestriction::MainThreadOnly)
#undef IMPL
static const mozilla::Module::ContractIDEntry kNSSContracts[] = {
{PSM_COMPONENT_CONTRACTID, &kNS_NSSCOMPONENT_CID},
{NS_NSS_ERRORS_SERVICE_CONTRACTID, &kNS_NSSERRORSSERVICE_CID},
{NS_NSSVERSION_CONTRACTID, &kNS_NSSVERSION_CID},
{NS_SECRETDECODERRING_CONTRACTID, &kNS_SECRETDECODERRING_CID},
{NS_PK11TOKENDB_CONTRACTID, &kNS_PK11TOKENDB_CID},
{NS_PKCS11MODULEDB_CONTRACTID, &kNS_PKCS11MODULEDB_CID},
{NS_PSMCONTENTLISTEN_CONTRACTID, &kNS_PSMCONTENTLISTEN_CID},
{NS_X509CERTDB_CONTRACTID, &kNS_X509CERTDB_CID},
{NS_X509CERTLIST_CONTRACTID, &kNS_X509CERTLIST_CID},
{NS_FORMPROCESSOR_CONTRACTID, &kNS_FORMPROCESSOR_CID},
#ifdef MOZ_XUL
{NS_CERTTREE_CONTRACTID, &kNS_CERTTREE_CID},
#endif
{NS_CRYPTO_HASH_CONTRACTID, &kNS_CRYPTO_HASH_CID},
{NS_CRYPTO_HMAC_CONTRACTID, &kNS_CRYPTO_HMAC_CID},
{"@mozilla.org/uriloader/psm-external-content-listener;1",
&kNS_PSMCONTENTLISTEN_CID},
{NS_KEYMODULEOBJECT_CONTRACTID, &kNS_KEYMODULEOBJECT_CID},
{NS_KEYMODULEOBJECTFACTORY_CONTRACTID, &kNS_KEYMODULEOBJECTFACTORY_CID},
{NS_CONTENTSIGNATUREVERIFIER_CONTRACTID, &kNS_CONTENTSIGNATUREVERIFIER_CID},
{NS_CERTOVERRIDE_CONTRACTID, &kNS_CERTOVERRIDE_CID},
{NS_RANDOMGENERATOR_CONTRACTID, &kNS_RANDOMGENERATOR_CID},
{NS_SECURE_BROWSER_UI_CONTRACTID, &kNS_SECURE_BROWSER_UI_CID},
{NS_SSSERVICE_CONTRACTID, &kNS_SITE_SECURITY_SERVICE_CID},
{NS_CERTBLOCKLIST_CONTRACTID, &kNS_CERT_BLOCKLIST_CID},
{NS_OSKEYSTORE_CONTRACTID, &kNS_OSKEYSTORE_CID},
{NS_OSREAUTHENTICATOR_CONTRACTID, &kNS_OSREAUTHENTICATOR_CID},
{nullptr}};
static const mozilla::Module::CategoryEntry kNSSCategories[] = {
{NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-ca-cert",
"@mozilla.org/uriloader/psm-external-content-listener;1"},
{NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY,
"application/x-x509-server-cert",
"@mozilla.org/uriloader/psm-external-content-listener;1"},
{NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-user-cert",
"@mozilla.org/uriloader/psm-external-content-listener;1"},
{NS_CONTENT_LISTENER_CATEGORYMANAGER_ENTRY, "application/x-x509-email-cert",
"@mozilla.org/uriloader/psm-external-content-listener;1"},
{nullptr}};
static const mozilla::Module kNSSModule = {mozilla::Module::kVersion, kNSSCIDs,
kNSSContracts, kNSSCategories};
} // unnamed namespace
NSMODULE_DEFN(NSS) = &kNSSModule;
} // namespace psm
} // namespace mozilla

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

@ -0,0 +1,23 @@
/* -*- 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 nsNSSModule_h
#define nsNSSModule_h
#include "nsID.h"
class nsISupports;
namespace mozilla {
namespace psm {
template <typename T>
nsresult NSSConstructor(nsISupports* aOuter, const nsIID& aIID,
void** aInstancePtr);
}
} // namespace mozilla
#endif // nsNSSModule_h

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

@ -8,6 +8,7 @@
#include "nsCOMPtr.h"
#include "nsISecureBrowserUI.h"
#include "nsITransportSecurityInfo.h"
#include "nsIWebProgressListener.h"
#include "nsWeakReference.h"

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

@ -231,6 +231,21 @@ mochitest-devtools-chrome:
# Bug 1296086: high number of intermittents observed with software GL and large instances
allow-software-gl-layers: false
mochitest-devtools-webreplay:
description: "Mochitest devtools-webreplay run"
suite: mochitest/mochitest-devtools-webreplay
treeherder-symbol: M(dt-wr)
loopback-video: true
tier: 2
max-run-time: 900
mozharness:
mochitest-flavor: chrome
allow-software-gl-layers: false
run-on-projects:
by-test-platform:
macosx64.*/opt: ['trunk', 'try']
default: []
mochitest-gpu:
description: "Mochitest GPU run"
suite: mochitest/gpu

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

@ -279,6 +279,7 @@ macosx64-tests:
- mochitest-chrome
- mochitest-clipboard
- mochitest-devtools-chrome
- mochitest-devtools-webreplay
- mochitest-gpu
- mochitest-media
- mochitest-webgl1-core

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

@ -11,8 +11,13 @@ var EXPORTED_SYMBOLS = [
const Cm = Components.manager;
const {Log} = ChromeUtils.import("resource://gre/modules/Log.jsm");
const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
var logger = Log.repository.getLogger("MockRegistrar");
XPCOMUtils.defineLazyServiceGetter(this, "UUIDGen",
"@mozilla.org/uuid-generator;1",
"nsIUUIDGenerator");
var MockRegistrar = Object.freeze({
_registeredComponents: new Map(),
_originalCIDs: new Map(),
@ -44,6 +49,8 @@ var MockRegistrar = Object.freeze({
let originalFactory = Cm.getClassObject(originalCID, Ci.nsIFactory);
let cid = UUIDGen.generateUUID();
let factory = {
createInstance(outer, iid) {
if (outer) {
@ -73,19 +80,18 @@ var MockRegistrar = Object.freeze({
QueryInterface: ChromeUtils.generateQI([Ci.nsIFactory]),
};
this.registrar.unregisterFactory(originalCID, originalFactory);
this.registrar.registerFactory(originalCID,
this.registrar.registerFactory(cid,
"A Mock for " + contractID,
contractID,
factory);
this._registeredComponents.set(originalCID, {
this._registeredComponents.set(cid, {
contractID,
factory,
originalFactory,
originalCID,
});
return originalCID;
return cid;
},
/**
@ -100,11 +106,12 @@ var MockRegistrar = Object.freeze({
}
this.registrar.unregisterFactory(cid, component.factory);
if (component.originalFactory) {
this.registrar.registerFactory(cid,
"",
if (component.originalCID) {
// Passing `null` for the factory re-maps the contract ID to the
// entry for its original CID.
this.registrar.registerFactory(component.originalCID, "",
component.contractID,
component.originalFactory);
null);
}
this._registeredComponents.delete(cid);

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

@ -144,6 +144,7 @@ config = {
"mochitest-webgl2-deqp": ["--subsuite=webgl2-deqp"],
"mochitest-devtools-chrome": ["--flavor=browser", "--subsuite=devtools"],
"mochitest-devtools-chrome-chunked": ["--flavor=browser", "--subsuite=devtools", "--chunk-by-runtime"],
"mochitest-devtools-webreplay": ["--flavor=browser", "--subsuite=devtools-webreplay"],
"a11y": ["--flavor=a11y"],
},
# local reftest suites

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

@ -248,18 +248,17 @@ var _fakeIdleService = {
Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
},
contractID: "@mozilla.org/widget/idleservice;1",
get CID() {
return this.registrar.contractIDToCID(this.contractID);
},
CID: Components.ID("{9163a4ae-70c2-446c-9ac1-bbe4ab93004e}"),
activate: function FIS_activate() {
if (!this.originalFactory) {
// Save original factory.
this.originalFactory =
Components.manager.getClassObject(Cc[this.contractID],
Ci.nsIFactory);
// Unregister original factory.
this.registrar.unregisterFactory(this.CID, this.originalFactory);
if (!this.originalCID) {
// This is useless, except to the extent that it has the
// side-effect of initializing the widget module, which some
// callers unfortunately accidentally rely on.
void Components.manager.getClassObject(Cc[this.contractID],
Ci.nsIFactory);
this.originalCID = this.registrar.contractIDToCID(this.contractID);
// Replace with the mock.
this.registrar.registerFactory(this.CID, "Fake Idle Service",
this.contractID, this.factory
@ -268,13 +267,13 @@ var _fakeIdleService = {
},
deactivate: function FIS_deactivate() {
if (this.originalFactory) {
if (this.originalCID) {
// Unregister the mock.
this.registrar.unregisterFactory(this.CID, this.factory);
// Restore original factory.
this.registrar.registerFactory(this.CID, "Idle Service",
this.contractID, this.originalFactory);
delete this.originalFactory;
this.registrar.registerFactory(this.originalCID, "Idle Service",
this.contractID, null);
delete this.originalCID;
}
},

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

@ -0,0 +1,207 @@
# -*- 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/.
IS_ANDROID = buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'android'
IS_WINDOWS = buildconfig.substs['MOZ_WIDGET_TOOLKIT'] == 'windows'
MOZ_HAS_TERMINATOR = not IS_ANDROID
Classes = [
{
'name': 'AddonContentPolicy',
'cid': '{c26a8241-ecf4-4aed-9f3c-f1f5c713b9a5}',
'contract_ids': ['@mozilla.org/addons/content-policy;1'],
'type': 'AddonContentPolicy',
'headers': ['mozilla/AddonContentPolicy.h'],
'categories': {'content-policy': '@mozilla.org/addons/content-policy;1'},
},
{
'cid': '{17a59a6b-92b8-42e5-bce0-ab434c7a7135}',
'contract_ids': ['@mozilla.org/addons/addon-manager-startup;1'],
'singleton': True,
'type': 'mozilla::AddonManagerStartup',
'headers': ['mozilla/AddonManagerStartup.h'],
'constructor': 'mozilla::AddonManagerStartup::GetInstance',
},
{
'name': 'AlertNotification',
'cid': '{9a7b7a41-0b47-47f7-b61b-15a210d6f020}',
'contract_ids': ['@mozilla.org/alert-notification;1'],
'type': 'mozilla::AlertNotification',
'headers': ['mozilla/AlertNotification.h'],
},
{
'name': 'ApplicationReputation',
'cid': '{d21b4c33-716f-4117-8041-2770b59ff8a6}',
'contract_ids': ['@mozilla.org/reputationservice/application-reputation-service;1'],
'singleton': True,
'type': 'ApplicationReputationService',
'headers': ['/toolkit/components/reputationservice/ApplicationReputation.h'],
'constructor': 'ApplicationReputationService::GetSingleton',
},
{
'name': 'DownloadPlatform',
'cid': '{649a14c9-fe5c-48ec-9c85-00cad9ccf32e}',
'contract_ids': ['@mozilla.org/toolkit/download-platform;1'],
'type': 'DownloadPlatform',
'headers': ['/toolkit/components/downloads/DownloadPlatform.h'],
},
{
'name': 'ExtensionPolicy',
'cid': '{562de129-8338-482c-bb96-a1ff09ee53cc}',
'contract_ids': ['@mozilla.org/addons/policy-service;1'],
'singleton': True,
'type': 'mozilla::ExtensionPolicyService',
'headers': ['mozilla/ExtensionPolicyService.h'],
'constructor': 'mozilla::ExtensionPolicyService::GetInstance',
},
{
'cid': '{15686f9d-483e-4361-98cd-37f1e8f1e61d}',
'contract_ids': ['@mozilla.org/toolkit/finalizationwitness;1'],
'type': 'mozilla::FinalizationWitnessService',
'headers': ['mozilla/FinalizationWitnessService.h'],
'init_method': 'Init',
},
{
'name': 'LoginReputation',
'cid': '{91fa9e67-1427-4ee9-8ee0-1a6ed578bee1}',
'contract_ids': ['@mozilla.org/reputationservice/login-reputation-service;1'],
'singleton': True,
'type': 'mozilla::LoginReputationService',
'headers': ['/toolkit/components/reputationservice/LoginReputation.h'],
'constructor': 'mozilla::LoginReputationService::GetSingleton',
},
{
'name': 'NativeFileWatcher',
'cid': '{6f488507-469d-4350-a68d-99c807be0a78}',
'contract_ids': ['@mozilla.org/toolkit/filewatcher/native-file-watcher;1'],
'type': 'mozilla::NativeFileWatcherService',
'headers': ['NativeFileWatcherWin.h' if IS_WINDOWS else 'NativeFileWatcherNotSupported.h'],
'init_method': 'Init',
},
{
'cid': '{63a69303-8a64-45a9-848c-d4e2792794e6}',
'contract_ids': ['@mozilla.org/toolkit/osfile/native-internals;1'],
'type': 'mozilla::NativeOSFileInternalsService',
'headers': ['mozilla/NativeOSFileInternals.h'],
},
{
'name': 'Alerts',
'cid': '{a0ccaaf8-09da-44d8-b250-9ac3e93c8117}',
'contract_ids': ['@mozilla.org/alerts-service;1'],
'type': 'nsAlertsService',
'headers': ['/toolkit/components/alerts/nsAlertsService.h'],
'overridable': True,
},
{
'name': 'AppStartup',
'cid': '{7dd4d320-c84b-4624-8d45-7bb9b2356977}',
'contract_ids': ['@mozilla.org/toolkit/app-startup;1'],
'type': 'nsAppStartup',
'headers': ['/toolkit/components/startup/nsAppStartup.h'],
'init_method': 'Init',
},
{
'cid': '{6356aa16-7916-4215-a825-cbc2692ca87a}',
'contract_ids': ['@mozilla.org/appshell/component/browser-status-filter;1'],
'type': 'nsBrowserStatusFilter',
'headers': ['/toolkit/components/statusfilter/nsBrowserStatusFilter.h'],
},
{
'name': 'FindService',
'cid': '{5060b803-340e-11d5-be5b-b3e063ec6a3c}',
'contract_ids': ['@mozilla.org/find/find_service;1'],
'type': 'nsFindService',
'headers': ['/toolkit/components/find/nsFindService.h'],
},
{
'name': 'TypeAheadFind',
'cid': '{e7f70966-9a37-48d7-8aeb-35998f31090e}',
'contract_ids': ['@mozilla.org/typeaheadfind;1'],
'type': 'nsTypeAheadFind',
'headers': ['/toolkit/components/typeaheadfind/nsTypeAheadFind.h'],
},
{
'name': 'UrlClassifierDB',
'cid': '{7a258022-6765-11e5-b379-b37b1f2354be}',
'contract_ids': [
'@mozilla.org/uriclassifierservice',
'@mozilla.org/url-classifier/dbservice;1',
],
'type': 'nsISupports',
'legacy_constructor': 'nsUrlClassifierDBServiceConstructor',
'headers': ['/toolkit/components/build/nsToolkitCompsModule.h'],
},
{
'name': 'UrlClassifierPrefixSet',
'cid': '{3d8579f0-75fa-4e00-ba41-38661d5b5d17}',
'contract_ids': ['@mozilla.org/url-classifier/prefixset;1'],
'type': 'nsUrlClassifierPrefixSet',
'headers': ['nsUrlClassifierPrefixSet.h'],
},
{
'name': 'UrlClassifierStreamUpdater',
'cid': '{e1797597-f4d6-4dd3-a1e1-745ad352cd80}',
'contract_ids': ['@mozilla.org/url-classifier/streamupdater;1'],
'type': 'nsUrlClassifierStreamUpdater',
'headers': ['/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.h'],
},
{
'name': 'UrlClassifierUtils',
'cid': '{b7b2ccec-7912-4ea6-a548-b038447004bd}',
'contract_ids': ['@mozilla.org/url-classifier/utils;1'],
'type': 'nsUrlClassifierUtils',
'headers': ['/toolkit/components/url-classifier/nsUrlClassifierUtils.h'],
'init_method': 'Init',
},
{
'name': 'UserInfo',
'cid': '{14c13684-1dd2-11b2-9463-bb10ba742554}',
'contract_ids': ['@mozilla.org/userinfo;1'],
'type': 'nsUserInfo',
'headers': ['/toolkit/components/startup/nsUserInfo.h'],
},
]
if defined('MOZ_UPDATER') and not IS_ANDROID:
Classes += [
{
'cid': '{f3dcf644-79e8-4f59-a1bb-878454488ef9}',
'contract_ids': ['@mozilla.org/updates/update-processor;1'],
'type': 'nsUpdateProcessor',
'headers': ['/toolkit/xre/nsUpdateDriver.h'],
},
]
if not defined('MOZ_DISABLE_PARENTAL_CONTROLS'):
Classes += [
{
'cid': '{580530e5-118c-4bc7-ab88-bc2cd2b97223}',
'contract_ids': ['@mozilla.org/parental-controls-service;1'],
'type': 'nsParentalControlsService',
'headers': ['/toolkit/components/parentalcontrols/nsParentalControlsService.h'],
},
]
if MOZ_HAS_TERMINATOR:
Classes += [
{
'cid': '{2e59cc70-f83a-412f-89d4-453885837217}',
'contract_ids': ['@mozilla.org/toolkit/shutdown-terminator;1'],
'type': 'mozilla::nsTerminator',
'headers': ['nsTerminator.h'],
},
]
if defined('ENABLE_TESTS'):
Classes += [
{
'cid': '{aaa3f7f2-8ef0-41ec-8d03-aed667cf7fa2}',
'contract_ids': ['@mozilla.org/telemetry/geckoview-testing;1'],
'type': 'TelemetryGeckoViewTestingImpl',
'headers': ['/toolkit/components/telemetry/geckoview/TelemetryGeckoViewTesting.h'],
},
]

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

@ -15,27 +15,15 @@ SOURCES += [
'nsToolkitCompsModule.cpp',
]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../../xre',
'../alerts',
'../downloads',
'../find',
'../perfmonitoring',
'../protobuf',
'../reputationservice',
'../startup',
'../statusfilter',
'../telemetry',
'../typeaheadfind',
'../url-classifier',
]
if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS']:
LOCAL_INCLUDES += [
'../parentalcontrols',
]
if CONFIG['CC_TYPE'] == 'clang-cl':
AllowCompilerWarnings() # workaround for bug 1090497

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

@ -2,8 +2,6 @@
* 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/. */
#define NS_ALERTSERVICE_CONTRACTID "@mozilla.org/alerts-service;1"
// This separate service uses the same nsIAlertsService interface,
// but instead sends a notification to a platform alerts API
// if available. Using a separate CID allows us to overwrite the XUL
@ -19,9 +17,6 @@
#define NS_AUTOCOMPLETEMDBRESULT_CONTRACTID \
"@mozilla.org/autocomplete/mdb-result;1"
#define NS_DOWNLOADPLATFORM_CONTRACTID \
"@mozilla.org/toolkit/download-platform;1"
#define NS_FORMHISTORY_CONTRACTID "@mozilla.org/satchel/form-history;1"
#define NS_FORMFILLCONTROLLER_CONTRACTID \
@ -30,22 +25,6 @@
#define NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID \
"@mozilla.org/autocomplete/search;1?name=form-history"
#define NS_TYPEAHEADFIND_CONTRACTID "@mozilla.org/typeaheadfind;1"
#define NS_PARENTALCONTROLSSERVICE_CONTRACTID \
"@mozilla.org/parental-controls-service;1"
#define NS_URLCLASSIFIERPREFIXSET_CONTRACTID \
"@mozilla.org/url-classifier/prefixset;1"
#define NS_URLCLASSIFIERDBSERVICE_CONTRACTID \
"@mozilla.org/url-classifier/dbservice;1"
#define NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID \
"@mozilla.org/url-classifier/streamupdater;1"
#define NS_URLCLASSIFIERUTILS_CONTRACTID "@mozilla.org/url-classifier/utils;1"
#define NS_URLCLASSIFIERHASHCOMPLETER_CONTRACTID \
"@mozilla.org/url-classifier/hashcompleter;1"
@ -62,37 +41,8 @@
#define NS_FAVICONSERVICE_CONTRACTID "@mozilla.org/browser/favicon-service;1"
#define NS_APPSTARTUP_CONTRACTID "@mozilla.org/toolkit/app-startup;1"
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
# define NS_UPDATEPROCESSOR_CONTRACTID \
"@mozilla.org/updates/update-processor;1"
#endif
#define NS_ADDONCONTENTPOLICY_CONTRACTID "@mozilla.org/addons/content-policy;1"
#if defined(ENABLE_TESTS)
# define NS_TELEMETRYGECKOVIEWTESTING_CONTRACTID \
"@mozilla.org/telemetry/geckoview-testing;1"
#endif
/////////////////////////////////////////////////////////////////////////////
#define ALERT_NOTIFICATION_CID \
{ \
0x9a7b7a41, 0x0b47, 0x47f7, { \
0xb6, 0x1b, 0x15, 0xa2, 0x10, 0xd6, 0xf0, 0x20 \
} \
}
// {A0CCAAF8-09DA-44D8-B250-9AC3E93C8117}
#define NS_ALERTSSERVICE_CID \
{ \
0xa0ccaaf8, 0x9da, 0x44d8, { \
0xb2, 0x50, 0x9a, 0xc3, 0xe9, 0x3c, 0x81, 0x17 \
} \
}
// {84E11F80-CA55-11DD-AD8B-0800200C9A66}
#define NS_SYSTEMALERTSSERVICE_CID \
{ \
@ -125,13 +75,6 @@
} \
}
#define NS_DOWNLOADPLATFORM_CID \
{ \
0x649a14c9, 0xfe5c, 0x48ec, { \
0x9c, 0x85, 0x00, 0xca, 0xd9, 0xcc, 0xf3, 0x2e \
} \
}
// {895DB6C7-DBDF-40ea-9F64-B175033243DC}
#define NS_FORMFILLCONTROLLER_CID \
{ \
@ -148,30 +91,6 @@
} \
}
// {59648a91-5a60-4122-8ff2-54b839c84aed}
#define NS_PARENTALCONTROLSSERVICE_CID \
{ \
0x580530e5, 0x118c, 0x4bc7, { \
0xab, 0x88, 0xbc, 0x2c, 0xd2, 0xb9, 0x72, 0x23 \
} \
}
// {e7f70966-9a37-48d7-8aeb-35998f31090e}
#define NS_TYPEAHEADFIND_CID \
{ \
0xe7f70966, 0x9a37, 0x48d7, { \
0x8a, 0xeb, 0x35, 0x99, 0x8f, 0x31, 0x09, 0x0e \
} \
}
// {3d8579f0-75fa-4e00-ba41-38661d5b5d17}
#define NS_URLCLASSIFIERPREFIXSET_CID \
{ \
0x3d8579f0, 0x75fa, 0x4e00, { \
0xba, 0x41, 0x38, 0x66, 0x1d, 0x5b, 0x5d, 0x17 \
} \
}
// {7a258022-6765-11e5-b379-b37b1f2354be}
#define NS_URLCLASSIFIERDBSERVICE_CID \
{ \
@ -180,22 +99,6 @@
} \
}
// e1797597-f4d6-4dd3-a1e1-745ad352cd80
#define NS_URLCLASSIFIERSTREAMUPDATER_CID \
{ \
0xe1797597, 0xf4d6, 0x4dd3, { \
0xa1, 0xe1, 0x74, 0x5a, 0xd3, 0x52, 0xcd, 0x80 \
} \
}
// {b7b2ccec-7912-4ea6-a548-b038447004bd}
#define NS_URLCLASSIFIERUTILS_CID \
{ \
0xb7b2ccec, 0x7912, 0x4ea6, { \
0xa5, 0x48, 0xb0, 0x38, 0x44, 0x70, 0x04, 0xbd \
} \
}
#define NS_NAVHISTORYSERVICE_CID \
{ \
0x88cecbb7, 0x6c63, 0x4b3b, { \
@ -230,57 +133,3 @@
0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 \
} \
}
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
# define NS_UPDATEPROCESSOR_CID \
{ \
0xf3dcf644, 0x79e8, 0x4f59, { \
0xa1, 0xbb, 0x87, 0x84, 0x54, 0x48, 0x8e, 0xf9 \
} \
}
#endif
#define NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID \
"@mozilla.org/reputationservice/application-reputation-service;1"
#define NS_APPLICATION_REPUTATION_SERVICE_CID \
{ \
0xd21b4c33, 0x716f, 0x4117, { \
0x80, 0x41, 0x27, 0x70, 0xb5, 0x9f, 0xf8, 0xa6 \
} \
}
#define NS_LOGIN_REPUTATION_SERVICE_CONTRACTID \
"@mozilla.org/reputationservice/login-reputation-service;1"
#define NS_LOGIN_REPUTATION_SERVICE_CID \
{ \
0x91fa9e67, 0x1427, 0x4ee9, { \
0x8e, 0xe0, 0x1a, 0x6e, 0xd5, 0x78, 0xbe, 0xe1 \
} \
}
#define NS_ADDONCONTENTPOLICY_CID \
{ \
0xc26a8241, 0xecf4, 0x4aed, { \
0x9f, 0x3c, 0xf1, 0xf5, 0xc7, 0x13, 0xb9, 0xa5 \
} \
}
#define NS_ADDON_POLICY_SERVICE_CID \
{ \
0x562de129, 0x8338, 0x482c, { \
0xbb, 0x96, 0xa1, 0xff, 0x09, 0xee, 0x53, 0xcc \
} \
}
#define NS_ADDON_POLICY_SERVICE_CONTRACTID \
"@mozilla.org/addons/policy-service;1"
#if defined(ENABLE_TESTS)
# define NS_TELEMETRYGECKOVIEWTESTING_CID \
{0xaaa3f7f2, \
0x8ef0, \
0x41ec, \
{0x8d, 0x3, 0xae, 0xd6, 0x67, 0xcf, 0x7f, 0xa2}};
#endif

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

@ -2,256 +2,36 @@
* 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 "nsAppStartup.h"
#include "nsNetCID.h"
#include "nsUserInfo.h"
#include "nsToolkitCompsCID.h"
#include "nsFindService.h"
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
# include "nsUpdateDriver.h"
#endif
#include "nsToolkitCompsModule.h"
#if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
# include "nsParentalControlsService.h"
#endif
#include "mozilla/AlertNotification.h"
#include "nsAlertsService.h"
#include "DownloadPlatform.h"
#include "nsTypeAheadFind.h"
#include "ApplicationReputation.h"
#include "LoginReputation.h"
#include "nsUrlClassifierDBService.h"
#include "nsUrlClassifierStreamUpdater.h"
#include "nsUrlClassifierUtils.h"
#include "nsUrlClassifierPrefixSet.h"
#include "nsBrowserStatusFilter.h"
#include "mozilla/FinalizationWitnessService.h"
#include "mozilla/NativeOSFileInternals.h"
#include "mozilla/AddonContentPolicy.h"
#include "mozilla/AddonManagerStartup.h"
#include "mozilla/ExtensionPolicyService.h"
#include "nsISupports.h"
#if defined(XP_WIN)
# include "NativeFileWatcherWin.h"
#else
# include "NativeFileWatcherNotSupported.h"
NS_IMPL_ISUPPORTS(mozilla::NativeFileWatcherService,
nsINativeFileWatcherService);
#endif // (XP_WIN)
#if !defined(MOZ_WIDGET_ANDROID)
# define MOZ_HAS_TERMINATOR
#endif
#if defined(MOZ_HAS_TERMINATOR)
# include "nsTerminator.h"
#endif
#if defined(ENABLE_TESTS)
# include "geckoview/TelemetryGeckoViewTesting.h"
#endif
using namespace mozilla;
/////////////////////////////////////////////////////////////////////////////
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAppStartup, Init)
#if defined(MOZ_HAS_TERMINATOR)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTerminator)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUserInfo)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFindService)
#if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParentalControlsService)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(AlertNotification)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService)
NS_GENERIC_FACTORY_CONSTRUCTOR(DownloadPlatform)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
ApplicationReputationService, ApplicationReputationService::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(LoginReputationService,
LoginReputationService::GetSingleton)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierPrefixSet)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUrlClassifierStreamUpdater)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUrlClassifierUtils, Init)
static nsresult nsUrlClassifierDBServiceConstructor(nsISupports *aOuter,
REFNSIID aIID,
void **aResult) {
nsresult nsUrlClassifierDBServiceConstructor(nsISupports *aOuter,
const nsIID &aIID,
void **aResult) {
nsresult rv;
NS_ENSURE_ARG_POINTER(aResult);
NS_ENSURE_NO_AGGREGATION(aOuter);
nsUrlClassifierDBService *inst = nsUrlClassifierDBService::GetInstance(&rv);
if (nullptr == inst) {
RefPtr<nsUrlClassifierDBService> inst =
nsUrlClassifierDBService::GetInstance(&rv);
if (!inst) {
return rv;
}
/* NS_ADDREF(inst); */
rv = inst->QueryInterface(aIID, aResult);
NS_RELEASE(inst);
return rv;
return inst->QueryInterface(aIID, aResult);
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUpdateProcessor)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(FinalizationWitnessService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(NativeOSFileInternalsService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NativeFileWatcherService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(AddonContentPolicy)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AddonManagerStartup,
AddonManagerStartup::GetInstance)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ExtensionPolicyService,
ExtensionPolicyService::GetInstance)
#if defined(ENABLE_TESTS)
NS_GENERIC_FACTORY_CONSTRUCTOR(TelemetryGeckoViewTestingImpl)
#endif
NS_DEFINE_NAMED_CID(NS_TOOLKIT_APPSTARTUP_CID);
#if defined(MOZ_HAS_TERMINATOR)
NS_DEFINE_NAMED_CID(NS_TOOLKIT_TERMINATOR_CID);
#endif
NS_DEFINE_NAMED_CID(NS_USERINFO_CID);
NS_DEFINE_NAMED_CID(ALERT_NOTIFICATION_CID);
NS_DEFINE_NAMED_CID(NS_ALERTSSERVICE_CID);
#if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
NS_DEFINE_NAMED_CID(NS_PARENTALCONTROLSSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_DOWNLOADPLATFORM_CID);
NS_DEFINE_NAMED_CID(NS_FIND_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_TYPEAHEADFIND_CID);
NS_DEFINE_NAMED_CID(NS_APPLICATION_REPUTATION_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_LOGIN_REPUTATION_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERPREFIXSET_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERDBSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID);
NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
#endif
NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_OSFILE_INTERNALS_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_ADDONCONTENTPOLICY_CID);
NS_DEFINE_NAMED_CID(NS_ADDON_MANAGER_STARTUP_CID);
NS_DEFINE_NAMED_CID(NS_ADDON_POLICY_SERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_FILEWATCHER_SERVICE_CID);
#if defined(ENABLE_TESTS)
NS_DEFINE_NAMED_CID(NS_TELEMETRYGECKOVIEWTESTING_CID);
#endif
static const Module::CIDEntry kToolkitCIDs[] = {
{&kNS_TOOLKIT_APPSTARTUP_CID, false, nullptr, nsAppStartupConstructor},
#if defined(MOZ_HAS_TERMINATOR)
{&kNS_TOOLKIT_TERMINATOR_CID, false, nullptr, nsTerminatorConstructor},
#endif
{&kNS_USERINFO_CID, false, nullptr, nsUserInfoConstructor},
{&kALERT_NOTIFICATION_CID, false, nullptr, AlertNotificationConstructor},
{&kNS_ALERTSSERVICE_CID, false, nullptr, nsAlertsServiceConstructor},
#if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
{&kNS_PARENTALCONTROLSSERVICE_CID, false, nullptr,
nsParentalControlsServiceConstructor},
#endif
{&kNS_DOWNLOADPLATFORM_CID, false, nullptr, DownloadPlatformConstructor},
{&kNS_FIND_SERVICE_CID, false, nullptr, nsFindServiceConstructor},
{&kNS_TYPEAHEADFIND_CID, false, nullptr, nsTypeAheadFindConstructor},
{&kNS_APPLICATION_REPUTATION_SERVICE_CID, false, nullptr,
ApplicationReputationServiceConstructor},
{&kNS_LOGIN_REPUTATION_SERVICE_CID, false, nullptr,
LoginReputationServiceConstructor},
{&kNS_URLCLASSIFIERPREFIXSET_CID, false, nullptr,
nsUrlClassifierPrefixSetConstructor},
{&kNS_URLCLASSIFIERDBSERVICE_CID, false, nullptr,
nsUrlClassifierDBServiceConstructor},
{&kNS_URLCLASSIFIERSTREAMUPDATER_CID, false, nullptr,
nsUrlClassifierStreamUpdaterConstructor},
{&kNS_URLCLASSIFIERUTILS_CID, false, nullptr,
nsUrlClassifierUtilsConstructor},
{&kNS_BROWSERSTATUSFILTER_CID, false, nullptr,
nsBrowserStatusFilterConstructor},
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
{&kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor},
#endif
{&kFINALIZATIONWITNESSSERVICE_CID, false, nullptr,
FinalizationWitnessServiceConstructor},
{&kNATIVE_OSFILE_INTERNALS_SERVICE_CID, false, nullptr,
NativeOSFileInternalsServiceConstructor},
{&kNS_ADDONCONTENTPOLICY_CID, false, nullptr,
AddonContentPolicyConstructor},
{&kNS_ADDON_MANAGER_STARTUP_CID, false, nullptr,
AddonManagerStartupConstructor},
{&kNS_ADDON_POLICY_SERVICE_CID, false, nullptr,
ExtensionPolicyServiceConstructor},
{&kNATIVE_FILEWATCHER_SERVICE_CID, false, nullptr,
NativeFileWatcherServiceConstructor},
#if defined(ENABLE_TESTS)
{&kNS_TELEMETRYGECKOVIEWTESTING_CID, false, nullptr,
TelemetryGeckoViewTestingImplConstructor},
#endif
{nullptr}};
static const Module::ContractIDEntry kToolkitContracts[] = {
{NS_APPSTARTUP_CONTRACTID, &kNS_TOOLKIT_APPSTARTUP_CID},
#if defined(MOZ_HAS_TERMINATOR)
{NS_TOOLKIT_TERMINATOR_CONTRACTID, &kNS_TOOLKIT_TERMINATOR_CID},
#endif
{NS_USERINFO_CONTRACTID, &kNS_USERINFO_CID},
{ALERT_NOTIFICATION_CONTRACTID, &kALERT_NOTIFICATION_CID},
{NS_ALERTSERVICE_CONTRACTID, &kNS_ALERTSSERVICE_CID},
#if !defined(MOZ_DISABLE_PARENTAL_CONTROLS)
{NS_PARENTALCONTROLSSERVICE_CONTRACTID, &kNS_PARENTALCONTROLSSERVICE_CID},
#endif
{NS_DOWNLOADPLATFORM_CONTRACTID, &kNS_DOWNLOADPLATFORM_CID},
{NS_FIND_SERVICE_CONTRACTID, &kNS_FIND_SERVICE_CID},
{NS_TYPEAHEADFIND_CONTRACTID, &kNS_TYPEAHEADFIND_CID},
{NS_APPLICATION_REPUTATION_SERVICE_CONTRACTID,
&kNS_APPLICATION_REPUTATION_SERVICE_CID},
{NS_LOGIN_REPUTATION_SERVICE_CONTRACTID, &kNS_LOGIN_REPUTATION_SERVICE_CID},
{NS_URLCLASSIFIERPREFIXSET_CONTRACTID, &kNS_URLCLASSIFIERPREFIXSET_CID},
{NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID},
{NS_URICLASSIFIERSERVICE_CONTRACTID, &kNS_URLCLASSIFIERDBSERVICE_CID},
{NS_URLCLASSIFIERSTREAMUPDATER_CONTRACTID,
&kNS_URLCLASSIFIERSTREAMUPDATER_CID},
{NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID},
{NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID},
#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
{NS_UPDATEPROCESSOR_CONTRACTID, &kNS_UPDATEPROCESSOR_CID},
#endif
{FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID},
{NATIVE_OSFILE_INTERNALS_SERVICE_CONTRACTID,
&kNATIVE_OSFILE_INTERNALS_SERVICE_CID},
{NS_ADDONCONTENTPOLICY_CONTRACTID, &kNS_ADDONCONTENTPOLICY_CID},
{NS_ADDONMANAGERSTARTUP_CONTRACTID, &kNS_ADDON_MANAGER_STARTUP_CID},
{NS_ADDON_POLICY_SERVICE_CONTRACTID, &kNS_ADDON_POLICY_SERVICE_CID},
{NATIVE_FILEWATCHER_SERVICE_CONTRACTID, &kNATIVE_FILEWATCHER_SERVICE_CID},
#if defined(ENABLE_TESTS)
{NS_TELEMETRYGECKOVIEWTESTING_CONTRACTID,
&kNS_TELEMETRYGECKOVIEWTESTING_CID},
#endif
{nullptr}};
static const mozilla::Module::CategoryEntry kToolkitCategories[] = {
{"content-policy", NS_ADDONCONTENTPOLICY_CONTRACTID,
NS_ADDONCONTENTPOLICY_CONTRACTID},
{nullptr}};
static const Module kToolkitModule = {Module::kVersion, kToolkitCIDs,
kToolkitContracts, kToolkitCategories};
NSMODULE_DEFN(nsToolkitCompsModule) = &kToolkitModule;

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

@ -0,0 +1,12 @@
/* 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/. */
#include "nscore.h"
#include "nsID.h"
class nsISupports;
nsresult nsUrlClassifierDBServiceConstructor(nsISupports *aOuter,
const nsIID& aIID,
void **aResult);

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

@ -37,8 +37,6 @@ class NativeFileWatcherService final : public nsINativeFileWatcherService {
void operator=(const NativeFileWatcherService& other) = delete;
};
NS_IMPL_ISUPPORTS(NativeFileWatcherService, nsINativeFileWatcherService);
} // namespace mozilla
#endif // mozilla_nativefilewatcher_h__

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

@ -12,7 +12,6 @@
#include "nsCOMPtr.h"
#include "nsServiceManagerUtils.h"
#include "nsWeakReference.h"
#include "nsToolkitCompsCID.h"
#include "Database.h"
#include "nsString.h"
#include "mozilla/Attributes.h"

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

@ -29,6 +29,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Components.h"
#include "mozilla/ErrorNames.h"
#include "mozilla/LoadContext.h"
#include "mozilla/Preferences.h"
@ -368,7 +369,7 @@ nsresult PendingDBLookup::LookupSpecInternal(const nsACString& aSpec) {
// blacklisted.
LOG(("Checking DB service for principal %s [this = %p]", mSpec.get(), this));
nsCOMPtr<nsIUrlClassifierDBService> dbService =
do_GetService(NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &rv);
mozilla::components::UrlClassifierDB::Service(&rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString tables;

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

@ -5,6 +5,7 @@
#include "LoginReputation.h"
#include "nsThreadUtils.h"
#include "mozilla/Components.h"
#include "mozilla/ErrorNames.h"
#include "mozilla/Logging.h"
#include "mozilla/net/UrlClassifierFeatureFactory.h"
@ -113,7 +114,7 @@ RefPtr<ReputationPromise> LoginWhitelist::QueryLoginWhitelist(
}
nsCOMPtr<nsIURIClassifier> uriClassifier =
do_GetService(NS_URLCLASSIFIERDBSERVICE_CONTRACTID, &rv);
mozilla::components::UrlClassifierDB::Service(&rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return p;
}

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

@ -6,6 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "LoginReputationIPC.h"
#include "mozilla/Components.h"
#include "mozilla/Unused.h"
using namespace mozilla;
@ -23,7 +24,7 @@ NS_IMPL_ISUPPORTS(LoginReputationParent, nsILoginReputationQueryCallback)
mozilla::ipc::IPCResult LoginReputationParent::QueryReputation(nsIURI* aURI) {
nsresult rv;
nsCOMPtr<nsILoginReputationService> service =
do_GetService(NS_LOGIN_REPUTATION_SERVICE_CONTRACTID, &rv);
components::LoginReputation::Service(&rv);
if (NS_FAILED(rv)) {
Unused << Send__delete__(this);
return IPC_OK();

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше