Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit b83df4e

Browse files
committed
Bug 1478124: Part 8a - Update toolkit module to use a static component manifest. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D15039 --HG-- extra : rebase_source : 1683d6ced9a6c10e6fa19425debbb51950b9b629 extra : source : d94039b199437180309264cb4c206ae7ebb7d21d
1 parent 9913b7d commit b83df4e

33 files changed

Lines changed: 305 additions & 479 deletions

dom/base/WindowDestroyedEvent.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
#include "nsIPrincipal.h"
1313
#include "nsISupportsPrimitives.h"
1414
#include "nsIAppStartup.h"
15-
#include "nsToolkitCompsCID.h"
1615
#include "nsCOMPtr.h"
1716
#include "nsContentUtils.h"
1817
#include "xpcpublic.h"
18+
#include "mozilla/Components.h"
1919

2020
namespace mozilla {
2121

@@ -65,8 +65,7 @@ WindowDestroyedEvent::Run() {
6565
case Phase::Destroying: {
6666
bool skipNukeCrossCompartment = false;
6767
#ifndef DEBUG
68-
nsCOMPtr<nsIAppStartup> appStartup =
69-
do_GetService(NS_APPSTARTUP_CONTRACTID);
68+
nsCOMPtr<nsIAppStartup> appStartup = components::AppStartup::Service();
7069

7170
if (appStartup) {
7271
appStartup->GetShuttingDown(&skipNukeCrossCompartment);

dom/base/nsGlobalWindowInner.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@
149149
#include "nsContentUtils.h"
150150
#include "nsCSSProps.h"
151151
#include "nsIURIFixup.h"
152-
#ifndef DEBUG
153-
# include "nsIAppStartup.h"
154-
# include "nsToolkitCompsCID.h"
155-
#endif
156152
#include "nsCDefaultURIFixup.h"
157153
#include "mozilla/EventDispatcher.h"
158154
#include "mozilla/EventStateManager.h"

dom/base/nsGlobalWindowOuter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@
153153
#include "nsCSSProps.h"
154154
#include "nsIURIFixup.h"
155155
#include "nsIURIMutator.h"
156-
#ifndef DEBUG
157-
# include "nsIAppStartup.h"
158-
# include "nsToolkitCompsCID.h"
159-
#endif
160156
#include "nsCDefaultURIFixup.h"
161157
#include "mozilla/EventDispatcher.h"
162158
#include "mozilla/EventStateManager.h"

dom/ipc/ContentParent.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "mozilla/AntiTrackingCommon.h"
3434
#include "mozilla/BasePrincipal.h"
3535
#include "mozilla/ClearOnShutdown.h"
36+
#include "mozilla/Components.h"
3637
#include "mozilla/StyleSheetInlines.h"
3738
#include "mozilla/DataStorage.h"
3839
#include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
@@ -180,7 +181,6 @@
180181
#include "nsServiceManagerUtils.h"
181182
#include "nsStyleSheetService.h"
182183
#include "nsThreadUtils.h"
183-
#include "nsToolkitCompsCID.h"
184184
#include "nsWidgetsCID.h"
185185
#include "PreallocatedProcessManager.h"
186186
#include "ProcessPriorityManager.h"
@@ -3803,8 +3803,7 @@ mozilla::ipc::IPCResult ContentParent::RecvShowAlert(
38033803
return IPC_OK();
38043804
}
38053805

3806-
nsCOMPtr<nsIAlertsService> sysAlerts(
3807-
do_GetService(NS_ALERTSERVICE_CONTRACTID));
3806+
nsCOMPtr<nsIAlertsService> sysAlerts(components::Alerts::Service());
38083807
if (sysAlerts) {
38093808
sysAlerts->ShowAlert(aAlert, this);
38103809
}
@@ -3817,8 +3816,7 @@ mozilla::ipc::IPCResult ContentParent::RecvCloseAlert(
38173816
return IPC_OK();
38183817
}
38193818

3820-
nsCOMPtr<nsIAlertsService> sysAlerts(
3821-
do_GetService(NS_ALERTSERVICE_CONTRACTID));
3819+
nsCOMPtr<nsIAlertsService> sysAlerts(components::Alerts::Service());
38223820
if (sysAlerts) {
38233821
sysAlerts->CloseAlert(aName, aPrincipal);
38243822
}

dom/notification/Notification.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "mozilla/dom/Notification.h"
88

9+
#include "mozilla/Components.h"
910
#include "mozilla/Encoding.h"
1011
#include "mozilla/EventStateManager.h"
1112
#include "mozilla/JSONWriter.h"
@@ -55,7 +56,6 @@
5556
#include "nsServiceManagerUtils.h"
5657
#include "nsStructuredCloneContainer.h"
5758
#include "nsThreadUtils.h"
58-
#include "nsToolkitCompsCID.h"
5959
#include "nsXULAppAPI.h"
6060

6161
namespace mozilla {
@@ -653,8 +653,7 @@ void NotificationTelemetryService::RecordDNDSupported() {
653653
return;
654654
}
655655

656-
nsCOMPtr<nsIAlertsService> alertService =
657-
do_GetService(NS_ALERTSERVICE_CONTRACTID);
656+
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
658657
if (!alertService) {
659658
return;
660659
}
@@ -1411,8 +1410,7 @@ void Notification::ShowInternal() {
14111410
NS_WARNING("Could not persist Notification");
14121411
}
14131412

1414-
nsCOMPtr<nsIAlertsService> alertService =
1415-
do_GetService(NS_ALERTSERVICE_CONTRACTID);
1413+
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
14161414

14171415
ErrorResult result;
14181416
NotificationPermission permission = NotificationPermission::Denied;
@@ -1952,8 +1950,7 @@ void Notification::CloseInternal() {
19521950
SetAlertName();
19531951
UnpersistNotification();
19541952
if (!mIsClosed) {
1955-
nsCOMPtr<nsIAlertsService> alertService =
1956-
do_GetService(NS_ALERTSERVICE_CONTRACTID);
1953+
nsCOMPtr<nsIAlertsService> alertService = components::Alerts::Service();
19571954
if (alertService) {
19581955
nsAutoString alertName;
19591956
GetAlertName(alertName);

extensions/pref/autoconfig/src/nsReadConfig.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "nsReadConfig.h"
77
#include "nsJSConfigTriggers.h"
88

9+
#include "mozilla/Components.h"
910
#include "nsAppDirectoryServiceDefs.h"
1011
#include "nsIAppStartup.h"
1112
#include "nsContentUtils.h"
@@ -18,13 +19,14 @@
1819
#include "nsIPromptService.h"
1920
#include "nsIServiceManager.h"
2021
#include "nsIStringBundle.h"
21-
#include "nsToolkitCompsCID.h"
2222
#include "nsNetUtil.h"
2323
#include "nsString.h"
2424
#include "nsCRT.h"
2525
#include "nspr.h"
2626
#include "nsXULAppAPI.h"
2727

28+
using namespace mozilla;
29+
2830
extern bool sandboxEnabled;
2931

3032
extern mozilla::LazyLogModule MCD;
@@ -101,7 +103,7 @@ NS_IMETHODIMP nsReadConfig::Observe(nsISupports *aSubject, const char *aTopic,
101103
rv = DisplayError();
102104
if (NS_FAILED(rv)) {
103105
nsCOMPtr<nsIAppStartup> appStartup =
104-
do_GetService(NS_APPSTARTUP_CONTRACTID);
106+
components::AppStartup::Service();
105107
if (appStartup) appStartup->Quit(nsIAppStartup::eAttemptQuit);
106108
}
107109
}

netwerk/url-classifier/AsyncUrlChannelClassifier.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
66

77
#include "Classifier.h"
8+
#include "mozilla/Components.h"
89
#include "mozilla/ErrorNames.h"
910
#include "mozilla/net/AsyncUrlChannelClassifier.h"
1011
#include "mozilla/net/UrlClassifierCommon.h"
@@ -92,7 +93,7 @@ class URIData {
9293
data->mURI = aURI;
9394

9495
nsCOMPtr<nsIUrlClassifierUtils> utilsService =
95-
do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID);
96+
components::UrlClassifierUtils::Service();
9697
if (NS_WARN_IF(!utilsService)) {
9798
return NS_ERROR_FAILURE;
9899
}

netwerk/url-classifier/nsChannelClassifier.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "nsIUrlClassifierFeature.h"
2525
#include "nsPrintfCString.h"
2626

27+
#include "mozilla/Components.h"
2728
#include "mozilla/ErrorNames.h"
2829
#include "mozilla/Logging.h"
2930
#include "mozilla/Preferences.h"
@@ -369,7 +370,7 @@ nsresult nsChannelClassifier::SendThreatHitReport(nsIChannel* aChannel,
369370
}
370371

371372
nsCOMPtr<nsIURIClassifier> uriClassifier =
372-
do_GetService(NS_URLCLASSIFIERDBSERVICE_CONTRACTID);
373+
components::UrlClassifierDB::Service();
373374
if (!uriClassifier) {
374375
return NS_ERROR_UNEXPECTED;
375376
}

0 commit comments

Comments
 (0)