diff options
author | Moonchild <moonchild@palemoon.org> | 2022-03-05 10:15:48 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-03-21 13:24:30 +0000 |
commit | 830d28b5902b1957569a1a99446bea80feadc0f1 (patch) | |
tree | b5994e9a0cf77cdd6dfa9efaf18e127e2a696e58 | |
parent | 01d7205460e87008ffb1d668123973cb9a47b116 (diff) | |
download | aura-central-830d28b5902b1957569a1a99446bea80feadc0f1.tar.gz |
Issue %2 - De-unify sources in xpcom (1 of 2)
26 files changed, 48 insertions, 42 deletions
diff --git a/xpcom/base/DebuggerOnGCRunnable.cpp b/xpcom/base/DebuggerOnGCRunnable.cpp index f3218d596..62e04a246 100644 --- a/xpcom/base/DebuggerOnGCRunnable.cpp +++ b/xpcom/base/DebuggerOnGCRunnable.cpp @@ -10,6 +10,8 @@ #include "mozilla/Move.h" #include "js/Debug.h" +using namespace mozilla::dom; + namespace mozilla { /* static */ nsresult diff --git a/xpcom/base/LogModulePrefWatcher.cpp b/xpcom/base/LogModulePrefWatcher.cpp index f4f6ba19f..71dd7f4c0 100644 --- a/xpcom/base/LogModulePrefWatcher.cpp +++ b/xpcom/base/LogModulePrefWatcher.cpp @@ -7,6 +7,8 @@ #include "mozilla/Logging.h" #include "mozilla/Preferences.h" +#include "mozilla/Services.h" +#include "nsIObserverService.h" #include "nsString.h" #include "nsXULAppAPI.h" #include "base/process_util.h" diff --git a/xpcom/base/Logging.cpp b/xpcom/base/Logging.cpp index 0d6ac38c8..d334a0303 100644 --- a/xpcom/base/Logging.cpp +++ b/xpcom/base/Logging.cpp @@ -27,6 +27,8 @@ #include <unistd.h> #endif +#include "base/process_util.h" + // NB: Initial amount determined by auditing the codebase for the total amount // of unique module names and padding up to the next power of 2. const uint32_t kInitialModuleCount = 256; @@ -133,9 +135,9 @@ ExpandPIDMarker(const char* aFilename, char (&buffer)[2048]) static const char kPIDToken[] = "%PID"; const char* pidTokenPtr = strstr(aFilename, kPIDToken); if (pidTokenPtr && - SprintfLiteral(buffer, "%.*s%s%d%s", + SprintfLiteral(buffer, "%.*s%s%s", static_cast<int>(pidTokenPtr - aFilename), aFilename, - XRE_IsParentProcess() ? "-main." : "-child.", + "-main.", base::GetCurrentProcId(), pidTokenPtr + strlen(kPIDToken)) > 0) { diff --git a/xpcom/base/moz.build b/xpcom/base/moz.build index 03a0fa43a..5857d4124 100644 --- a/xpcom/base/moz.build +++ b/xpcom/base/moz.build @@ -86,7 +86,7 @@ SOURCES += [ ] SOURCES['nsDebugImpl.cpp'].no_pgo = True -UNIFIED_SOURCES += [ +SOURCES += [ 'AvailableMemoryTracker.cpp', 'ClearOnShutdown.cpp', 'CycleCollectedJSContext.cpp', diff --git a/xpcom/base/nsConsoleService.cpp b/xpcom/base/nsConsoleService.cpp index 761bcc79b..513a7c37e 100644 --- a/xpcom/base/nsConsoleService.cpp +++ b/xpcom/base/nsConsoleService.cpp @@ -24,6 +24,7 @@ #include "nsISupportsPrimitives.h" #include "mozilla/Preferences.h" +#include "mozilla/Services.h" #ifdef XP_WIN #include <windows.h> diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h index 19a28b89b..be9e3669e 100644 --- a/xpcom/base/nsConsoleService.h +++ b/xpcom/base/nsConsoleService.h @@ -14,6 +14,8 @@ #include "mozilla/Mutex.h" #include "nsInterfaceHashtable.h" +#include "nsIObserver.h" +#include "nsIObserverService.h" #include "nsHashKeys.h" #include "nsIConsoleService.h" diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 8df3c3a6b..49eed1c7c 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -161,6 +161,7 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/Move.h" #include "mozilla/SegmentedVector.h" +#include "mozilla/Unused.h" #include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionNoteRootCallback.h" diff --git a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp index 14cad1300..df6746d41 100644 --- a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp +++ b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp @@ -3,9 +3,11 @@ * 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 "CycleCollectedJSContext.h" #include "nsCycleCollectionParticipant.h" #include "jsapi.h" #include "jsfriendapi.h" +#include "nsString.h" void CycleCollectionNoteEdgeNameImpl(nsCycleCollectionTraversalCallback& aCallback, diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 4397f470e..dbf8051ae 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -38,6 +38,7 @@ #endif using namespace mozilla; +using namespace mozilla::dom; #if defined(MOZ_MEMORY) # define HAVE_JEMALLOC_STATS 1 diff --git a/xpcom/base/nsMemoryReporterManager.h b/xpcom/base/nsMemoryReporterManager.h index 8899d322d..1069a3410 100644 --- a/xpcom/base/nsMemoryReporterManager.h +++ b/xpcom/base/nsMemoryReporterManager.h @@ -7,6 +7,7 @@ #define nsMemoryReporterManager_h__ #include "mozilla/Mutex.h" +#include "nsDataHashtable.h" #include "nsHashKeys.h" #include "nsIMemoryReporter.h" #include "nsITimer.h" diff --git a/xpcom/base/nsTraceRefcnt.cpp b/xpcom/base/nsTraceRefcnt.cpp index 5e9c87f07..847d8bad1 100644 --- a/xpcom/base/nsTraceRefcnt.cpp +++ b/xpcom/base/nsTraceRefcnt.cpp @@ -48,6 +48,8 @@ #include "prthread.h" +using namespace mozilla; + // We use a spin lock instead of a regular mutex because this lock is usually // only held for a very short time, and gets grabbed at a very high frequency // (~100000 times per second). On Mac, the overhead of using a regular lock diff --git a/xpcom/build/LateWriteChecks.cpp b/xpcom/build/LateWriteChecks.cpp index 218454c4d..21fdf325e 100644 --- a/xpcom/build/LateWriteChecks.cpp +++ b/xpcom/build/LateWriteChecks.cpp @@ -4,6 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <algorithm> +#include <vector> #include "mozilla/IOInterposer.h" #include "mozilla/PoisonIOInterposer.h" diff --git a/xpcom/build/MainThreadIOLogger.cpp b/xpcom/build/MainThreadIOLogger.cpp index 8f0302ec0..1f335c164 100644 --- a/xpcom/build/MainThreadIOLogger.cpp +++ b/xpcom/build/MainThreadIOLogger.cpp @@ -12,6 +12,7 @@ #include "mozilla/TimeStamp.h" #include "nsAutoPtr.h" #include "nsNativeCharsetUtils.h" +#include "nsString.h" /** * This code uses NSPR stuff and STL containers because it must be detached @@ -23,6 +24,8 @@ #include <prthread.h> #include <vector> +using namespace mozilla; + namespace { struct ObservationWithStack diff --git a/xpcom/build/moz.build b/xpcom/build/moz.build index 534fe7dd6..8abd331e8 100644 --- a/xpcom/build/moz.build +++ b/xpcom/build/moz.build @@ -36,15 +36,17 @@ else: include('../glue/objs.mozbuild') -UNIFIED_SOURCES += xpcom_gluens_src_cppsrcs -UNIFIED_SOURCES += xpcom_glue_src_cppsrcs +SOURCES += xpcom_gluens_src_cppsrcs +SOURCES += xpcom_glue_src_cppsrcs -UNIFIED_SOURCES += [ +SOURCES += [ + 'FileLocation.cpp', 'FrozenFunctions.cpp', 'IOInterposer.cpp', 'LateWriteChecks.cpp', 'MainThreadIOLogger.cpp', 'nsXPCOMStrings.cpp', + 'Omnijar.cpp', 'Services.cpp', 'XPCOMInit.cpp', ] @@ -54,13 +56,6 @@ if CONFIG['OS_ARCH'] != 'WINNT': 'NSPRInterposer.cpp', ] -# FileLocation.cpp and Omnijar.cpp cannot be built in unified mode because they -# use plarena.h. -SOURCES += [ - 'FileLocation.cpp', - 'Omnijar.cpp', -] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build index 724c60af7..60646f1aa 100644 --- a/xpcom/components/moz.build +++ b/xpcom/components/moz.build @@ -25,16 +25,10 @@ EXPORTS.mozilla += [ 'ModuleUtils.h', ] -# nsCategoryManager.cpp and nsComponentManager.cpp cannot be built in -# unified mode because they use thea PL_ARENA_CONST_ALIGN_MASK macro -# with plarena.h. SOURCES += [ + 'ManifestParser.cpp', 'nsCategoryManager.cpp', 'nsComponentManager.cpp', -] - -UNIFIED_SOURCES += [ - 'ManifestParser.cpp', 'nsNativeModuleLoader.cpp', ] diff --git a/xpcom/ds/moz.build b/xpcom/ds/moz.build index a06b2460d..8fece54d3 100644 --- a/xpcom/ds/moz.build +++ b/xpcom/ds/moz.build @@ -66,7 +66,7 @@ EXPORTS.mozilla += [ 'Tokenizer.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'IncrementalTokenizer.cpp', 'nsArray.cpp', 'nsAtomService.cpp', @@ -76,7 +76,9 @@ UNIFIED_SOURCES += [ 'nsINIParserImpl.cpp', 'nsObserverList.cpp', 'nsObserverService.cpp', + 'nsPersistentProperties.cpp', 'nsProperties.cpp', + 'nsStaticNameTable.cpp', 'nsStringEnumerator.cpp', 'nsSupportsArray.cpp', 'nsSupportsArrayEnumerator.cpp', @@ -85,13 +87,6 @@ UNIFIED_SOURCES += [ 'Tokenizer.cpp', ] -# These two files cannot be built in unified mode because they use the -# PL_ARENA_CONST_ALIGN_MASK macro with plarena.h. -SOURCES += [ - 'nsPersistentProperties.cpp', - 'nsStaticNameTable.cpp', -] - EXTRA_COMPONENTS += [ 'nsINIProcessor.js', 'nsINIProcessor.manifest', diff --git a/xpcom/glue/moz.build b/xpcom/glue/moz.build index e8848580d..c7b52d4b9 100644 --- a/xpcom/glue/moz.build +++ b/xpcom/glue/moz.build @@ -83,10 +83,10 @@ EXPORTS.mozilla += [ include('objs.mozbuild') -UNIFIED_SOURCES += xpcom_gluens_src_cppsrcs -UNIFIED_SOURCES += xpcom_glue_src_cppsrcs +SOURCES += xpcom_gluens_src_cppsrcs +SOURCES += xpcom_glue_src_cppsrcs -UNIFIED_SOURCES += [ +SOURCES += [ 'GenericModule.cpp', 'nsStringAPI.cpp', ] diff --git a/xpcom/glue/staticruntime/moz.build b/xpcom/glue/staticruntime/moz.build index a6323f95d..583c489a6 100644 --- a/xpcom/glue/staticruntime/moz.build +++ b/xpcom/glue/staticruntime/moz.build @@ -5,10 +5,10 @@ include('../objs.mozbuild') -UNIFIED_SOURCES += xpcom_gluens_src_cppsrcs -UNIFIED_SOURCES += xpcom_glue_src_cppsrcs +SOURCES += xpcom_gluens_src_cppsrcs +SOURCES += xpcom_glue_src_cppsrcs -UNIFIED_SOURCES += [ +SOURCES += [ '../GenericModule.cpp', '../nsStringAPI.cpp', ] diff --git a/xpcom/glue/tests/gtest/moz.build b/xpcom/glue/tests/gtest/moz.build index 639be848c..df517cdc3 100644 --- a/xpcom/glue/tests/gtest/moz.build +++ b/xpcom/glue/tests/gtest/moz.build @@ -3,7 +3,7 @@ # 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/. -UNIFIED_SOURCES += [ +SOURCES += [ 'TestArray.cpp', 'TestFileUtils.cpp', 'TestGCPostBarriers.cpp', diff --git a/xpcom/io/moz.build b/xpcom/io/moz.build index 467d61682..4c30c943e 100644 --- a/xpcom/io/moz.build +++ b/xpcom/io/moz.build @@ -84,9 +84,10 @@ EXPORTS.mozilla += [ 'SnappyUncompressInputStream.h', ] -UNIFIED_SOURCES += [ +SOURCES += [ 'Base64.cpp', 'crc32c.c', + 'FilePreferences.cpp', 'nsAnonymousTemporaryFile.cpp', 'nsAppFileLocationProvider.cpp', 'nsBinaryStream.cpp', @@ -114,10 +115,6 @@ UNIFIED_SOURCES += [ 'SpecialSystemDirectory.cpp', ] -SOURCES += [ - 'FilePreferences.cpp', -] - include('/ipc/chromium/chromium-config.mozbuild') FINAL_LIBRARY = 'xul' diff --git a/xpcom/io/nsEscape.cpp b/xpcom/io/nsEscape.cpp index 7a5e3a335..5bf6a988e 100644 --- a/xpcom/io/nsEscape.cpp +++ b/xpcom/io/nsEscape.cpp @@ -11,6 +11,8 @@ #include "nsCRT.h" #include "plstr.h" +using namespace mozilla; + static const char hexCharsUpper[] = "0123456789ABCDEF"; static const char hexCharsUpperLower[] = "0123456789ABCDEFabcdef"; diff --git a/xpcom/io/nsLinebreakConverter.cpp b/xpcom/io/nsLinebreakConverter.cpp index 62bcb54e2..d026faf38 100644 --- a/xpcom/io/nsLinebreakConverter.cpp +++ b/xpcom/io/nsLinebreakConverter.cpp @@ -463,7 +463,7 @@ nsLinebreakConverter::ConvertStringLineBreaks(nsString& aIoString, // remember the old buffer in case // we blow it away later nsString::char_iterator stringBuf; - if (!aIoString.BeginWriting(stringBuf, fallible)) { + if (!aIoString.BeginWriting(stringBuf, mozilla::fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/xpcom/io/nsLocalFileCommon.cpp b/xpcom/io/nsLocalFileCommon.cpp index a6d4a116e..0957528fb 100644 --- a/xpcom/io/nsLocalFileCommon.cpp +++ b/xpcom/io/nsLocalFileCommon.cpp @@ -11,6 +11,7 @@ #include "nsCOMPtr.h" #include "nsReadableUtils.h" #include "nsPrintfCString.h" +#include "nsTArray.h" #include "nsCRT.h" #include "nsNativeCharsetUtils.h" #include "nsUTF8Utils.h" diff --git a/xpcom/io/nsScriptableInputStream.cpp b/xpcom/io/nsScriptableInputStream.cpp index 0d1e5493c..11d26c4d6 100644 --- a/xpcom/io/nsScriptableInputStream.cpp +++ b/xpcom/io/nsScriptableInputStream.cpp @@ -80,7 +80,7 @@ nsScriptableInputStream::ReadBytes(uint32_t aCount, nsACString& aResult) return NS_ERROR_NOT_INITIALIZED; } - if (!aResult.SetLength(aCount, fallible)) { + if (!aResult.SetLength(aCount, mozilla::fallible)) { return NS_ERROR_OUT_OF_MEMORY; } diff --git a/xpcom/io/nsStorageStream.cpp b/xpcom/io/nsStorageStream.cpp index f1fe97f8f..ca9b0aefc 100644 --- a/xpcom/io/nsStorageStream.cpp +++ b/xpcom/io/nsStorageStream.cpp @@ -26,6 +26,7 @@ #include "mozilla/MathAlgorithms.h" #include "mozilla/ipc/InputStreamUtils.h" +using namespace mozilla; using mozilla::ipc::InputStreamParams; using mozilla::ipc::StringInputStreamParams; using mozilla::Maybe; diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp index 26cd46dc5..3baa0e7d1 100644 --- a/xpcom/io/nsStringStream.cpp +++ b/xpcom/io/nsStringStream.cpp @@ -23,6 +23,7 @@ #include "mozilla/ipc/InputStreamUtils.h" #include "nsIIPCSerializableInputStream.h" +using namespace mozilla; using namespace mozilla::ipc; using mozilla::Maybe; using mozilla::Some; |