From cdb4e124a7f2d87060b5df29580dd936dec01cd4 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 6 Mar 2022 15:26:05 +0000 Subject: Issue %2 - De-unify sources in /components --- components/alerts/moz.build | 2 +- components/alerts/src/nsAlertsService.cpp | 1 + components/alerts/src/nsXULAlerts.h | 2 ++ components/appshell/moz.build | 2 +- components/appshell/src/nsWindowMediator.h | 1 + components/appshell/src/nsXULWindow.cpp | 1 + components/autocomplete/moz.build | 2 +- .../autocomplete/nsAutoCompleteSimpleResult.cpp | 25 ---------------------- .../autocomplete/nsAutoCompleteSimpleResult.h | 25 +++++++++++++++++++++- components/filewatcher/moz.build | 2 +- components/htmlfive/moz.build | 6 +----- components/htmlfive/nsHtml5SpeculativeLoad.h | 2 ++ .../htmlfive/nsHtml5TokenizerCppSupplement.h | 2 ++ .../htmlfive/nsHtml5TreeBuilderCppSupplement.h | 2 ++ components/htmlfive/nsHtml5TreeOpExecutor.cpp | 1 + components/mediasniffer/moz.build | 2 +- components/perfmonitoring/moz.build | 2 +- components/permissions/moz.build | 2 +- components/permissions/src/nsPermission.cpp | 2 ++ components/permissions/src/nsPermission.h | 1 + components/places/moz.build | 2 +- components/places/src/SQLFunctions.cpp | 4 ++-- components/places/src/Shutdown.cpp | 6 ++++++ components/places/src/nsFaviconService.cpp | 15 +++++++------ components/places/src/nsPlacesModule.cpp | 1 + components/rdf/moz.build | 2 +- components/rdf/src/nsRDFXMLDataSource.cpp | 2 ++ 27 files changed, 68 insertions(+), 49 deletions(-) diff --git a/components/alerts/moz.build b/components/alerts/moz.build index 286391d99..13b269b1d 100644 --- a/components/alerts/moz.build +++ b/components/alerts/moz.build @@ -12,7 +12,7 @@ EXPORTS.mozilla += [ 'src/AlertNotificationIPCSerializer.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'src/AlertNotification.cpp', 'src/nsAlertsService.cpp', 'src/nsAlertsUtils.cpp', diff --git a/components/alerts/src/nsAlertsService.cpp b/components/alerts/src/nsAlertsService.cpp index 4f248c861..aa1c266f9 100644 --- a/components/alerts/src/nsAlertsService.cpp +++ b/components/alerts/src/nsAlertsService.cpp @@ -13,6 +13,7 @@ #include "nsXPCOM.h" #include "nsIServiceManager.h" #include "nsIDOMWindow.h" +#include "nsIURI.h" #include "nsPromiseFlatString.h" #include "nsToolkitCompsCID.h" diff --git a/components/alerts/src/nsXULAlerts.h b/components/alerts/src/nsXULAlerts.h index 557716ee6..a4f44c7b0 100644 --- a/components/alerts/src/nsXULAlerts.h +++ b/components/alerts/src/nsXULAlerts.h @@ -9,6 +9,8 @@ #include "nsCycleCollectionParticipant.h" #include "nsDataHashtable.h" #include "nsHashKeys.h" +#include "nsTArray.h" +#include "nsIAlertsService.h" #include "nsInterfaceHashtable.h" #include "mozIDOMWindow.h" diff --git a/components/appshell/moz.build b/components/appshell/moz.build index b81b329fe..5644fa9e3 100644 --- a/components/appshell/moz.build +++ b/components/appshell/moz.build @@ -15,7 +15,7 @@ XPIDL_SOURCES += [ EXPORTS += ['src/nsAppShellCID.h'] -UNIFIED_SOURCES += [ +SOURCES += [ 'src/nsAppShellFactory.cpp', 'src/nsAppShellService.cpp', 'src/nsAppShellWindowEnumerator.cpp', diff --git a/components/appshell/src/nsWindowMediator.h b/components/appshell/src/nsWindowMediator.h index a0eaab56d..5936323df 100644 --- a/components/appshell/src/nsWindowMediator.h +++ b/components/appshell/src/nsWindowMediator.h @@ -13,6 +13,7 @@ #include "nsXPIDLString.h" #include "nsWeakReference.h" #include "nsCOMArray.h" +#include "nsPIDOMWindow.h" class nsAppShellWindowEnumerator; class nsASXULWindowEarlyToLateEnumerator; diff --git a/components/appshell/src/nsXULWindow.cpp b/components/appshell/src/nsXULWindow.cpp index 45403b2b0..307d4034d 100644 --- a/components/appshell/src/nsXULWindow.cpp +++ b/components/appshell/src/nsXULWindow.cpp @@ -63,6 +63,7 @@ #include "mozilla/dom/TabParent.h" using namespace mozilla; +using namespace mozilla::dom; using dom::AutoNoJSAPI; #define SIZEMODE_NORMAL NS_LITERAL_STRING("normal") diff --git a/components/autocomplete/moz.build b/components/autocomplete/moz.build index 7ea920144..c892842c4 100644 --- a/components/autocomplete/moz.build +++ b/components/autocomplete/moz.build @@ -14,7 +14,7 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'autocomplete' -UNIFIED_SOURCES += [ +SOURCES += [ 'nsAutoCompleteController.cpp', 'nsAutoCompleteSimpleResult.cpp', ] diff --git a/components/autocomplete/nsAutoCompleteSimpleResult.cpp b/components/autocomplete/nsAutoCompleteSimpleResult.cpp index 683ac462a..a04cd647c 100644 --- a/components/autocomplete/nsAutoCompleteSimpleResult.cpp +++ b/components/autocomplete/nsAutoCompleteSimpleResult.cpp @@ -16,31 +16,6 @@ NS_IMPL_ISUPPORTS(nsAutoCompleteSimpleResult, nsIAutoCompleteResult, 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() : mDefaultIndex(-1), mSearchResult(RESULT_NOMATCH), diff --git a/components/autocomplete/nsAutoCompleteSimpleResult.h b/components/autocomplete/nsAutoCompleteSimpleResult.h index 61ee542e4..07c5be829 100644 --- a/components/autocomplete/nsAutoCompleteSimpleResult.h +++ b/components/autocomplete/nsAutoCompleteSimpleResult.h @@ -13,7 +13,30 @@ #include "nsTArray.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 { diff --git a/components/filewatcher/moz.build b/components/filewatcher/moz.build index 5fb1c4570..42feb3d83 100644 --- a/components/filewatcher/moz.build +++ b/components/filewatcher/moz.build @@ -9,7 +9,7 @@ XPIDL_SOURCES += ['nsINativeFileWatcher.idl'] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': EXPORTS += ['NativeFileWatcherWin.h'] - UNIFIED_SOURCES += ['NativeFileWatcherWin.cpp'] + SOURCES += ['NativeFileWatcherWin.cpp'] else: EXPORTS += ['NativeFileWatcherNotSupported.h'] diff --git a/components/htmlfive/moz.build b/components/htmlfive/moz.build index 802463f49..90005d73f 100644 --- a/components/htmlfive/moz.build +++ b/components/htmlfive/moz.build @@ -3,10 +3,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/. -# Because this is largely done by codegen the policies regarding the -# traditional structure and reverting UNIFIED_SOURCES are hereby rescinded -# for this component. - XPIDL_SOURCES += [ 'nsIParserUtils.idl', 'nsIScriptableUnescapeHTML.idl', @@ -59,7 +55,7 @@ EXPORTS += [ 'nsParserUtils.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'nsHtml5Atom.cpp', 'nsHtml5Atoms.cpp', 'nsHtml5AtomTable.cpp', diff --git a/components/htmlfive/nsHtml5SpeculativeLoad.h b/components/htmlfive/nsHtml5SpeculativeLoad.h index 1f4a61741..e5fad05a7 100644 --- a/components/htmlfive/nsHtml5SpeculativeLoad.h +++ b/components/htmlfive/nsHtml5SpeculativeLoad.h @@ -7,6 +7,8 @@ #include "nsString.h" #include "nsContentUtils.h" +#include "nsHtml5String.h" +#include "nsHtml5DocumentMode.h" class nsHtml5TreeOpExecutor; diff --git a/components/htmlfive/nsHtml5TokenizerCppSupplement.h b/components/htmlfive/nsHtml5TokenizerCppSupplement.h index 343fceadd..8a38318fc 100644 --- a/components/htmlfive/nsHtml5TokenizerCppSupplement.h +++ b/components/htmlfive/nsHtml5TokenizerCppSupplement.h @@ -4,6 +4,8 @@ #include "mozilla/Likely.h" +using namespace mozilla; + // INT32_MAX is (2^31)-1. Therefore, the highest power-of-two that fits // is 2^30. Note that this is counting char16_t units. The underlying // bytes will be twice that, but they fit even in 32-bit size_t even diff --git a/components/htmlfive/nsHtml5TreeBuilderCppSupplement.h b/components/htmlfive/nsHtml5TreeBuilderCppSupplement.h index c973478e0..27ec86c7f 100644 --- a/components/htmlfive/nsHtml5TreeBuilderCppSupplement.h +++ b/components/htmlfive/nsHtml5TreeBuilderCppSupplement.h @@ -10,6 +10,8 @@ #include "mozilla/Likely.h" #include "mozilla/UniquePtr.h" +using namespace mozilla; + nsHtml5TreeBuilder::nsHtml5TreeBuilder(nsHtml5OplessBuilder* aBuilder) : scriptingEnabled(false) , fragment(false) diff --git a/components/htmlfive/nsHtml5TreeOpExecutor.cpp b/components/htmlfive/nsHtml5TreeOpExecutor.cpp index a7a8f28f9..8cf22d804 100644 --- a/components/htmlfive/nsHtml5TreeOpExecutor.cpp +++ b/components/htmlfive/nsHtml5TreeOpExecutor.cpp @@ -15,6 +15,7 @@ #include "nsIDocShellTreeItem.h" #include "nsIDocShell.h" #include "nsIDOMDocument.h" +#include "nsINestedURI.h" #include "nsIScriptGlobalObject.h" #include "nsIWebShellServices.h" #include "nsContentUtils.h" diff --git a/components/mediasniffer/moz.build b/components/mediasniffer/moz.build index fcbb1af56..f18862da3 100644 --- a/components/mediasniffer/moz.build +++ b/components/mediasniffer/moz.build @@ -5,7 +5,7 @@ EXPORTS += ['nsMediaSniffer.h'] -UNIFIED_SOURCES += [ +SOURCES += [ 'mp3sniff.c', 'nsMediaSniffer.cpp', 'nsMediaSnifferModule.cpp', diff --git a/components/perfmonitoring/moz.build b/components/perfmonitoring/moz.build index 51fb42690..5955d0f21 100644 --- a/components/perfmonitoring/moz.build +++ b/components/perfmonitoring/moz.build @@ -11,7 +11,7 @@ EXPORTS += ['nsPerformanceStats.h'] LOCAL_INCLUDES += ['/dom/base'] -UNIFIED_SOURCES += ['nsPerformanceStats.cpp'] +SOURCES += ['nsPerformanceStats.cpp'] EXTRA_JS_MODULES += [ 'AddonWatcher.jsm', diff --git a/components/permissions/moz.build b/components/permissions/moz.build index e25484d9f..f69794386 100644 --- a/components/permissions/moz.build +++ b/components/permissions/moz.build @@ -13,7 +13,7 @@ XPIDL_SOURCES += [ 'public/nsIPermissionManager.idl', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'src/nsContentBlocker.cpp', 'src/nsCookiePermission.cpp', 'src/nsCookiePromptService.cpp', diff --git a/components/permissions/src/nsPermission.cpp b/components/permissions/src/nsPermission.cpp index 3d1eb140a..4f0a408ce 100644 --- a/components/permissions/src/nsPermission.cpp +++ b/components/permissions/src/nsPermission.cpp @@ -4,9 +4,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsPermission.h" + #include "nsContentUtils.h" #include "nsIClassInfoImpl.h" #include "nsIEffectiveTLDService.h" +#include "nsNetUtil.h" #include "mozilla/BasePrincipal.h" // nsPermission Implementation diff --git a/components/permissions/src/nsPermission.h b/components/permissions/src/nsPermission.h index 6beb8aef4..857b7521c 100644 --- a/components/permissions/src/nsPermission.h +++ b/components/permissions/src/nsPermission.h @@ -8,6 +8,7 @@ #include "nsIPermission.h" #include "nsString.h" +#include "nsCOMPtr.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/components/places/moz.build b/components/places/moz.build index 2be099873..ef8c98f77 100644 --- a/components/places/moz.build +++ b/components/places/moz.build @@ -27,7 +27,7 @@ if CONFIG['MOZ_PLACES']: 'src/History.h', ] - UNIFIED_SOURCES += [ + SOURCES += [ 'src/Database.cpp', 'src/FaviconHelpers.cpp', 'src/Helpers.cpp', diff --git a/components/places/src/SQLFunctions.cpp b/components/places/src/SQLFunctions.cpp index e3cc7d7f0..c9b8e8522 100644 --- a/components/places/src/SQLFunctions.cpp +++ b/components/places/src/SQLFunctions.cpp @@ -1,5 +1,4 @@ -/* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : - * This Source Code Form is subject to the terms of the Mozilla Public +/* 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/. */ @@ -15,6 +14,7 @@ #include "nsINavHistoryService.h" #include "nsPrintfCString.h" #include "nsNavHistory.h" +#include "nsNavBookmarks.h" #include "mozilla/Likely.h" #include "nsVariant.h" #include "mozilla/HashFunctions.h" diff --git a/components/places/src/Shutdown.cpp b/components/places/src/Shutdown.cpp index 43586542b..1cbd6e3fb 100644 --- a/components/places/src/Shutdown.cpp +++ b/components/places/src/Shutdown.cpp @@ -3,6 +3,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Shutdown.h" + +#include "nsComponentManagerUtils.h" +#include "nsIObserverService.h" +#include "nsIWritablePropertyBag2.h" +#include "nsVariant.h" +#include "mozilla/Services.h" #include "mozilla/Unused.h" namespace mozilla { diff --git a/components/places/src/nsFaviconService.cpp b/components/places/src/nsFaviconService.cpp index e310db214..173c10d7a 100644 --- a/components/places/src/nsFaviconService.cpp +++ b/components/places/src/nsFaviconService.cpp @@ -29,6 +29,7 @@ #include "mozilla/Preferences.h" #include "nsILoadInfo.h" #include "nsIContentPolicy.h" +#include "nsIProtocolHandler.h" #include "nsContentUtils.h" #include "nsNullPrincipal.h" @@ -406,13 +407,13 @@ nsFaviconService::ReplaceFaviconDataFromDataURL(nsIURI* aFaviconURI, NS_ENSURE_TRUE(loadingPrincipal, NS_ERROR_FAILURE); nsCOMPtr loadInfo = - new mozilla::LoadInfo(loadingPrincipal, - nullptr, // aTriggeringPrincipal - nullptr, // aLoadingNode - nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS | - nsILoadInfo::SEC_ALLOW_CHROME | - nsILoadInfo::SEC_DISALLOW_SCRIPT, - nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON); + new mozilla::net::LoadInfo(loadingPrincipal, + nullptr, // aTriggeringPrincipal + nullptr, // aLoadingNode + nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS | + nsILoadInfo::SEC_ALLOW_CHROME | + nsILoadInfo::SEC_DISALLOW_SCRIPT, + nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON); nsCOMPtr channel; rv = protocolHandler->NewChannel2(dataURI, loadInfo, getter_AddRefs(channel)); diff --git a/components/places/src/nsPlacesModule.cpp b/components/places/src/nsPlacesModule.cpp index 679d460b4..d5aab9fed 100644 --- a/components/places/src/nsPlacesModule.cpp +++ b/components/places/src/nsPlacesModule.cpp @@ -7,6 +7,7 @@ #include "nsAnnoProtocolHandler.h" #include "nsAnnotationService.h" +#include "nsIPrincipal.h" #include "nsNavHistory.h" #include "nsNavBookmarks.h" #include "nsFaviconService.h" diff --git a/components/rdf/moz.build b/components/rdf/moz.build index 3d08b2ee2..28ee7cf88 100644 --- a/components/rdf/moz.build +++ b/components/rdf/moz.build @@ -36,7 +36,7 @@ EXPORTS += [ 'src/rdf.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'src/nsCompositeDataSource.cpp', 'src/nsContainerEnumerator.cpp', 'src/nsDefaultResourceFactory.cpp', diff --git a/components/rdf/src/nsRDFXMLDataSource.cpp b/components/rdf/src/nsRDFXMLDataSource.cpp index 0e9127420..3434bcb89 100644 --- a/components/rdf/src/nsRDFXMLDataSource.cpp +++ b/components/rdf/src/nsRDFXMLDataSource.cpp @@ -100,6 +100,8 @@ #include "rdfIDataSource.h" +using namespace mozilla; + //---------------------------------------------------------------------- // // RDFXMLDataSourceImpl -- cgit v1.2.3