diff options
Diffstat (limited to 'toolkit/components/build')
-rw-r--r-- | toolkit/components/build/components.conf | 178 | ||||
-rw-r--r-- | toolkit/components/build/moz.build | 26 | ||||
-rw-r--r-- | toolkit/components/build/nsToolkitCompsCID.h | 101 | ||||
-rw-r--r-- | toolkit/components/build/nsToolkitCompsModule.cpp | 25 | ||||
-rw-r--r-- | toolkit/components/build/nsToolkitCompsModule.h | 10 |
5 files changed, 340 insertions, 0 deletions
diff --git a/toolkit/components/build/components.conf b/toolkit/components/build/components.conf new file mode 100644 index 0000000000..4f042e8b19 --- /dev/null +++ b/toolkit/components/build/components.conf @@ -0,0 +1,178 @@ +# -*- 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'], + }, + { + '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': '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', + 'js_name': 'startup', + 'cid': '{7dd4d320-c84b-4624-8d45-7bb9b2356977}', + 'contract_ids': ['@mozilla.org/toolkit/app-startup;1'], + 'interfaces': ['nsIAppStartup'], + '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': ['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'], + 'constructor': 'nsUrlClassifierUtils::GetXPCOMSingleton', + }, +] + +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'], + }, + { + 'cid': '{cf4c4487-66d9-4e18-a2e9-39002245332f}', + 'contract_ids': ['@mozilla.org/updates/update-sync-manager;1'], + 'type': 'nsUpdateSyncManager', + 'singleton': True, + 'headers': ['/toolkit/xre/nsUpdateSyncManager.h'], + 'constructor': 'nsUpdateSyncManager::GetSingleton', + 'processes': ProcessSelector.MAIN_PROCESS_ONLY, + 'categories': {'xpcom-startup': 'nsUpdateSyncManager'}, + }, + ] + +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'], + }, + ] diff --git a/toolkit/components/build/moz.build b/toolkit/components/build/moz.build new file mode 100644 index 0000000000..a685d18c87 --- /dev/null +++ b/toolkit/components/build/moz.build @@ -0,0 +1,26 @@ +# -*- 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/. + +with Files("**"): + BUG_COMPONENT = ("Firefox Build System", "General") + +EXPORTS += [ + "nsToolkitCompsCID.h", +] + +SOURCES += [ + "nsToolkitCompsModule.cpp", +] + +XPCOM_MANIFESTS += [ + "components.conf", +] + +FINAL_LIBRARY = "xul" + +LOCAL_INCLUDES += [ + "../url-classifier", +] diff --git a/toolkit/components/build/nsToolkitCompsCID.h b/toolkit/components/build/nsToolkitCompsCID.h new file mode 100644 index 0000000000..a5d4833e50 --- /dev/null +++ b/toolkit/components/build/nsToolkitCompsCID.h @@ -0,0 +1,101 @@ +/* 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/. */ + +// 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 +// alerts service at runtime. +#define NS_SYSTEMALERTSERVICE_CONTRACTID "@mozilla.org/system-alerts-service;1" + +#define NS_AUTOCOMPLETECONTROLLER_CONTRACTID \ + "@mozilla.org/autocomplete/controller;1" + +#define NS_AUTOCOMPLETESIMPLERESULT_CONTRACTID \ + "@mozilla.org/autocomplete/simple-result;1" + +#define NS_AUTOCOMPLETEMDBRESULT_CONTRACTID \ + "@mozilla.org/autocomplete/mdb-result;1" + +#define NS_FORMHISTORY_CONTRACTID "@mozilla.org/satchel/form-history;1" + +#define NS_FORMFILLCONTROLLER_CONTRACTID \ + "@mozilla.org/satchel/form-fill-controller;1" + +#define NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID \ + "@mozilla.org/autocomplete/search;1?name=form-history" + +#define NS_URLCLASSIFIERHASHCOMPLETER_CONTRACTID \ + "@mozilla.org/url-classifier/hashcompleter;1" + +#define NS_NAVHISTORYSERVICE_CONTRACTID \ + "@mozilla.org/browser/nav-history-service;1" + +#define NS_NAVBOOKMARKSSERVICE_CONTRACTID \ + "@mozilla.org/browser/nav-bookmarks-service;1" + +#define NS_TAGGINGSERVICE_CONTRACTID "@mozilla.org/browser/tagging-service;1" + +#define NS_FAVICONSERVICE_CONTRACTID "@mozilla.org/browser/favicon-service;1" + +///////////////////////////////////////////////////////////////////////////// + +// {84E11F80-CA55-11DD-AD8B-0800200C9A66} +#define NS_SYSTEMALERTSSERVICE_CID \ + { \ + 0x84e11f80, 0xca55, 0x11dd, { \ + 0xad, 0x8b, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 \ + } \ + } + +// {7A6F70B6-2BBD-44b5-9304-501352D44AB5} +#define NS_AUTOCOMPLETEMDBRESULT_CID \ + { \ + 0x7a6f70b6, 0x2bbd, 0x44b5, { \ + 0x93, 0x4, 0x50, 0x13, 0x52, 0xd4, 0x4a, 0xb5 \ + } \ + } + +// {59648a91-5a60-4122-8ff2-54b839c84aed} +#define NS_GLOBALHISTORY_CID \ + { \ + 0x59648a91, 0x5a60, 0x4122, { \ + 0x8f, 0xf2, 0x54, 0xb8, 0x39, 0xc8, 0x4a, 0xed \ + } \ + } + +// {7a258022-6765-11e5-b379-b37b1f2354be} +#define NS_URLCLASSIFIERDBSERVICE_CID \ + { \ + 0x7a258022, 0x6765, 0x11e5, { \ + 0xb3, 0x79, 0xb3, 0x7b, 0x1f, 0x23, 0x54, 0xbe \ + } \ + } + +#define NS_NAVHISTORYSERVICE_CID \ + { \ + 0x88cecbb7, 0x6c63, 0x4b3b, { \ + 0x8c, 0xd4, 0x84, 0xf3, 0xb8, 0x22, 0x8c, 0x69 \ + } \ + } + +#define NS_NAVHISTORYRESULTTREEVIEWER_CID \ + { \ + 0x2ea8966f, 0x0671, 0x4c02, { \ + 0x9c, 0x70, 0x94, 0x59, 0x56, 0xd4, 0x54, 0x34 \ + } \ + } + +#define NS_NAVBOOKMARKSSERVICE_CID \ + { \ + 0x9de95a0c, 0x39a4, 0x4d64, { \ + 0x9a, 0x53, 0x17, 0x94, 0x0d, 0xd7, 0xca, 0xbb \ + } \ + } + +#define NS_FAVICONSERVICE_CID \ + { \ + 0x984e3259, 0x9266, 0x49cf, { \ + 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 \ + } \ + } diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp new file mode 100644 index 0000000000..990ef45557 --- /dev/null +++ b/toolkit/components/build/nsToolkitCompsModule.cpp @@ -0,0 +1,25 @@ +/* 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 "nsToolkitCompsModule.h" + +#include "nsUrlClassifierDBService.h" + +using namespace mozilla; + +///////////////////////////////////////////////////////////////////////////// + +nsresult nsUrlClassifierDBServiceConstructor(const nsIID& aIID, + void** aResult) { + nsresult rv; + NS_ENSURE_ARG_POINTER(aResult); + + RefPtr<nsUrlClassifierDBService> inst = + nsUrlClassifierDBService::GetInstance(&rv); + if (!inst) { + return rv; + } + + return inst->QueryInterface(aIID, aResult); +} diff --git a/toolkit/components/build/nsToolkitCompsModule.h b/toolkit/components/build/nsToolkitCompsModule.h new file mode 100644 index 0000000000..5d3a79bc5a --- /dev/null +++ b/toolkit/components/build/nsToolkitCompsModule.h @@ -0,0 +1,10 @@ +/* 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(const nsIID& aIID, void** aResult); |