Bug 1524687: Part 8 - Convert remaining toolkit modules to static registration. r=mossop

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

--HG--
extra : rebase_source : 9200029151b677261c0bb16e7d874d56c20f88dc
extra : source : b9862758b98ccb95e90901258bcea159784c7483
This commit is contained in:
Kris Maglione 2019-01-24 16:34:52 -08:00
Родитель dde20f3526
Коммит 6d47286458
46 изменённых файлов: 348 добавлений и 468 удалений

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

@ -0,0 +1,20 @@
# -*- 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': '{f6d5ebbd-34f4-487d-9d10-3d34123e3eb9}',
'contract_ids': ['@mozilla.org/autocomplete/controller;1'],
'type': 'nsAutoCompleteController',
'headers': ['/toolkit/components/autocomplete/nsAutoCompleteController.h'],
},
{
'cid': '{2ee3039b-2de4-43d9-93b0-649beacff39a}',
'contract_ids': ['@mozilla.org/autocomplete/simple-result;1'],
'type': 'nsAutoCompleteSimpleResult',
'headers': ['/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.h'],
},
]

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

@ -22,6 +22,10 @@ UNIFIED_SOURCES += [
'nsAutoCompleteSimpleResult.cpp', 'nsAutoCompleteSimpleResult.cpp',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
with Files('**'): with Files('**'):

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

@ -9,14 +9,12 @@
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsNetCID.h" #include "nsNetCID.h"
#include "nsIIOService.h" #include "nsIIOService.h"
#include "nsToolkitCompsCID.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsReadableUtils.h" #include "nsReadableUtils.h"
#include "nsUnicharUtils.h" #include "nsUnicharUtils.h"
#include "nsIScriptSecurityManager.h" #include "nsIScriptSecurityManager.h"
#include "nsIObserverService.h" #include "nsIObserverService.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/ModuleUtils.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "mozilla/dom/KeyboardEventBinding.h" #include "mozilla/dom/KeyboardEventBinding.h"
#include "mozilla/dom/Event.h" #include "mozilla/dom/Event.h"
@ -1758,26 +1756,3 @@ nsresult nsAutoCompleteController::MatchIndexToSearch(int32_t aMatchIndex,
return NS_OK; return NS_OK;
} }
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteController)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAutoCompleteSimpleResult)
NS_DEFINE_NAMED_CID(NS_AUTOCOMPLETECONTROLLER_CID);
NS_DEFINE_NAMED_CID(NS_AUTOCOMPLETESIMPLERESULT_CID);
static const mozilla::Module::CIDEntry kAutoCompleteCIDs[] = {
{&kNS_AUTOCOMPLETECONTROLLER_CID, false, nullptr,
nsAutoCompleteControllerConstructor},
{&kNS_AUTOCOMPLETESIMPLERESULT_CID, false, nullptr,
nsAutoCompleteSimpleResultConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kAutoCompleteContracts[] = {
{NS_AUTOCOMPLETECONTROLLER_CONTRACTID, &kNS_AUTOCOMPLETECONTROLLER_CID},
{NS_AUTOCOMPLETESIMPLERESULT_CONTRACTID, &kNS_AUTOCOMPLETESIMPLERESULT_CID},
{nullptr}};
static const mozilla::Module kAutoCompleteModule = {
mozilla::Module::kVersion, kAutoCompleteCIDs, kAutoCompleteContracts};
NSMODULE_DEFN(tkAutoCompleteModule) = &kAutoCompleteModule;

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

@ -16,28 +16,6 @@
NS_IMPL_ISUPPORTS(nsAutoCompleteSimpleResult, nsIAutoCompleteResult, NS_IMPL_ISUPPORTS(nsAutoCompleteSimpleResult, nsIAutoCompleteResult,
nsIAutoCompleteSimpleResult) nsIAutoCompleteSimpleResult)
struct AutoCompleteSimpleResultMatch {
AutoCompleteSimpleResultMatch(const nsAString& aValue,
const nsAString& aComment,
const nsAString& aImage,
const nsAString& aStyle,
const nsAString& aFinalCompleteValue,
const nsAString& aLabel)
: mValue(aValue),
mComment(aComment),
mImage(aImage),
mStyle(aStyle),
mFinalCompleteValue(aFinalCompleteValue),
mLabel(aLabel) {}
nsString mValue;
nsString mComment;
nsString mImage;
nsString mStyle;
nsString mFinalCompleteValue;
nsString mLabel;
};
nsAutoCompleteSimpleResult::nsAutoCompleteSimpleResult() nsAutoCompleteSimpleResult::nsAutoCompleteSimpleResult()
: mDefaultIndex(-1), mSearchResult(RESULT_NOMATCH) {} : mDefaultIndex(-1), mSearchResult(RESULT_NOMATCH) {}

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

@ -13,7 +13,27 @@
#include "nsTArray.h" #include "nsTArray.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
struct AutoCompleteSimpleResultMatch; struct AutoCompleteSimpleResultMatch {
AutoCompleteSimpleResultMatch(const nsAString& aValue,
const nsAString& aComment,
const nsAString& aImage,
const nsAString& aStyle,
const nsAString& aFinalCompleteValue,
const nsAString& aLabel)
: mValue(aValue),
mComment(aComment),
mImage(aImage),
mStyle(aStyle),
mFinalCompleteValue(aFinalCompleteValue),
mLabel(aLabel) {}
nsString mValue;
nsString mComment;
nsString mImage;
nsString mStyle;
nsString mFinalCompleteValue;
nsString mLabel;
};
class nsAutoCompleteSimpleResult final : public nsIAutoCompleteSimpleResult { class nsAutoCompleteSimpleResult final : public nsIAutoCompleteSimpleResult {
public: public:

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

@ -0,0 +1,15 @@
# -*- 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': '{f66bc334-1dd1-11b2-bab2-90e04fe15c19}',
'contract_ids': ['@mozilla.org/embedding/browser/content-policy;1'],
'type': 'nsWebBrowserContentPolicy',
'headers': ['/toolkit/components/browser/nsWebBrowserContentPolicy.h'],
'categories': {'content-policy': '@mozilla.org/embedding/browser/content-policy;1'},
},
]

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

@ -4,11 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
SOURCES += [ XPCOM_MANIFESTS += [
'nsWebBrowserModule.cpp', 'components.conf',
] ]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'..',
]

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

@ -1,40 +0,0 @@
/* -*- 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/. */
#include "mozilla/ModuleUtils.h"
#include "nsIServiceManager.h"
#include "nsString.h"
#include "nsEmbedCID.h"
#include "nsWebBrowser.h"
#include "nsWebBrowserContentPolicy.h"
// Factory Constructors
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserContentPolicy)
NS_DEFINE_NAMED_CID(NS_WEBBROWSERCONTENTPOLICY_CID);
static const mozilla::Module::CIDEntry kWebBrowserCIDs[] = {
{&kNS_WEBBROWSERCONTENTPOLICY_CID, false, nullptr,
nsWebBrowserContentPolicyConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kWebBrowserContracts[] = {
{NS_WEBBROWSERCONTENTPOLICY_CONTRACTID, &kNS_WEBBROWSERCONTENTPOLICY_CID},
{nullptr}};
static const mozilla::Module::CategoryEntry kWebBrowserCategories[] = {
{"content-policy", NS_WEBBROWSERCONTENTPOLICY_CONTRACTID,
NS_WEBBROWSERCONTENTPOLICY_CONTRACTID},
{nullptr}};
static const mozilla::Module kWebBrowserModule = {
mozilla::Module::kVersion, kWebBrowserCIDs, kWebBrowserContracts,
kWebBrowserCategories};
NSMODULE_DEFN(Browser_Embedding_Module) = &kWebBrowserModule;

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

@ -53,22 +53,6 @@
} \ } \
} }
// {F6D5EBBD-34F4-487d-9D10-3D34123E3EB9}
#define NS_AUTOCOMPLETECONTROLLER_CID \
{ \
0xf6d5ebbd, 0x34f4, 0x487d, { \
0x9d, 0x10, 0x3d, 0x34, 0x12, 0x3e, 0x3e, 0xb9 \
} \
}
// {2ee3039b-2de4-43d9-93b0-649beacff39a}
#define NS_AUTOCOMPLETESIMPLERESULT_CID \
{ \
0x2ee3039b, 0x2de4, 0x43d9, { \
0x93, 0xb0, 0x64, 0x9b, 0xea, 0xcf, 0xf3, 0x9a \
} \
}
// {7A6F70B6-2BBD-44b5-9304-501352D44AB5} // {7A6F70B6-2BBD-44b5-9304-501352D44AB5}
#define NS_AUTOCOMPLETEMDBRESULT_CID \ #define NS_AUTOCOMPLETEMDBRESULT_CID \
{ \ { \
@ -77,14 +61,6 @@
} \ } \
} }
// {895DB6C7-DBDF-40ea-9F64-B175033243DC}
#define NS_FORMFILLCONTROLLER_CID \
{ \
0x895db6c7, 0xdbdf, 0x40ea, { \
0x9f, 0x64, 0xb1, 0x75, 0x3, 0x32, 0x43, 0xdc \
} \
}
// {59648a91-5a60-4122-8ff2-54b839c84aed} // {59648a91-5a60-4122-8ff2-54b839c84aed}
#define NS_GLOBALHISTORY_CID \ #define NS_GLOBALHISTORY_CID \
{ \ { \

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

@ -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': '{0c797702-1c60-4051-9dd7-4d7405605642}',
'contract_ids': ['@mozilla.org/jsctypes;1'],
'type': 'mozilla::ctypes::Module',
'headers': ['/toolkit/components/ctypes/ctypes.h'],
},
]

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

@ -6,7 +6,6 @@
#include "ctypes.h" #include "ctypes.h"
#include "jsapi.h" #include "jsapi.h"
#include "js/MemoryFunctions.h" #include "js/MemoryFunctions.h"
#include "mozilla/ModuleUtils.h"
#include "nsMemory.h" #include "nsMemory.h"
#include "nsString.h" #include "nsString.h"
#include "nsNativeCharsetUtils.h" #include "nsNativeCharsetUtils.h"
@ -15,15 +14,6 @@
#include "nsZipArchive.h" #include "nsZipArchive.h"
#include "xpc_make_class.h" #include "xpc_make_class.h"
#define JSCTYPES_CONTRACTID "@mozilla.org/jsctypes;1"
#define JSCTYPES_CID \
{ \
0xc797702, 0x1c60, 0x4051, { \
0x9d, 0xd7, 0x4d, 0x74, 0x5, 0x60, 0x56, 0x42 \
} \
}
namespace mozilla { namespace mozilla {
namespace ctypes { namespace ctypes {
@ -46,8 +36,6 @@ static char* UnicodeToNative(JSContext* cx, const char16_t* source,
static JSCTypesCallbacks sCallbacks = {UnicodeToNative}; static JSCTypesCallbacks sCallbacks = {UnicodeToNative};
NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable) NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
Module::Module() = default; Module::Module() = default;
@ -112,17 +100,3 @@ Module::Call(nsIXPConnectWrappedNative* wrapper, JSContext* cx, JSObject* obj,
} // namespace ctypes } // namespace ctypes
} // namespace mozilla } // namespace mozilla
NS_DEFINE_NAMED_CID(JSCTYPES_CID);
static const mozilla::Module::CIDEntry kCTypesCIDs[] = {
{&kJSCTYPES_CID, false, nullptr, mozilla::ctypes::ModuleConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kCTypesContracts[] = {
{JSCTYPES_CONTRACTID, &kJSCTYPES_CID}, {nullptr}};
static const mozilla::Module kCTypesModule = {mozilla::Module::kVersion,
kCTypesCIDs, kCTypesContracts};
NSMODULE_DEFN(jsctypes) = &kCTypesModule;

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

@ -18,6 +18,10 @@ EXTRA_JS_MODULES += [
'ctypes.jsm', 'ctypes.jsm',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
with Files('**'): with Files('**'):

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

@ -0,0 +1,18 @@
# -*- 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': '{3fdd6c28-5b87-4e3e-8b57-8e83c23c1a6d}',
'contract_ids': ['@mozilla.org/media/sniffer;1'],
'type': 'nsMediaSniffer',
'headers': ['nsMediaSniffer.h'],
'categories': {
'content-sniffing-services': '@mozilla.org/media/sniffer;1',
'net-content-sniffers': '@mozilla.org/media/sniffer;1',
},
},
]

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

@ -13,7 +13,10 @@ EXPORTS += [
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'mp3sniff.c', 'mp3sniff.c',
'nsMediaSniffer.cpp', 'nsMediaSniffer.cpp',
'nsMediaSnifferModule.cpp', ]
XPCOM_MANIFESTS += [
'components.conf',
] ]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'

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

@ -1,32 +0,0 @@
/* -*- 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/. */
#include "mozilla/ModuleUtils.h"
#include "nsMediaSniffer.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMediaSniffer)
NS_DEFINE_NAMED_CID(NS_MEDIA_SNIFFER_CID);
static const mozilla::Module::CIDEntry kMediaSnifferCIDs[] = {
{&kNS_MEDIA_SNIFFER_CID, false, nullptr, nsMediaSnifferConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kMediaSnifferContracts[] = {
{NS_MEDIA_SNIFFER_CONTRACTID, &kNS_MEDIA_SNIFFER_CID}, {nullptr}};
static const mozilla::Module::CategoryEntry kMediaSnifferCategories[] = {
{"content-sniffing-services", NS_MEDIA_SNIFFER_CONTRACTID,
NS_MEDIA_SNIFFER_CONTRACTID},
{"net-content-sniffers", NS_MEDIA_SNIFFER_CONTRACTID,
NS_MEDIA_SNIFFER_CONTRACTID},
{nullptr}};
static const mozilla::Module kMediaSnifferModule = {
mozilla::Module::kVersion, kMediaSnifferCIDs, kMediaSnifferContracts,
kMediaSnifferCategories};
NSMODULE_DEFN(nsMediaSnifferModule) = &kMediaSnifferModule;

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

@ -7,14 +7,6 @@
#include "jsapi.h" #include "jsapi.h"
#include "js/PropertySpec.h" #include "js/PropertySpec.h"
#include "js/Wrapper.h" #include "js/Wrapper.h"
#include "mozilla/ModuleUtils.h"
#define MOZ_MOZINTLHELPER_CID \
{ \
0xb43c96be, 0x2b3a, 0x4dc4, { \
0x90, 0xe9, 0xb0, 0x6d, 0x34, 0x21, 0x9b, 0x68 \
} \
}
using namespace mozilla; using namespace mozilla;
@ -95,23 +87,3 @@ MozIntlHelper::AddGetLocaleInfo(JS::Handle<JS::Value> val, JSContext* cx) {
return AddFunctions(cx, val, funcs); return AddFunctions(cx, val, funcs);
} }
NS_GENERIC_FACTORY_CONSTRUCTOR(MozIntlHelper)
NS_DEFINE_NAMED_CID(MOZ_MOZINTLHELPER_CID);
static const Module::CIDEntry kMozIntlHelperCIDs[] = {
{&kMOZ_MOZINTLHELPER_CID, false, nullptr, MozIntlHelperConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kMozIntlHelperContracts[] = {
{"@mozilla.org/mozintlhelper;1", &kMOZ_MOZINTLHELPER_CID}, {nullptr}};
static const mozilla::Module kMozIntlHelperModule = {mozilla::Module::kVersion,
kMozIntlHelperCIDs,
kMozIntlHelperContracts,
nullptr,
nullptr,
nullptr,
nullptr};
NSMODULE_DEFN(mozMozIntlHelperModule) = &kMozIntlHelperModule;

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

@ -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': '{b43c96be-2b3a-4dc4-90e9-b06d34219b68}',
'contract_ids': ['@mozilla.org/mozintlhelper;1'],
'type': 'mozilla::MozIntlHelper',
'headers': ['/toolkit/components/mozintl/MozIntlHelper.h'],
},
]

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

@ -25,4 +25,8 @@ EXTRA_COMPONENTS += [
'mozIntl.manifest', 'mozIntl.manifest',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'

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

@ -5,27 +5,15 @@
#include "PerfMeasurement.h" #include "PerfMeasurement.h"
#include "jsperf.h" #include "jsperf.h"
#include "mozilla/ModuleUtils.h"
#include "nsMemory.h" #include "nsMemory.h"
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozJSComponentLoader.h" #include "mozJSComponentLoader.h"
#include "nsZipArchive.h" #include "nsZipArchive.h"
#include "xpc_make_class.h" #include "xpc_make_class.h"
#define JSPERF_CONTRACTID "@mozilla.org/jsperf;1"
#define JSPERF_CID \
{ \
0x421c38e6, 0xaee0, 0x4509, { \
0xa0, 0x25, 0x13, 0x0f, 0x43, 0x78, 0x03, 0x5a \
} \
}
namespace mozilla { namespace mozilla {
namespace jsperf { namespace jsperf {
NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable) NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
Module::Module() = default; Module::Module() = default;
@ -84,17 +72,3 @@ Module::Call(nsIXPConnectWrappedNative* wrapper, JSContext* cx, JSObject* obj,
} // namespace jsperf } // namespace jsperf
} // namespace mozilla } // namespace mozilla
NS_DEFINE_NAMED_CID(JSPERF_CID);
static const mozilla::Module::CIDEntry kPerfCIDs[] = {
{&kJSPERF_CID, false, nullptr, mozilla::jsperf::ModuleConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kPerfContracts[] = {
{JSPERF_CONTRACTID, &kJSPERF_CID}, {nullptr}};
static const mozilla::Module kPerfModule = {mozilla::Module::kVersion,
kPerfCIDs, kPerfContracts};
NSMODULE_DEFN(jsperf) = &kPerfModule;

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

@ -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': '{421c38e6-aee0-4509-a025-130f4378035a}',
'contract_ids': ['@mozilla.org/jsperf;1'],
'type': 'mozilla::jsperf::Module',
'headers': ['/toolkit/components/perf/PerfMeasurement.h'],
},
]

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

@ -15,6 +15,10 @@ EXTRA_JS_MODULES += [
'PerfMeasurement.jsm', 'PerfMeasurement.jsm',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [ LOCAL_INCLUDES += [

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

@ -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': '{1a817186-357a-47cd-8aea-2850d60e959e}',
'contract_ids': ['@mozilla.org/jsreflect;1'],
'type': 'mozilla::reflect::Module',
'headers': ['/toolkit/components/reflect/reflect.h'],
},
]

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

@ -15,4 +15,8 @@ EXTRA_JS_MODULES += [
'reflect.jsm', 'reflect.jsm',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'

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

@ -5,26 +5,14 @@
#include "reflect.h" #include "reflect.h"
#include "jsapi.h" #include "jsapi.h"
#include "mozilla/ModuleUtils.h"
#include "nsMemory.h" #include "nsMemory.h"
#include "nsString.h" #include "nsString.h"
#include "nsNativeCharsetUtils.h" #include "nsNativeCharsetUtils.h"
#include "xpc_make_class.h" #include "xpc_make_class.h"
#define JSREFLECT_CONTRACTID "@mozilla.org/jsreflect;1"
#define JSREFLECT_CID \
{ \
0x1a817186, 0x357a, 0x47cd, { \
0x8a, 0xea, 0x28, 0x50, 0xd6, 0x0e, 0x95, 0x9e \
} \
}
namespace mozilla { namespace mozilla {
namespace reflect { namespace reflect {
NS_GENERIC_FACTORY_CONSTRUCTOR(Module)
NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable) NS_IMPL_ISUPPORTS(Module, nsIXPCScriptable)
Module::Module() = default; Module::Module() = default;
@ -49,17 +37,3 @@ Module::Call(nsIXPConnectWrappedNative* wrapper, JSContext* cx, JSObject* obj,
} // namespace reflect } // namespace reflect
} // namespace mozilla } // namespace mozilla
NS_DEFINE_NAMED_CID(JSREFLECT_CID);
static const mozilla::Module::CIDEntry kReflectCIDs[] = {
{&kJSREFLECT_CID, false, nullptr, mozilla::reflect::ModuleConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kReflectContracts[] = {
{JSREFLECT_CONTRACTID, &kJSREFLECT_CID}, {nullptr}};
static const mozilla::Module kReflectModule = {mozilla::Module::kVersion,
kReflectCIDs, kReflectContracts};
NSMODULE_DEFN(jsreflect) = &kReflectModule;

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

@ -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': '{c0773e90-5799-4eff-ad03-3ebcd85624ac}',
'contract_ids': ['@mozilla.org/toolkit/remote-service;1'],
'type': 'nsRemoteService',
'headers': ['/toolkit/components/remote/nsRemoteService.h'],
},
]

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

@ -28,6 +28,10 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
] ]
CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS'] CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['TK_CFLAGS'] CXXFLAGS += CONFIG['TK_CFLAGS']

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

@ -19,7 +19,6 @@
#include "nsIAppShellService.h" #include "nsIAppShellService.h"
#include "nsAppShellCID.h" #include "nsAppShellCID.h"
#include "nsInterfaceHashtable.h" #include "nsInterfaceHashtable.h"
#include "mozilla/ModuleUtils.h"
#include "nsGTKToolkit.h" #include "nsGTKToolkit.h"
#include "nsICommandLineRunner.h" #include "nsICommandLineRunner.h"
#include "nsCommandLine.h" #include "nsCommandLine.h"
@ -182,27 +181,3 @@ const char* nsRemoteService::HandleCommandLine(const char* aBuffer,
return "200 executed command"; return "200 executed command";
} }
// {C0773E90-5799-4eff-AD03-3EBCD85624AC}
#define NS_REMOTESERVICE_CID \
{ \
0xc0773e90, 0x5799, 0x4eff, { \
0xad, 0x3, 0x3e, 0xbc, 0xd8, 0x56, 0x24, 0xac \
} \
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsRemoteService)
NS_DEFINE_NAMED_CID(NS_REMOTESERVICE_CID);
static const mozilla::Module::CIDEntry kRemoteCIDs[] = {
{&kNS_REMOTESERVICE_CID, false, nullptr, nsRemoteServiceConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kRemoteContracts[] = {
{"@mozilla.org/toolkit/remote-service;1", &kNS_REMOTESERVICE_CID},
{nullptr}};
static const mozilla::Module kRemoteModule = {mozilla::Module::kVersion,
kRemoteCIDs, kRemoteContracts};
NSMODULE_DEFN(RemoteServiceModule) = &kRemoteModule;

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

@ -0,0 +1,17 @@
# -*- 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': '{895db6c7-dbdf-40ea-9f64-b175033243dc}',
'contract_ids': [
'@mozilla.org/autocomplete/search;1?name=form-history',
'@mozilla.org/satchel/form-fill-controller;1',
],
'type': 'nsFormFillController',
'headers': ['/toolkit/components/satchel/nsFormFillController.h'],
},
]

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

@ -40,6 +40,10 @@ EXTRA_JS_MODULES += [
'nsFormAutoCompleteResult.jsm', 'nsFormAutoCompleteResult.jsm',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
JAR_MANIFESTS += ['jar.mn'] JAR_MANIFESTS += ['jar.mn']

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

@ -34,7 +34,6 @@
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsRect.h" #include "nsRect.h"
#include "nsILoginManager.h" #include "nsILoginManager.h"
#include "mozilla/ModuleUtils.h"
#include "nsToolkitCompsCID.h" #include "nsToolkitCompsCID.h"
#include "nsEmbedCID.h" #include "nsEmbedCID.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
@ -1348,23 +1347,3 @@ int32_t nsFormFillController::GetIndexOfDocShell(nsIDocShell* aDocShell) {
return -1; return -1;
} }
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormFillController)
NS_DEFINE_NAMED_CID(NS_FORMFILLCONTROLLER_CID);
static const mozilla::Module::CIDEntry kSatchelCIDs[] = {
{&kNS_FORMFILLCONTROLLER_CID, false, nullptr,
nsFormFillControllerConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kSatchelContracts[] = {
{"@mozilla.org/satchel/form-fill-controller;1",
&kNS_FORMFILLCONTROLLER_CID},
{NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID, &kNS_FORMFILLCONTROLLER_CID},
{nullptr}};
static const mozilla::Module kSatchelModule = {mozilla::Module::kVersion,
kSatchelCIDs, kSatchelContracts};
NSMODULE_DEFN(satchel) = &kSatchelModule;

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

@ -27,6 +27,7 @@
#include "mozilla/Atomics.h" #include "mozilla/Atomics.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "mozilla/BackgroundHangMonitor.h" #include "mozilla/BackgroundHangMonitor.h"
#include "mozilla/Components.h"
#include "mozilla/DebugOnly.h" #include "mozilla/DebugOnly.h"
#include "mozilla/FStream.h" #include "mozilla/FStream.h"
#include "mozilla/IOInterposer.h" #include "mozilla/IOInterposer.h"
@ -1545,35 +1546,6 @@ bool TelemetryImpl::CanRecordReleaseData() { return CanRecordBase(); }
bool TelemetryImpl::CanRecordPrereleaseData() { return CanRecordExtended(); } bool TelemetryImpl::CanRecordPrereleaseData() { return CanRecordExtended(); }
NS_IMPL_ISUPPORTS(TelemetryImpl, nsITelemetry, nsIMemoryReporter) NS_IMPL_ISUPPORTS(TelemetryImpl, nsITelemetry, nsIMemoryReporter)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsITelemetry,
TelemetryImpl::CreateTelemetryInstance)
#define NS_TELEMETRY_CID \
{ \
0xaea477f2, 0xb3a2, 0x469c, { \
0xaa, 0x29, 0x0a, 0x82, 0xd1, 0x32, 0xb8, 0x29 \
} \
}
NS_DEFINE_NAMED_CID(NS_TELEMETRY_CID);
const Module::CIDEntry kTelemetryCIDs[] = {
{&kNS_TELEMETRY_CID, false, nullptr, nsITelemetryConstructor,
Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS},
{nullptr}};
const Module::ContractIDEntry kTelemetryContracts[] = {
{"@mozilla.org/base/telemetry;1", &kNS_TELEMETRY_CID,
Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS},
{nullptr}};
const Module kTelemetryModule = {Module::kVersion,
kTelemetryCIDs,
kTelemetryContracts,
nullptr,
nullptr,
nullptr,
TelemetryImpl::ShutdownTelemetry,
Module::ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS};
NS_IMETHODIMP NS_IMETHODIMP
TelemetryImpl::GetFileIOReports(JSContext* cx, JS::MutableHandleValue ret) { TelemetryImpl::GetFileIOReports(JSContext* cx, JS::MutableHandleValue ret) {
@ -1833,8 +1805,6 @@ TelemetryImpl::GetAllStores(JSContext* aCx, JS::MutableHandleValue aResult) {
// EXTERNALLY VISIBLE FUNCTIONS in no name space // EXTERNALLY VISIBLE FUNCTIONS in no name space
// These are NOT listed in Telemetry.h // These are NOT listed in Telemetry.h
NSMODULE_DEFN(nsTelemetryModule) = &kTelemetryModule;
/** /**
* The XRE_TelemetryAdd function is to be used by embedding applications * The XRE_TelemetryAdd function is to be used by embedding applications
* that can't use mozilla::Telemetry::Accumulate() directly. * that can't use mozilla::Telemetry::Accumulate() directly.
@ -2143,5 +2113,13 @@ void SetEventRecordingEnabled(const nsACString& aCategory, bool aEnabled) {
TelemetryEvent::SetEventRecordingEnabled(aCategory, aEnabled); TelemetryEvent::SetEventRecordingEnabled(aCategory, aEnabled);
} }
void ShutdownTelemetry() {
TelemetryImpl::ShutdownTelemetry();
}
} // namespace Telemetry } // namespace Telemetry
} // namespace mozilla } // namespace mozilla
NS_IMPL_COMPONENT_FACTORY(nsITelemetry) {
return TelemetryImpl::CreateTelemetryInstance().downcast<nsISupports>();
}

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

@ -43,6 +43,11 @@ struct EventExtraEntry;
*/ */
void Init(); void Init();
/**
* Shutdown the Telemetry service.
*/
void ShutdownTelemetry();
/** /**
* Adds sample to a histogram defined in TelemetryHistogramEnums.h * Adds sample to a histogram defined in TelemetryHistogramEnums.h
* *

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

@ -0,0 +1,19 @@
# -*- 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 = ['mozilla/Telemetry.h']
UnloadFunc = 'mozilla::Telemetry::ShutdownTelemetry'
Classes = [
{
'cid': '{aea477f2-b3a2-469c-aa29-0a82d132b829}',
'contract_ids': ['@mozilla.org/base/telemetry;1'],
'singleton': True,
'type': 'nsITelemetry',
'processes': ProcessSelector.ALLOW_IN_GPU_VR_AND_SOCKET_PROCESS,
},
]

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

@ -93,6 +93,10 @@ if CONFIG['MOZ_GECKO_PROFILER']:
'other/KeyedStackCapturer.cpp' 'other/KeyedStackCapturer.cpp'
] ]
XPCOM_MANIFESTS += [
'core/components.conf',
]
EXTRA_COMPONENTS += [ EXTRA_COMPONENTS += [
'TelemetryStartup.js', 'TelemetryStartup.js',
'TelemetryStartup.manifest' 'TelemetryStartup.manifest'

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

@ -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': '{5a4ae9b5-f475-48ae-9dce-0b4c1d347884}',
'contract_ids': ['@mozilla.org/network/protocol;1?name=moz-page-thumb'],
'type': 'PageThumbsProtocol',
'headers': ['/toolkit/components/thumbnails/PageThumbsProtocol.h'],
},
]

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

@ -23,7 +23,6 @@ EXTRA_JS_MODULES += [
] ]
UNIFIED_SOURCES += [ UNIFIED_SOURCES += [
'nsPageThumbsModule.cpp',
'PageThumbsProtocol.cpp' 'PageThumbsProtocol.cpp'
] ]
@ -35,6 +34,10 @@ LOCAL_INCLUDES += [
'/netwerk/base' '/netwerk/base'
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
XPIDL_MODULE = 'thumbnails' XPIDL_MODULE = 'thumbnails'
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'

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

@ -1,21 +0,0 @@
#include "mozilla/ModuleUtils.h"
#include "nsIClassInfoImpl.h"
#include "PageThumbsProtocol.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(PageThumbsProtocol)
NS_DEFINE_NAMED_CID(PAGETHUMBSPROTOCOL_CID);
const mozilla::Module::CIDEntry kPageThumbsCIDs[] = {
{&kPAGETHUMBSPROTOCOL_CID, false, nullptr, PageThumbsProtocolConstructor},
{nullptr}};
const mozilla::Module::ContractIDEntry kPageThumbsContracts[] = {
{NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-page-thumb",
&kPAGETHUMBSPROTOCOL_CID},
{nullptr}};
const mozilla::Module kPageThumbsModule = {
mozilla::Module::kVersion, kPageThumbsCIDs, kPageThumbsContracts};
NSMODULE_DEFN(nsPageThumbsModule) = &kPageThumbsModule;

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

@ -0,0 +1,45 @@
# -*- 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/.
InitFunc = 'mozilla::InitGType'
Headers = [
'/toolkit/system/gnome/nsGnomeModule.h',
]
Classes = [
{
'cid': '{e3a1f3c9-3ae1-4b40-a5e0-7b457fc9a9ad}',
'contract_ids': ['@mozilla.org/gio-service;1'],
'type': 'nsGIOService',
'headers': ['/toolkit/system/gnome/nsGIOService.h'],
},
{
'cid': '{bfd4a9d8-d886-4161-81ef-8868da114170}',
'contract_ids': ['@mozilla.org/gsettings-service;1'],
'type': 'nsGSettingsService',
'headers': ['/toolkit/system/gnome/nsGSettingsService.h'],
'init_method': 'Init',
},
{
'cid': '{84e11f80-ca55-11dd-ad8b-0800200c9a66}',
'contract_ids': ['@mozilla.org/system-alerts-service;1'],
'type': 'nsSystemAlertsService',
'headers': ['/toolkit/system/gnome/nsSystemAlertsService.h'],
'init_method': 'Init',
},
]
if defined('MOZ_ENABLE_GCONF'):
Classes += [
{
'cid': '{d96d5985-a13a-4bdc-9386-ef348d7a97a1}',
'contract_ids': ['@mozilla.org/gnome-gconf-service;1'],
'type': 'nsGConfService',
'headers': ['/toolkit/system/gnome/nsGConfService.h'],
'init_method': 'Init',
},
]

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

@ -23,6 +23,10 @@ SOURCES += [
'nsGSettingsService.cpp', 'nsGSettingsService.cpp',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [ LOCAL_INCLUDES += [

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

@ -7,14 +7,11 @@
#define nsGConfService_h_ #define nsGConfService_h_
#include "nsIGConfService.h" #include "nsIGConfService.h"
#include "gconf/gconf-client.h"
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#define NS_GCONFSERVICE_CID \ extern "C" {
{ \ struct _GConfClient;
0xd96d5985, 0xa13a, 0x4bdc, { \ typedef struct _GConfClient GConfClient;
0x93, 0x86, 0xef, 0x34, 0x8d, 0x7a, 0x97, 0xa1 \
} \
} }
class nsGConfService final : public nsIGConfService { class nsGConfService final : public nsIGConfService {

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

@ -3,58 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsToolkitCompsCID.h" #include "nsGnomeModule.h"
#include "mozilla/ModuleUtils.h"
#include <glib-object.h> #include <glib-object.h>
#ifdef MOZ_ENABLE_GCONF namespace mozilla {
# include "nsGConfService.h" nsresult InitGType() {
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGConfService, Init)
#endif
#include "nsGIOService.h"
#include "nsGSettingsService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIOService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGSettingsService, Init)
#include "nsSystemAlertsService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSystemAlertsService, Init)
#ifdef MOZ_ENABLE_GCONF
NS_DEFINE_NAMED_CID(NS_GCONFSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_GIOSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GSETTINGSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
static const mozilla::Module::CIDEntry kGnomeCIDs[] = {
#ifdef MOZ_ENABLE_GCONF
{&kNS_GCONFSERVICE_CID, false, nullptr, nsGConfServiceConstructor},
#endif
{&kNS_GIOSERVICE_CID, false, nullptr, nsGIOServiceConstructor},
{&kNS_GSETTINGSSERVICE_CID, false, nullptr, nsGSettingsServiceConstructor},
{&kNS_SYSTEMALERTSSERVICE_CID, false, nullptr,
nsSystemAlertsServiceConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kGnomeContracts[] = {
#ifdef MOZ_ENABLE_GCONF
{NS_GCONFSERVICE_CONTRACTID, &kNS_GCONFSERVICE_CID},
#endif
{NS_GIOSERVICE_CONTRACTID, &kNS_GIOSERVICE_CID},
{NS_GSETTINGSSERVICE_CONTRACTID, &kNS_GSETTINGSSERVICE_CID},
{NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID},
{nullptr}};
static nsresult InitGType() {
g_type_init(); g_type_init();
return NS_OK; return NS_OK;
} }
} // namespace mozilla
static const mozilla::Module kGnomeModule = {mozilla::Module::kVersion,
kGnomeCIDs,
kGnomeContracts,
nullptr,
nullptr,
InitGType};
NSMODULE_DEFN(mozgnome) = &kGnomeModule;

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

@ -0,0 +1,10 @@
/* -*- Mode: C++; tab-width: 2; 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/. */
#include "nscore.h"
namespace mozilla {
nsresult InitGType();
} // namespace mozilla

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

@ -0,0 +1,13 @@
# -*- 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': '{0fa3158c-d5a7-43de-9181-a285e74cf1d4}',
'contract_ids': ['@mozilla.org/system-proxy-settings;1'],
'type': 'nsUnixSystemProxySettings',
},
]

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

@ -17,4 +17,8 @@ else:
'nsUnixSystemProxySettings.cpp', 'nsUnixSystemProxySettings.cpp',
] ]
XPCOM_MANIFESTS += [
'components.conf',
]
FINAL_LIBRARY = 'xul' FINAL_LIBRARY = 'xul'

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

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISystemProxySettings.h" #include "nsISystemProxySettings.h"
#include "mozilla/ModuleUtils.h" #include "mozilla/Components.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsString.h" #include "nsString.h"
@ -22,7 +22,6 @@ class nsUnixSystemProxySettings : public nsISystemProxySettings {
NS_DECL_NSISYSTEMPROXYSETTINGS NS_DECL_NSISYSTEMPROXYSETTINGS
nsUnixSystemProxySettings() { mProxyFactory = nullptr; } nsUnixSystemProxySettings() { mProxyFactory = nullptr; }
nsresult Init();
private: private:
~nsUnixSystemProxySettings() { ~nsUnixSystemProxySettings() {
@ -40,8 +39,6 @@ nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly) {
return NS_OK; return NS_OK;
} }
nsresult nsUnixSystemProxySettings::Init() { return NS_OK; }
nsresult nsUnixSystemProxySettings::GetPACURI(nsACString &aResult) { nsresult nsUnixSystemProxySettings::GetPACURI(nsACString &aResult) {
// Make sure we return an empty result. // Make sure we return an empty result.
aResult.Truncate(); aResult.Truncate();
@ -104,27 +101,6 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString &aSpec,
return NS_OK; return NS_OK;
} }
/* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */ NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) {
#define NS_UNIXSYSTEMPROXYSERVICE_CID \ return do_AddRef(new nsUnixSystemProxySettings()).downcast<nsISupports>();
{ \
0x0fa3158c, 0xd5a7, 0x43de, { \
0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 \
} \
} }
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
NS_DEFINE_NAMED_CID(NS_UNIXSYSTEMPROXYSERVICE_CID);
static const mozilla::Module::CIDEntry kUnixProxyCIDs[] = {
{&kNS_UNIXSYSTEMPROXYSERVICE_CID, false, nullptr,
nsUnixSystemProxySettingsConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kUnixProxyContracts[] = {
{NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_UNIXSYSTEMPROXYSERVICE_CID},
{nullptr}};
static const mozilla::Module kUnixProxyModule = {
mozilla::Module::kVersion, kUnixProxyCIDs, kUnixProxyContracts};
NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule;

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

@ -4,7 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISystemProxySettings.h" #include "nsISystemProxySettings.h"
#include "mozilla/ModuleUtils.h" #include "mozilla/Components.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIGConfService.h" #include "nsIGConfService.h"
#include "nsIURI.h" #include "nsIURI.h"
@ -21,13 +21,15 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
#include "nsIURI.h" #include "nsIURI.h"
using namespace mozilla;
class nsUnixSystemProxySettings final : public nsISystemProxySettings { class nsUnixSystemProxySettings final : public nsISystemProxySettings {
public: public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
NS_DECL_NSISYSTEMPROXYSETTINGS NS_DECL_NSISYSTEMPROXYSETTINGS
nsUnixSystemProxySettings() : mSchemeProxySettings(4) {} nsUnixSystemProxySettings() : mSchemeProxySettings(4) {}
nsresult Init(); void Init();
private: private:
~nsUnixSystemProxySettings() = default; ~nsUnixSystemProxySettings() = default;
@ -59,7 +61,7 @@ nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
return NS_OK; return NS_OK;
} }
nsresult nsUnixSystemProxySettings::Init() { void nsUnixSystemProxySettings::Init() {
mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID); mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
if (mGSettings) { if (mGSettings) {
mGSettings->GetCollectionForSchema( mGSettings->GetCollectionForSchema(
@ -69,8 +71,6 @@ nsresult nsUnixSystemProxySettings::Init() {
if (!mProxySettings) { if (!mProxySettings) {
mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID); mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
} }
return NS_OK;
} }
bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) { bool nsUnixSystemProxySettings::IsProxyMode(const char* aMode) {
@ -499,27 +499,8 @@ nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult); return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
} }
/* 0fa3158c-d5a7-43de-9181-a285e74cf1d4 */ NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) {
#define NS_UNIXSYSTEMPROXYSERVICE_CID \ auto result = MakeRefPtr<nsUnixSystemProxySettings>();
{ \ result->Init();
0x0fa3158c, 0xd5a7, 0x43de, { \ return result.forget().downcast<nsISupports>();
0x91, 0x81, 0xa2, 0x85, 0xe7, 0x4c, 0xf1, 0xd4 \
} \
} }
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixSystemProxySettings, Init)
NS_DEFINE_NAMED_CID(NS_UNIXSYSTEMPROXYSERVICE_CID);
static const mozilla::Module::CIDEntry kUnixProxyCIDs[] = {
{&kNS_UNIXSYSTEMPROXYSERVICE_CID, false, nullptr,
nsUnixSystemProxySettingsConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kUnixProxyContracts[] = {
{NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_UNIXSYSTEMPROXYSERVICE_CID},
{nullptr}};
static const mozilla::Module kUnixProxyModule = {
mozilla::Module::kVersion, kUnixProxyCIDs, kUnixProxyContracts};
NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule;