diff --git a/docshell/base/nsDocShellTreeOwner.cpp b/docshell/base/nsDocShellTreeOwner.cpp index b49dfb63434c..45a3361defb7 100644 --- a/docshell/base/nsDocShellTreeOwner.cpp +++ b/docshell/base/nsDocShellTreeOwner.cpp @@ -48,6 +48,7 @@ #include "nsIConstraintValidation.h" #include "mozilla/Attributes.h" #include "mozilla/EventListenerManager.h" +#include "mozilla/Try.h" #include "mozilla/dom/DragEvent.h" #include "mozilla/dom/Event.h" // for Event #include "mozilla/dom/File.h" // for input type=file diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 9777ed010364..d5b18ac09cc9 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -62,6 +62,7 @@ #include "mozilla/StaticPrefs_full_screen_api.h" #include "mozilla/TextControlElement.h" #include "mozilla/TextEvents.h" +#include "mozilla/Try.h" #include "mozilla/TypedEnumBits.h" #include "mozilla/Unused.h" #include "mozilla/dom/AnimatableBinding.h" diff --git a/dom/base/EventSource.cpp b/dom/base/EventSource.cpp index 7ca5977e7d69..6f5105560be2 100644 --- a/dom/base/EventSource.cpp +++ b/dom/base/EventSource.cpp @@ -21,6 +21,7 @@ #include "mozilla/dom/WorkerScope.h" #include "mozilla/dom/EventSourceEventService.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtrExtensions.h" #include "nsComponentManagerUtils.h" #include "nsIThreadRetargetableStreamListener.h" diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index 8dc88d4afcd3..c596cd6d2441 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -35,6 +35,7 @@ #include "mozilla/StackWalk.h" #include "mozilla/StaticPrefs_dom.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "nsCOMPtr.h" #include "nsDebug.h" diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 5862f3553952..d02f5e5c2c3e 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -70,6 +70,7 @@ #include "mozilla/Services.h" #include "mozilla/Unused.h" #include "mozilla/StaticPrefs_full_screen_api.h" +#include "mozilla/Try.h" #include "mozilla/widget/IMEData.h" #include diff --git a/dom/base/nsWindowMemoryReporter.cpp b/dom/base/nsWindowMemoryReporter.cpp index 3b28aae2a668..5958c61a9ac6 100644 --- a/dom/base/nsWindowMemoryReporter.cpp +++ b/dom/base/nsWindowMemoryReporter.cpp @@ -15,6 +15,7 @@ #include "mozilla/Services.h" #include "mozilla/StaticPtr.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "mozilla/ResultExtensions.h" #include "nsNetCID.h" #include "nsPrintfCString.h" diff --git a/dom/clients/manager/ClientSource.cpp b/dom/clients/manager/ClientSource.cpp index 871de5af237a..c5465d949cc4 100644 --- a/dom/clients/manager/ClientSource.cpp +++ b/dom/clients/manager/ClientSource.cpp @@ -12,6 +12,7 @@ #include "ClientSourceChild.h" #include "ClientState.h" #include "ClientValidation.h" +#include "mozilla/Try.h" #include "mozilla/dom/BlobURLProtocolHandler.h" #include "mozilla/dom/ClientIPCTypes.h" #include "mozilla/dom/DOMMozPromiseRequestHolder.h" diff --git a/dom/html/HTMLFrameSetElement.cpp b/dom/html/HTMLFrameSetElement.cpp index d2b4a0b9ec1f..d6a794698b51 100644 --- a/dom/html/HTMLFrameSetElement.cpp +++ b/dom/html/HTMLFrameSetElement.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "HTMLFrameSetElement.h" +#include "mozilla/Try.h" #include "mozilla/dom/HTMLFrameSetElementBinding.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/EventHandlerBinding.h" diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index b7f1d94def94..266180e478e7 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -30,6 +30,7 @@ #include "mozilla/PresShell.h" #include "mozilla/StaticPrefs_dom.h" #include "mozilla/TextUtils.h" +#include "mozilla/Try.h" #include "nsAttrValueInlines.h" #include "nsCRTGlue.h" #include "nsIFilePicker.h" diff --git a/dom/ipc/MemMapSnapshot.cpp b/dom/ipc/MemMapSnapshot.cpp index 7a104c420e45..53accfdb1bec 100644 --- a/dom/ipc/MemMapSnapshot.cpp +++ b/dom/ipc/MemMapSnapshot.cpp @@ -8,6 +8,7 @@ #include "mozilla/AutoMemMap.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/ipc/FileDescriptor.h" namespace mozilla::ipc { diff --git a/dom/ipc/SharedMap.cpp b/dom/ipc/SharedMap.cpp index 70e12784e925..fcf5ed7da093 100644 --- a/dom/ipc/SharedMap.cpp +++ b/dom/ipc/SharedMap.cpp @@ -19,6 +19,7 @@ #include "mozilla/dom/ScriptSettings.h" #include "mozilla/IOBuffers.h" #include "mozilla/ScriptPreloader.h" +#include "mozilla/Try.h" using namespace mozilla::loader; diff --git a/dom/ipc/SharedStringMap.cpp b/dom/ipc/SharedStringMap.cpp index 9525c9f285cb..8d50de686339 100644 --- a/dom/ipc/SharedStringMap.cpp +++ b/dom/ipc/SharedStringMap.cpp @@ -10,6 +10,7 @@ #include "ScriptPreloader-inl.h" #include "mozilla/BinarySearch.h" +#include "mozilla/Try.h" #include "mozilla/ipc/FileDescriptor.h" using namespace mozilla::loader; diff --git a/dom/media/flac/FlacFrameParser.cpp b/dom/media/flac/FlacFrameParser.cpp index c042a7d3349d..ac7a04017e86 100644 --- a/dom/media/flac/FlacFrameParser.cpp +++ b/dom/media/flac/FlacFrameParser.cpp @@ -11,6 +11,7 @@ #include "VideoUtils.h" #include "BufferReader.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" namespace mozilla { diff --git a/dom/media/mediasource/ContainerParser.cpp b/dom/media/mediasource/ContainerParser.cpp index 4297ffda0e8f..bb856f6eda51 100644 --- a/dom/media/mediasource/ContainerParser.cpp +++ b/dom/media/mediasource/ContainerParser.cpp @@ -13,7 +13,7 @@ #include "MoofParser.h" #include "mozilla/Logging.h" #include "mozilla/Maybe.h" -#include "mozilla/Result.h" +#include "mozilla/Try.h" #include "MediaData.h" #include "nsMimeTypes.h" #include "AtomType.h" diff --git a/dom/media/mp3/MP3FrameParser.cpp b/dom/media/mp3/MP3FrameParser.cpp index 9701aa2f8f7c..33f76de9e1b1 100644 --- a/dom/media/mp3/MP3FrameParser.cpp +++ b/dom/media/mp3/MP3FrameParser.cpp @@ -14,6 +14,7 @@ #include "mozilla/EndianUtils.h" #include "mozilla/ResultExtensions.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "VideoUtils.h" extern mozilla::LazyLogModule gMediaDemuxerLog; diff --git a/dom/media/mp4/MoofParser.cpp b/dom/media/mp4/MoofParser.cpp index 46dfc95bbb62..c266c561482c 100644 --- a/dom/media/mp4/MoofParser.cpp +++ b/dom/media/mp4/MoofParser.cpp @@ -11,6 +11,7 @@ #include "mozilla/CheckedInt.h" #include "mozilla/HelperMacros.h" #include "mozilla/Logging.h" +#include "mozilla/Try.h" extern mozilla::LogModule* GetDemuxerLog(); diff --git a/dom/media/mp4/SinfParser.cpp b/dom/media/mp4/SinfParser.cpp index 4ea14adaaac2..f6da3b587daa 100644 --- a/dom/media/mp4/SinfParser.cpp +++ b/dom/media/mp4/SinfParser.cpp @@ -2,6 +2,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/. */ +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "SinfParser.h" #include "AtomType.h" diff --git a/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp b/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp index 978ec0f2b408..5fd95c8748b6 100644 --- a/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp +++ b/dom/media/platforms/agnostic/bytestreams/AnnexB.cpp @@ -5,6 +5,7 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/EndianUtils.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "AnnexB.h" #include "BufferReader.h" diff --git a/dom/media/platforms/agnostic/bytestreams/H264.cpp b/dom/media/platforms/agnostic/bytestreams/H264.cpp index a29ffbc46756..1fe73dfbb6bb 100644 --- a/dom/media/platforms/agnostic/bytestreams/H264.cpp +++ b/dom/media/platforms/agnostic/bytestreams/H264.cpp @@ -14,6 +14,7 @@ #include "mozilla/ArrayUtils.h" #include "mozilla/PodOperations.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #define READSE(var, min, max) \ { \ diff --git a/dom/media/webcodecs/VideoDecoder.cpp b/dom/media/webcodecs/VideoDecoder.cpp index 6c6125f71b98..adc408a5fef9 100644 --- a/dom/media/webcodecs/VideoDecoder.cpp +++ b/dom/media/webcodecs/VideoDecoder.cpp @@ -21,6 +21,7 @@ #include "mozilla/Logging.h" #include "mozilla/Maybe.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/dom/DOMException.h" #include "mozilla/dom/EncodedVideoChunk.h" diff --git a/dom/media/webcodecs/VideoFrame.cpp b/dom/media/webcodecs/VideoFrame.cpp index 58f5aa76b70c..920e49f7986c 100644 --- a/dom/media/webcodecs/VideoFrame.cpp +++ b/dom/media/webcodecs/VideoFrame.cpp @@ -16,9 +16,9 @@ #include "WebCodecsUtils.h" #include "js/StructuredClone.h" #include "mozilla/Maybe.h" -#include "mozilla/Result.h" #include "mozilla/ResultVariant.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "mozilla/dom/CanvasUtils.h" diff --git a/dom/prototype/PrototypeDocumentContentSink.cpp b/dom/prototype/PrototypeDocumentContentSink.cpp index 2094609f75ca..29195c2d8992 100644 --- a/dom/prototype/PrototypeDocumentContentSink.cpp +++ b/dom/prototype/PrototypeDocumentContentSink.cpp @@ -52,6 +52,7 @@ #include "mozilla/PresShell.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/RefPtr.h" +#include "mozilla/Try.h" #include "nsXULPrototypeCache.h" #include "nsXULElement.h" diff --git a/dom/quota/QuotaCommon.h b/dom/quota/QuotaCommon.h index 1df3f7f66866..b672150b96f4 100644 --- a/dom/quota/QuotaCommon.h +++ b/dom/quota/QuotaCommon.h @@ -21,8 +21,8 @@ #include "mozilla/Likely.h" #include "mozilla/MacroArgs.h" #include "mozilla/Maybe.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #if defined(QM_LOG_ERROR_ENABLED) && defined(QM_ERROR_STACKS_ENABLED) # include "mozilla/Variant.h" #endif diff --git a/dom/serviceworkers/FetchEventOpProxyParent.cpp b/dom/serviceworkers/FetchEventOpProxyParent.cpp index b4e6c0d1bc91..9a67b4239c85 100644 --- a/dom/serviceworkers/FetchEventOpProxyParent.cpp +++ b/dom/serviceworkers/FetchEventOpProxyParent.cpp @@ -15,8 +15,8 @@ #include "mozilla/Assertions.h" #include "mozilla/DebugOnly.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "mozilla/Unused.h" #include "mozilla/dom/InternalResponse.h" diff --git a/dom/svg/SVGAnimatedLengthList.cpp b/dom/svg/SVGAnimatedLengthList.cpp index d5281f1ce110..7f2aab8465de 100644 --- a/dom/svg/SVGAnimatedLengthList.cpp +++ b/dom/svg/SVGAnimatedLengthList.cpp @@ -11,6 +11,7 @@ #include "DOMSVGAnimatedLengthList.h" #include "SVGLengthListSMILType.h" #include "mozilla/SMILValue.h" +#include "mozilla/Try.h" #include "mozilla/dom/SVGElement.h" #include "mozilla/dom/SVGLengthBinding.h" diff --git a/dom/svg/SVGAnimatedNumberList.cpp b/dom/svg/SVGAnimatedNumberList.cpp index c9092f56edd4..e1b114485720 100644 --- a/dom/svg/SVGAnimatedNumberList.cpp +++ b/dom/svg/SVGAnimatedNumberList.cpp @@ -11,6 +11,7 @@ #include "DOMSVGAnimatedNumberList.h" #include "SVGNumberListSMILType.h" #include "mozilla/SMILValue.h" +#include "mozilla/Try.h" #include "mozilla/dom/SVGElement.h" using namespace mozilla::dom; diff --git a/dom/system/IOUtils.cpp b/dom/system/IOUtils.cpp index 74fd14df6b54..8ba4e7738949 100644 --- a/dom/system/IOUtils.cpp +++ b/dom/system/IOUtils.cpp @@ -30,6 +30,7 @@ #include "mozilla/Span.h" #include "mozilla/StaticPtr.h" #include "mozilla/TextUtils.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/Utf8.h" #include "mozilla/dom/BindingUtils.h" diff --git a/dom/system/PathUtils.cpp b/dom/system/PathUtils.cpp index a160f30cdf3d..24d7b648db8c 100644 --- a/dom/system/PathUtils.cpp +++ b/dom/system/PathUtils.cpp @@ -13,9 +13,9 @@ #include "mozilla/Maybe.h" #include "mozilla/MozPromise.h" #include "mozilla/RefPtr.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" #include "mozilla/Span.h" +#include "mozilla/Try.h" #include "mozilla/dom/DOMParser.h" #include "mozilla/dom/PathUtilsBinding.h" #include "mozilla/dom/Promise.h" diff --git a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp index 524f496d359f..dea0b98023ba 100644 --- a/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp +++ b/dom/webbrowserpersist/WebBrowserPersistLocalDocument.cpp @@ -25,6 +25,7 @@ #include "mozilla/dom/BrowserParent.h" #include "mozilla/dom/TreeWalker.h" #include "mozilla/Encoding.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "nsComponentManagerUtils.h" #include "nsContentUtils.h" diff --git a/dom/workers/loader/ScriptResponseHeaderProcessor.cpp b/dom/workers/loader/ScriptResponseHeaderProcessor.cpp index 30b9d4261350..6dc5c9e1ef40 100644 --- a/dom/workers/loader/ScriptResponseHeaderProcessor.cpp +++ b/dom/workers/loader/ScriptResponseHeaderProcessor.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ScriptResponseHeaderProcessor.h" +#include "mozilla/Try.h" #include "mozilla/dom/WorkerScope.h" namespace mozilla { diff --git a/dom/xslt/xslt/txMozillaXMLOutput.cpp b/dom/xslt/xslt/txMozillaXMLOutput.cpp index 0a5d2b3e4106..4aa51d9928a0 100644 --- a/dom/xslt/xslt/txMozillaXMLOutput.cpp +++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp @@ -27,6 +27,7 @@ #include "mozilla/dom/Element.h" #include "mozilla/dom/ScriptLoader.h" #include "mozilla/Encoding.h" +#include "mozilla/Try.h" #include "nsContentUtils.h" #include "nsDocElementCreatedNotificationRunner.h" #include "txXMLUtils.h" diff --git a/dom/xul/XULMenuBarElement.cpp b/dom/xul/XULMenuBarElement.cpp index ffb7adc7842b..f32698b3cd6f 100644 --- a/dom/xul/XULMenuBarElement.cpp +++ b/dom/xul/XULMenuBarElement.cpp @@ -11,6 +11,7 @@ #include "mozilla/Assertions.h" #include "mozilla/dom/BindContext.h" #include "mozilla/AsyncEventDispatcher.h" +#include "mozilla/Try.h" namespace mozilla::dom { diff --git a/editor/composer/nsEditingSession.cpp b/editor/composer/nsEditingSession.cpp index 72435ded4593..cf904a70fadc 100644 --- a/editor/composer/nsEditingSession.cpp +++ b/editor/composer/nsEditingSession.cpp @@ -12,6 +12,7 @@ #include "mozilla/HTMLEditor.h" // for HTMLEditor #include "mozilla/mozalloc.h" // for operator new #include "mozilla/PresShell.h" // for PresShell +#include "mozilla/Try.h" // for MOZ_TRY #include "nsAString.h" #include "nsBaseCommandController.h" // for nsBaseCommandController #include "nsCommandManager.h" // for nsCommandManager diff --git a/editor/libeditor/TextEditor.cpp b/editor/libeditor/TextEditor.cpp index 2f6ed65f2b72..fab0da334e90 100644 --- a/editor/libeditor/TextEditor.cpp +++ b/editor/libeditor/TextEditor.cpp @@ -29,6 +29,7 @@ #include "mozilla/TextComposition.h" #include "mozilla/TextEvents.h" #include "mozilla/TextServicesDocument.h" +#include "mozilla/Try.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/Selection.h" diff --git a/extensions/pref/autoconfig/src/nsAutoConfig.cpp b/extensions/pref/autoconfig/src/nsAutoConfig.cpp index 907d4b7646f4..c558d2e02128 100644 --- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp +++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp @@ -29,6 +29,7 @@ #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/Logging.h" #include "mozilla/SpinEventLoopUntil.h" +#include "mozilla/Try.h" using mozilla::LogLevel; diff --git a/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp b/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp index 16cefcd4d8a0..61d2f50887ec 100644 --- a/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp +++ b/extensions/spellcheck/hunspell/glue/mozHunspellRLBoxHost.cpp @@ -8,6 +8,7 @@ #include "mozHunspellRLBoxHost.h" #include "mozilla/DebugOnly.h" +#include "mozilla/Try.h" #include "nsContentUtils.h" #include "nsILoadInfo.h" #include "nsNetUtil.h" diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index 1c27cf45bc6f..0171f892b280 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -16,6 +16,7 @@ #include "mozilla/Preferences.h" // for Preferences #include "mozilla/Services.h" // for GetObserverService #include "mozilla/StaticPrefs_layout.h" +#include "mozilla/Try.h" // for MOZ_TRY #include "mozilla/mozalloc.h" // for operator new #include "mozilla/widget/Screen.h" // for Screen #include "nsCRT.h" // for nsCRT diff --git a/intl/components/gtest/TestString.cpp b/intl/components/gtest/TestString.cpp index 5b4d24b3b791..f97fafb0b40c 100644 --- a/intl/components/gtest/TestString.cpp +++ b/intl/components/gtest/TestString.cpp @@ -6,6 +6,7 @@ #include "mozilla/intl/String.h" #include "mozilla/Span.h" #include "mozilla/TextUtils.h" +#include "mozilla/Try.h" #include diff --git a/intl/components/src/DateTimeFormat.h b/intl/components/src/DateTimeFormat.h index b3e32cd2761f..4853d9e3b282 100644 --- a/intl/components/src/DateTimeFormat.h +++ b/intl/components/src/DateTimeFormat.h @@ -13,8 +13,8 @@ #include "mozilla/intl/DateTimePart.h" #include "mozilla/intl/DateTimePatternGenerator.h" #include "mozilla/Maybe.h" -#include "mozilla/Result.h" #include "mozilla/Span.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "mozilla/Utf8.h" #include "mozilla/Variant.h" diff --git a/intl/components/src/IDNA.h b/intl/components/src/IDNA.h index 2e507b98fa0d..77db2bc2ac7f 100644 --- a/intl/components/src/IDNA.h +++ b/intl/components/src/IDNA.h @@ -4,6 +4,7 @@ #ifndef intl_components_IDNA_h_ #define intl_components_IDNA_h_ +#include "mozilla/Try.h" #include "mozilla/intl/ICU4CGlue.h" #include "unicode/uidna.h" diff --git a/intl/components/src/ListFormat.h b/intl/components/src/ListFormat.h index 4952512f97e1..f6476c1334fc 100644 --- a/intl/components/src/ListFormat.h +++ b/intl/components/src/ListFormat.h @@ -7,7 +7,7 @@ #include "mozilla/CheckedInt.h" #include "mozilla/intl/ICU4CGlue.h" #include "mozilla/PodOperations.h" -#include "mozilla/Result.h" +#include "mozilla/Try.h" #include "mozilla/Vector.h" #include "unicode/ulistformatter.h" diff --git a/intl/components/src/Locale.h b/intl/components/src/Locale.h index 478d5f4a9e9e..1f4e06f54341 100644 --- a/intl/components/src/Locale.h +++ b/intl/components/src/Locale.h @@ -13,10 +13,10 @@ #include "mozilla/Maybe.h" #include "mozilla/Span.h" #include "mozilla/TextUtils.h" +#include "mozilla/Try.h" #include "mozilla/TypedEnumBits.h" #include "mozilla/Variant.h" #include "mozilla/Vector.h" -#include "mozilla/Result.h" #include #include diff --git a/intl/components/src/NumberFormat.cpp b/intl/components/src/NumberFormat.cpp index 6575c7a032b4..4d9dbc0cbfc8 100644 --- a/intl/components/src/NumberFormat.cpp +++ b/intl/components/src/NumberFormat.cpp @@ -1,6 +1,7 @@ /* 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/Try.h" #include "mozilla/intl/NumberFormat.h" #include "NumberFormatFields.h" #include "NumberFormatterSkeleton.h" diff --git a/intl/components/src/NumberRangeFormat.cpp b/intl/components/src/NumberRangeFormat.cpp index bf82e36c3365..9de8982c726d 100644 --- a/intl/components/src/NumberRangeFormat.cpp +++ b/intl/components/src/NumberRangeFormat.cpp @@ -4,6 +4,7 @@ #include "mozilla/intl/NumberRangeFormat.h" +#include "mozilla/Try.h" #include "mozilla/intl/ICU4CGlue.h" #include "mozilla/intl/NumberFormat.h" #include "NumberFormatFields.h" diff --git a/intl/components/src/RelativeTimeFormat.h b/intl/components/src/RelativeTimeFormat.h index 94c2db692744..4d4cf2e60efc 100644 --- a/intl/components/src/RelativeTimeFormat.h +++ b/intl/components/src/RelativeTimeFormat.h @@ -4,6 +4,7 @@ #ifndef intl_components_RelativeTimeFormat_h_ #define intl_components_RelativeTimeFormat_h_ +#include "mozilla/Try.h" #include "mozilla/intl/ICU4CGlue.h" #include "mozilla/intl/ICUError.h" #include "mozilla/intl/NumberPart.h" diff --git a/intl/components/src/String.h b/intl/components/src/String.h index f07acd6578fd..c44c6b344335 100644 --- a/intl/components/src/String.h +++ b/intl/components/src/String.h @@ -10,8 +10,8 @@ #include "mozilla/intl/ICU4CGlue.h" #include "mozilla/intl/ICUError.h" #include "mozilla/PodOperations.h" -#include "mozilla/Result.h" #include "mozilla/Span.h" +#include "mozilla/Try.h" #include "unicode/uchar.h" #include "unicode/unorm2.h" diff --git a/intl/strres/nsStringBundle.cpp b/intl/strres/nsStringBundle.cpp index 320d122c72fe..31ecbc3d0019 100644 --- a/intl/strres/nsStringBundle.cpp +++ b/intl/strres/nsStringBundle.cpp @@ -31,7 +31,7 @@ #include "mozilla/ClearOnShutdown.h" #include "mozilla/ResultExtensions.h" #include "mozilla/URLPreloader.h" -#include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/dom/ContentParent.h" #include "mozilla/dom/ipc/SharedStringMap.h" diff --git a/js/src/frontend/StencilXdr.cpp b/js/src/frontend/StencilXdr.cpp index 58f2d1e71a68..ceef64dc3ea3 100644 --- a/js/src/frontend/StencilXdr.cpp +++ b/js/src/frontend/StencilXdr.cpp @@ -9,6 +9,7 @@ #include "mozilla/ArrayUtils.h" // mozilla::ArrayEqual #include "mozilla/OperatorNewExtensions.h" // mozilla::KnownNotNull #include "mozilla/ScopeExit.h" // mozilla::MakeScopeExit +#include "mozilla/Try.h" // MOZ_TRY #include // size_t #include // uint8_t, uint16_t, uint32_t diff --git a/js/src/jit/WarpOracle.cpp b/js/src/jit/WarpOracle.cpp index 3e8a7c3e6c24..0e72de30a6a8 100644 --- a/js/src/jit/WarpOracle.cpp +++ b/js/src/jit/WarpOracle.cpp @@ -7,6 +7,7 @@ #include "jit/WarpOracle.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include diff --git a/js/src/vm/BigIntType.cpp b/js/src/vm/BigIntType.cpp index 380a0741f8c4..df4ea62c538b 100644 --- a/js/src/vm/BigIntType.cpp +++ b/js/src/vm/BigIntType.cpp @@ -87,6 +87,7 @@ #include "mozilla/Range.h" #include "mozilla/RangedPtr.h" #include "mozilla/Span.h" // mozilla::Span +#include "mozilla/Try.h" #include "mozilla/WrappingOperations.h" #include diff --git a/js/src/vm/JSObject.cpp b/js/src/vm/JSObject.cpp index 147bf1a27ad0..b7327c281133 100644 --- a/js/src/vm/JSObject.cpp +++ b/js/src/vm/JSObject.cpp @@ -11,6 +11,7 @@ #include "vm/JSObject-inl.h" #include "mozilla/MemoryReporting.h" +#include "mozilla/Try.h" #include diff --git a/js/src/vm/Xdr.h b/js/src/vm/Xdr.h index c37d94627a18..8a1de3c6a48e 100644 --- a/js/src/vm/Xdr.h +++ b/js/src/vm/Xdr.h @@ -9,7 +9,7 @@ #include "mozilla/Assertions.h" // MOZ_ASSERT, MOZ_CRASH #include "mozilla/MaybeOneOf.h" // mozilla::MaybeOneOf -#include "mozilla/Result.h" // mozilla::{Result, Ok, Err}, MOZ_TRY +#include "mozilla/Try.h" // MOZ_TRY #include "mozilla/Utf8.h" // mozilla::Utf8Unit #include // size_t diff --git a/js/src/wasm/WasmSerialize.cpp b/js/src/wasm/WasmSerialize.cpp index e05aea5bf6ce..52535f90a781 100644 --- a/js/src/wasm/WasmSerialize.cpp +++ b/js/src/wasm/WasmSerialize.cpp @@ -9,6 +9,7 @@ #include "mozilla/EnumeratedRange.h" #include "mozilla/Maybe.h" #include "mozilla/RefPtr.h" +#include "mozilla/Try.h" #include "mozilla/Vector.h" #include diff --git a/js/xpconnect/loader/AutoMemMap.cpp b/js/xpconnect/loader/AutoMemMap.cpp index f8c75ea44583..424a8b42dd16 100644 --- a/js/xpconnect/loader/AutoMemMap.cpp +++ b/js/xpconnect/loader/AutoMemMap.cpp @@ -8,6 +8,7 @@ #include "ScriptPreloader-inl.h" #include "mozilla/Unused.h" +#include "mozilla/Try.h" #include "mozilla/ipc/FileDescriptor.h" #include "nsIFile.h" diff --git a/js/xpconnect/loader/ScriptPreloader.cpp b/js/xpconnect/loader/ScriptPreloader.cpp index 54846be33c0f..790c5f4f0176 100644 --- a/js/xpconnect/loader/ScriptPreloader.cpp +++ b/js/xpconnect/loader/ScriptPreloader.cpp @@ -24,6 +24,7 @@ #include "mozilla/StaticPrefs_javascript.h" #include "mozilla/TaskController.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/dom/ContentParent.h" diff --git a/js/xpconnect/loader/URLPreloader.cpp b/js/xpconnect/loader/URLPreloader.cpp index c5bcbad5bb89..695f524d42a0 100644 --- a/js/xpconnect/loader/URLPreloader.cpp +++ b/js/xpconnect/loader/URLPreloader.cpp @@ -15,6 +15,7 @@ #include "mozilla/Logging.h" #include "mozilla/ScopeExit.h" #include "mozilla/Services.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/Vector.h" #include "mozilla/scache/StartupCache.h" diff --git a/js/xpconnect/loader/mozJSModuleLoader.cpp b/js/xpconnect/loader/mozJSModuleLoader.cpp index c02453f0d783..79c22d23cb93 100644 --- a/js/xpconnect/loader/mozJSModuleLoader.cpp +++ b/js/xpconnect/loader/mozJSModuleLoader.cpp @@ -65,6 +65,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/ScriptPreloader.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "mozilla/dom/AutoEntryScript.h" #include "mozilla/dom/ReferrerPolicyBinding.h" #include "mozilla/dom/ScriptSettings.h" diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 13700591efa1..b0c52b75d63c 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -32,6 +32,7 @@ #include "mozilla/BasePrincipal.h" #include "mozilla/TimeStamp.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/URLPreloader.h" #include "mozilla/dom/DOMException.h" #include "mozilla/dom/DOMExceptionBinding.h" diff --git a/js/xpconnect/src/XPCWrappedJSIterator.cpp b/js/xpconnect/src/XPCWrappedJSIterator.cpp index a901050a4b39..0e980311ffd4 100644 --- a/js/xpconnect/src/XPCWrappedJSIterator.cpp +++ b/js/xpconnect/src/XPCWrappedJSIterator.cpp @@ -7,6 +7,7 @@ #include "xpcprivate.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/dom/IteratorResultBinding.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ScriptSettings.h" diff --git a/js/xpconnect/tests/components/native/xpctest_module.cpp b/js/xpconnect/tests/components/native/xpctest_module.cpp index 98ee300e4868..42b4259d5bac 100644 --- a/js/xpconnect/tests/components/native/xpctest_module.cpp +++ b/js/xpconnect/tests/components/native/xpctest_module.cpp @@ -8,6 +8,7 @@ #include "mozilla/GenericFactory.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "nsComponentManager.h" #include "xpctest_private.h" diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 944e9fb96d7c..6f52c80927a9 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -39,6 +39,7 @@ #include "mozilla/StaticPrefs_image.h" #include "mozilla/StaticPrefs_layout.h" #include "mozilla/StaticPrefs_toolkit.h" +#include "mozilla/Try.h" #include "mozilla/TextEvents.h" #include "mozilla/TimeStamp.h" #include "mozilla/TouchEvents.h" diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index cfcdfce3491f..3bd1816faea8 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -56,6 +56,7 @@ #include "mozilla/StaticPrefs_print.h" #include "mozilla/StyleSheet.h" #include "mozilla/StyleSheetInlines.h" +#include "mozilla/Try.h" #include "nsViewManager.h" #include "nsView.h" diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 9e38c7a04527..81c9b4102fd8 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -46,6 +46,7 @@ #include "mozilla/dom/Text.h" #include "mozilla/MathAlgorithms.h" #include "mozilla/StaticPrefs_layout.h" +#include "mozilla/Try.h" #include "nsFrameSelection.h" #define DEFAULT_COLUMN_WIDTH 20 diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index dd8fc08606a5..b3598bc4a3eb 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -42,6 +42,7 @@ #include "mozilla/SVGIntegrationUtils.h" #include "mozilla/SVGUtils.h" #include "mozilla/ToString.h" +#include "mozilla/Try.h" #include "mozilla/ViewportUtils.h" #include "nsCOMPtr.h" diff --git a/layout/inspector/inDeepTreeWalker.cpp b/layout/inspector/inDeepTreeWalker.cpp index 98a1d8a262e3..07b866887fb3 100644 --- a/layout/inspector/inDeepTreeWalker.cpp +++ b/layout/inspector/inDeepTreeWalker.cpp @@ -7,6 +7,7 @@ #include "inDeepTreeWalker.h" #include "inLayoutUtils.h" +#include "mozilla/Try.h" #include "mozilla/dom/CSSStyleRule.h" #include "mozilla/dom/Document.h" #include "mozilla/dom/Element.h" diff --git a/layout/printing/nsPrintJob.cpp b/layout/printing/nsPrintJob.cpp index 399664ca7fa1..205a6388958b 100644 --- a/layout/printing/nsPrintJob.cpp +++ b/layout/printing/nsPrintJob.cpp @@ -27,6 +27,7 @@ #include "mozilla/PresShellInlines.h" #include "mozilla/StaticPrefs_print.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "nsIBrowserChild.h" #include "nsIOService.h" #include "nsIScriptGlobalObject.h" diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 74e810907edf..91878f9120bd 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -64,6 +64,7 @@ #include "mozilla/SharedStyleSheetCache.h" #include "mozilla/StaticPrefs_layout.h" #include "mozilla/StaticPrefs_dom.h" +#include "mozilla/Try.h" #include "ReferrerInfo.h" #include "nsXULPrototypeCache.h" diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 3511d05593e0..5b3145ac299d 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -17,6 +17,7 @@ #include "mozilla/MouseEvents.h" #include "mozilla/PresShell.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/intl/Segmenter.h" #include "gfxUtils.h" diff --git a/mfbt/Result.h b/mfbt/Result.h index cc4f87826934..929279046b78 100644 --- a/mfbt/Result.h +++ b/mfbt/Result.h @@ -829,33 +829,4 @@ inline constexpr auto Err(E&& aErrorValue) { } // namespace mozilla -/** - * MOZ_TRY(expr) is the C++ equivalent of Rust's `try!(expr);`. First, it - * evaluates expr, which must produce a Result value. On success, it - * discards the result altogether. On error, it immediately returns an error - * Result from the enclosing function. - */ -#define MOZ_TRY(expr) \ - do { \ - auto mozTryTempResult_ = ::mozilla::ToResult(expr); \ - if (MOZ_UNLIKELY(mozTryTempResult_.isErr())) { \ - return mozTryTempResult_.propagateErr(); \ - } \ - } while (0) - -/** - * MOZ_TRY_VAR(target, expr) is the C++ equivalent of Rust's `target = - * try!(expr);`. First, it evaluates expr, which must produce a Result value. On - * success, the result's success value is assigned to target. On error, - * immediately returns the error result. |target| must be an lvalue. - */ -#define MOZ_TRY_VAR(target, expr) \ - do { \ - auto mozTryVarTempResult_ = (expr); \ - if (MOZ_UNLIKELY(mozTryVarTempResult_.isErr())) { \ - return mozTryVarTempResult_.propagateErr(); \ - } \ - (target) = mozTryVarTempResult_.unwrap(); \ - } while (0) - #endif // mozilla_Result_h diff --git a/mfbt/Try.h b/mfbt/Try.h new file mode 100644 index 000000000000..a650a33ea275 --- /dev/null +++ b/mfbt/Try.h @@ -0,0 +1,41 @@ +/* -*- 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/. */ + +#ifndef mozilla_Try_h +#define mozilla_Try_h + +#include "mozilla/Result.h" + +/** + * MOZ_TRY(expr) is the C++ equivalent of Rust's `try!(expr);`. First, it + * evaluates expr, which must produce a Result value. On success, it + * discards the result altogether. On error, it immediately returns an error + * Result from the enclosing function. + */ +#define MOZ_TRY(expr) \ + do { \ + auto mozTryTempResult_ = ::mozilla::ToResult(expr); \ + if (MOZ_UNLIKELY(mozTryTempResult_.isErr())) { \ + return mozTryTempResult_.propagateErr(); \ + } \ + } while (0) + +/** + * MOZ_TRY_VAR(target, expr) is the C++ equivalent of Rust's `target = + * try!(expr);`. First, it evaluates expr, which must produce a Result value. On + * success, the result's success value is assigned to target. On error, + * immediately returns the error result. |target| must be an lvalue. + */ +#define MOZ_TRY_VAR(target, expr) \ + do { \ + auto mozTryVarTempResult_ = (expr); \ + if (MOZ_UNLIKELY(mozTryVarTempResult_.isErr())) { \ + return mozTryVarTempResult_.propagateErr(); \ + } \ + (target) = mozTryVarTempResult_.unwrap(); \ + } while (0) + +#endif // mozilla_Try_h diff --git a/mfbt/moz.build b/mfbt/moz.build index 3d5b7bcee997..52e99e77dacd 100644 --- a/mfbt/moz.build +++ b/mfbt/moz.build @@ -114,6 +114,7 @@ EXPORTS.mozilla = [ "ThreadSafety.h", "ThreadSafeWeakPtr.h", "ToString.h", + "Try.h", "TypedEnumBits.h", "Types.h", "UniquePtr.h", diff --git a/mfbt/tests/TestResult.cpp b/mfbt/tests/TestResult.cpp index 20680e41c832..22da6d29fd50 100644 --- a/mfbt/tests/TestResult.cpp +++ b/mfbt/tests/TestResult.cpp @@ -6,6 +6,7 @@ #include #include "mozilla/ResultVariant.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" using mozilla::Err; diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index 4505d6ecab46..d61fd9e6b5f2 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -42,6 +42,7 @@ #include "mozilla/SyncRunnable.h" #include "mozilla/Telemetry.h" #include "mozilla/TelemetryEventEnums.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtrExtensions.h" #include "mozilla/URLPreloader.h" #include "mozilla/Variant.h" diff --git a/modules/libpref/SharedPrefMap.cpp b/modules/libpref/SharedPrefMap.cpp index 81f8d9248537..7782ffdcbf56 100644 --- a/modules/libpref/SharedPrefMap.cpp +++ b/modules/libpref/SharedPrefMap.cpp @@ -10,6 +10,7 @@ #include "mozilla/BinarySearch.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/ipc/FileDescriptor.h" using namespace mozilla::loader; diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp index 84e1c18381a9..9f41ca7bd297 100644 --- a/mozglue/android/APKOpen.cpp +++ b/mozglue/android/APKOpen.cpp @@ -38,6 +38,7 @@ #include "mozilla/Printf.h" #include "mozilla/Sprintf.h" #include "mozilla/TimeStamp.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "XREChildData.h" diff --git a/mozglue/misc/PreXULSkeletonUI.cpp b/mozglue/misc/PreXULSkeletonUI.cpp index 1ed0a18a14c0..1b17837fc171 100644 --- a/mozglue/misc/PreXULSkeletonUI.cpp +++ b/mozglue/misc/PreXULSkeletonUI.cpp @@ -28,6 +28,7 @@ #include "mozilla/mscom/ProcessRuntime.h" #include "mozilla/ResultVariant.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "mozilla/UniquePtrExtensions.h" #include "mozilla/Unused.h" diff --git a/netwerk/base/SimpleChannel.cpp b/netwerk/base/SimpleChannel.cpp index 07d54c5f4ec2..6297331135e1 100644 --- a/netwerk/base/SimpleChannel.cpp +++ b/netwerk/base/SimpleChannel.cpp @@ -14,6 +14,7 @@ #include "nsISupportsImpl.h" #include "nsNetUtil.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/net/NeckoChild.h" diff --git a/netwerk/base/nsPACMan.cpp b/netwerk/base/nsPACMan.cpp index ccd5ef45a8ad..0cf66c8ee6da 100644 --- a/netwerk/base/nsPACMan.cpp +++ b/netwerk/base/nsPACMan.cpp @@ -20,10 +20,10 @@ #include "nsIOService.h" #include "nsNetUtil.h" #include "nsThreadUtils.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" #include "mozilla/StaticPrefs_network.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" //----------------------------------------------------------------------------- diff --git a/netwerk/dns/nsEffectiveTLDService.cpp b/netwerk/dns/nsEffectiveTLDService.cpp index a43552b1b3f2..9e7030c16111 100644 --- a/netwerk/dns/nsEffectiveTLDService.cpp +++ b/netwerk/dns/nsEffectiveTLDService.cpp @@ -13,6 +13,7 @@ #include "mozilla/MemoryReporting.h" #include "mozilla/ResultExtensions.h" #include "mozilla/TextUtils.h" +#include "mozilla/Try.h" #include "MainThreadUtils.h" #include "nsContentUtils.h" diff --git a/netwerk/protocol/about/nsAboutProtocolUtils.h b/netwerk/protocol/about/nsAboutProtocolUtils.h index 68d1f4d54b3a..fdc92620f354 100644 --- a/netwerk/protocol/about/nsAboutProtocolUtils.h +++ b/netwerk/protocol/about/nsAboutProtocolUtils.h @@ -5,6 +5,7 @@ #ifndef nsAboutProtocolUtils_h #define nsAboutProtocolUtils_h +#include "mozilla/Try.h" #include "nsIURI.h" #include "nsString.h" #include "nsReadableUtils.h" diff --git a/netwerk/protocol/data/nsDataHandler.cpp b/netwerk/protocol/data/nsDataHandler.cpp index f108f9dc6a29..aba013ef4bb8 100644 --- a/netwerk/protocol/data/nsDataHandler.cpp +++ b/netwerk/protocol/data/nsDataHandler.cpp @@ -14,6 +14,7 @@ #include "nsUnicharUtils.h" #include "mozilla/dom/MimeType.h" #include "mozilla/StaticPrefs_network.h" +#include "mozilla/Try.h" using namespace mozilla; diff --git a/netwerk/protocol/res/ExtensionProtocolHandler.cpp b/netwerk/protocol/res/ExtensionProtocolHandler.cpp index 5f03d344af66..5400bf24fbf0 100644 --- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp +++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp @@ -19,6 +19,7 @@ #include "mozilla/Omnijar.h" #include "mozilla/RefPtr.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "FileDescriptorFile.h" #include "LoadInfo.h" diff --git a/netwerk/protocol/res/PageThumbProtocolHandler.cpp b/netwerk/protocol/res/PageThumbProtocolHandler.cpp index 065fd7c36e94..5918b40fadb3 100644 --- a/netwerk/protocol/res/PageThumbProtocolHandler.cpp +++ b/netwerk/protocol/res/PageThumbProtocolHandler.cpp @@ -12,6 +12,7 @@ #include "mozilla/net/NeckoChild.h" #include "mozilla/RefPtr.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "LoadInfo.h" #include "nsContentUtils.h" diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp index 5c6e97b326bd..8fd3564974a7 100644 --- a/startupcache/StartupCache.cpp +++ b/startupcache/StartupCache.cpp @@ -15,6 +15,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/scache/StartupCache.h" #include "mozilla/ScopeExit.h" +#include "mozilla/Try.h" #include "nsClassHashtable.h" #include "nsComponentManagerUtils.h" diff --git a/toolkit/components/backgroundhangmonitor/HangDetails.cpp b/toolkit/components/backgroundhangmonitor/HangDetails.cpp index e8d3c9205b96..daa32205abbb 100644 --- a/toolkit/components/backgroundhangmonitor/HangDetails.cpp +++ b/toolkit/components/backgroundhangmonitor/HangDetails.cpp @@ -16,6 +16,7 @@ #include "mozilla/Unused.h" #include "mozilla/GfxMessageUtils.h" // For ParamTraits #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #ifdef MOZ_GECKO_PROFILER # include "shared-libraries.h" diff --git a/toolkit/components/extensions/ExtensionPolicyService.cpp b/toolkit/components/extensions/ExtensionPolicyService.cpp index a6541339bd0f..031abca444da 100644 --- a/toolkit/components/extensions/ExtensionPolicyService.cpp +++ b/toolkit/components/extensions/ExtensionPolicyService.cpp @@ -15,6 +15,7 @@ #include "mozilla/Services.h" #include "mozilla/SimpleEnumerator.h" #include "mozilla/StaticPrefs_extensions.h" +#include "mozilla/Try.h" #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/BrowsingContextGroup.h" #include "mozilla/dom/ContentChild.h" diff --git a/toolkit/components/extensions/WebExtensionPolicy.cpp b/toolkit/components/extensions/WebExtensionPolicy.cpp index 745217be56d2..23ec90b98cfa 100644 --- a/toolkit/components/extensions/WebExtensionPolicy.cpp +++ b/toolkit/components/extensions/WebExtensionPolicy.cpp @@ -14,6 +14,7 @@ #include "mozilla/dom/WindowGlobalChild.h" #include "mozilla/ResultExtensions.h" #include "mozilla/StaticPrefs_extensions.h" +#include "mozilla/Try.h" #include "nsContentUtils.h" #include "nsEscape.h" #include "nsGlobalWindowInner.h" diff --git a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp index 6645926d86b8..16d9c60aacdc 100644 --- a/toolkit/components/extensions/webrequest/ChannelWrapper.cpp +++ b/toolkit/components/extensions/webrequest/ChannelWrapper.cpp @@ -20,6 +20,7 @@ #include "mozilla/Components.h" #include "mozilla/ErrorNames.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/Event.h" diff --git a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp index 335115afbdd1..c63c2a4d0079 100644 --- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp +++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp @@ -12,6 +12,7 @@ #include "mozilla/dom/ContentParent.h" #include "mozilla/net/ChannelEventQueue.h" #include "mozilla/StaticPrefs_extensions.h" +#include "mozilla/Try.h" #include "nsHttpChannel.h" #include "nsIChannel.h" #include "nsIInputStream.h" diff --git a/toolkit/components/extensions/webrequest/WebNavigationContent.cpp b/toolkit/components/extensions/webrequest/WebNavigationContent.cpp index 5bac1bd213e4..9b7a53a3bca8 100644 --- a/toolkit/components/extensions/webrequest/WebNavigationContent.cpp +++ b/toolkit/components/extensions/webrequest/WebNavigationContent.cpp @@ -18,6 +18,7 @@ #include "mozilla/RefPtr.h" #include "mozilla/ResultExtensions.h" #include "mozilla/Services.h" +#include "mozilla/Try.h" #include "nsCRT.h" #include "nsDocShellLoadTypes.h" #include "nsPIWindowRoot.h" diff --git a/toolkit/components/nimbus/lib/NimbusFeatures.cpp b/toolkit/components/nimbus/lib/NimbusFeatures.cpp index 4b580149f518..58481526eddb 100644 --- a/toolkit/components/nimbus/lib/NimbusFeatures.cpp +++ b/toolkit/components/nimbus/lib/NimbusFeatures.cpp @@ -7,6 +7,7 @@ #include "mozilla/browser/NimbusFeatures.h" #include "mozilla/browser/NimbusFeatureManifest.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "mozilla/dom/ScriptSettings.h" #include "jsapi.h" #include "js/JSON.h" diff --git a/toolkit/components/places/PageIconProtocolHandler.cpp b/toolkit/components/places/PageIconProtocolHandler.cpp index ae8553271828..a2f1d60eddcb 100644 --- a/toolkit/components/places/PageIconProtocolHandler.cpp +++ b/toolkit/components/places/PageIconProtocolHandler.cpp @@ -7,6 +7,7 @@ #include "mozilla/NullPrincipal.h" #include "mozilla/ScopeExit.h" #include "mozilla/Components.h" +#include "mozilla/Try.h" #include "nsFaviconService.h" #include "nsStringStream.h" #include "nsStreamUtils.h" diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 26a414b5df26..3314cb813f6c 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -26,6 +26,7 @@ #include "mozilla/Preferences.h" #include "mozilla/ProfilerMarkers.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "GeckoProfiler.h" diff --git a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp index e501a2512eef..641339c3ea8c 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp @@ -21,6 +21,7 @@ #include "mozilla/Logging.h" #include "nsIInterfaceRequestor.h" #include "mozilla/Telemetry.h" +#include "mozilla/Try.h" #include "nsContentUtils.h" #include "nsIURLFormatter.h" #include "Classifier.h" diff --git a/toolkit/components/viaduct/ViaductRequest.cpp b/toolkit/components/viaduct/ViaductRequest.cpp index 7ddd2e7bf235..2e6c2369a53e 100644 --- a/toolkit/components/viaduct/ViaductRequest.cpp +++ b/toolkit/components/viaduct/ViaductRequest.cpp @@ -9,6 +9,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/ScopeExit.h" #include "mozilla/Services.h" +#include "mozilla/Try.h" #include "nsComponentManagerUtils.h" #include "nsContentUtils.h" diff --git a/toolkit/mozapps/defaultagent/Registry.cpp b/toolkit/mozapps/defaultagent/Registry.cpp index cfdf71cc24ff..a2153c50acc2 100644 --- a/toolkit/mozapps/defaultagent/Registry.cpp +++ b/toolkit/mozapps/defaultagent/Registry.cpp @@ -14,6 +14,7 @@ #include "UtfConvert.h" #include "mozilla/Buffer.h" +#include "mozilla/Try.h" namespace mozilla::default_agent { diff --git a/toolkit/mozapps/extensions/AddonManagerStartup.cpp b/toolkit/mozapps/extensions/AddonManagerStartup.cpp index d39796ad69e4..29b9d992413a 100644 --- a/toolkit/mozapps/extensions/AddonManagerStartup.cpp +++ b/toolkit/mozapps/extensions/AddonManagerStartup.cpp @@ -28,6 +28,7 @@ #include "mozilla/Unused.h" #include "mozilla/ErrorResult.h" #include "mozilla/Services.h" +#include "mozilla/Try.h" #include "mozilla/dom/ipc/StructuredCloneData.h" #include "nsAppDirectoryServiceDefs.h" diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index 45bac4838a8a..048386b507e8 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -65,6 +65,7 @@ #include "mozilla/SchedulerGroup.h" #include "mozilla/Services.h" #include "mozilla/StackWalk.h" +#include "mozilla/Try.h" #ifdef XP_WIN # include "mozilla/NativeNt.h" # include "mozilla/StackWalkThread.h" diff --git a/widget/DimensionRequest.cpp b/widget/DimensionRequest.cpp index 61d4ae5cf79a..4f2f667643e0 100644 --- a/widget/DimensionRequest.cpp +++ b/widget/DimensionRequest.cpp @@ -6,6 +6,7 @@ #include "nsIBaseWindow.h" #include "nsIDocShellTreeOwner.h" +#include "mozilla/Try.h" namespace mozilla { diff --git a/widget/RemoteLookAndFeel.cpp b/widget/RemoteLookAndFeel.cpp index 1f83b1a4d525..5eea54496b92 100644 --- a/widget/RemoteLookAndFeel.cpp +++ b/widget/RemoteLookAndFeel.cpp @@ -11,9 +11,9 @@ #include "MainThreadUtils.h" #include "mozilla/Assertions.h" #include "mozilla/ClearOnShutdown.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" #include "mozilla/StaticPrefs_widget.h" +#include "mozilla/Try.h" #include "nsXULAppAPI.h" #include diff --git a/widget/nsXPLookAndFeel.cpp b/widget/nsXPLookAndFeel.cpp index d30f3b4ed09b..6362fe1a0715 100644 --- a/widget/nsXPLookAndFeel.cpp +++ b/widget/nsXPLookAndFeel.cpp @@ -39,6 +39,7 @@ #include "mozilla/RelativeLuminanceUtils.h" #include "mozilla/Telemetry.h" #include "mozilla/TelemetryScalarEnums.h" +#include "mozilla/Try.h" #include "gfxPlatform.h" #include "gfxFont.h" diff --git a/xpcom/base/nsINIParser.cpp b/xpcom/base/nsINIParser.cpp index c1eec56f1057..1447aa6fbff2 100644 --- a/xpcom/base/nsINIParser.cpp +++ b/xpcom/base/nsINIParser.cpp @@ -10,6 +10,7 @@ #include "nsIFile.h" #include "nsINIParser.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/URLPreloader.h" using namespace mozilla; diff --git a/xpcom/base/nsMaybeWeakPtr.h b/xpcom/base/nsMaybeWeakPtr.h index 165a8c23c182..e3957a1c679f 100644 --- a/xpcom/base/nsMaybeWeakPtr.h +++ b/xpcom/base/nsMaybeWeakPtr.h @@ -7,6 +7,7 @@ #define nsMaybeWeakPtr_h_ #include "mozilla/Attributes.h" +#include "mozilla/Try.h" #include "nsCOMPtr.h" #include "nsIWeakReferenceUtils.h" #include "nsTArray.h" diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index b9b9ca136da0..44f2ad02b6fe 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -15,6 +15,7 @@ #include "mozilla/LazyIdleThread.h" #include "mozilla/LookAndFeel.h" #include "mozilla/Sprintf.h" +#include "mozilla/Try.h" #include "jsapi.h" #include "js/PropertyAndElement.h" // JS_SetProperty #include "mozilla/dom/Promise.h" diff --git a/xpcom/ds/nsObserverList.cpp b/xpcom/ds/nsObserverList.cpp index ba3eaaa2aa63..4f21c4fcc9ae 100644 --- a/xpcom/ds/nsObserverList.cpp +++ b/xpcom/ds/nsObserverList.cpp @@ -7,6 +7,7 @@ #include "nsObserverList.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "nsCOMArray.h" #include "xpcpublic.h" diff --git a/xpcom/ds/nsObserverService.cpp b/xpcom/ds/nsObserverService.cpp index 5ed81b01a7a8..e0fd430cd43d 100644 --- a/xpcom/ds/nsObserverService.cpp +++ b/xpcom/ds/nsObserverService.cpp @@ -24,6 +24,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/Telemetry.h" #include "mozilla/TimeStamp.h" +#include "mozilla/Try.h" #include "nsString.h" // Log module for nsObserverService logging... diff --git a/xpcom/ds/nsSimpleEnumerator.cpp b/xpcom/ds/nsSimpleEnumerator.cpp index 7f7ca9d6747d..0be7b684b788 100644 --- a/xpcom/ds/nsSimpleEnumerator.cpp +++ b/xpcom/ds/nsSimpleEnumerator.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ToJSValue.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "nsContentUtils.h" using namespace mozilla; diff --git a/xpcom/ds/nsStringEnumerator.cpp b/xpcom/ds/nsStringEnumerator.cpp index 7b8cf72d002b..34576c7f50f2 100644 --- a/xpcom/ds/nsStringEnumerator.cpp +++ b/xpcom/ds/nsStringEnumerator.cpp @@ -9,6 +9,7 @@ #include "nsSupportsPrimitives.h" #include "mozilla/Attributes.h" #include "mozilla/ResultExtensions.h" +#include "mozilla/Try.h" #include "mozilla/dom/IteratorResultBinding.h" #include "mozilla/dom/RootedDictionary.h" #include "mozilla/dom/ToJSValue.h" diff --git a/xpcom/glue/standalone/nsXPCOMGlue.cpp b/xpcom/glue/standalone/nsXPCOMGlue.cpp index 0e2efb3197e8..dc0a905830c7 100644 --- a/xpcom/glue/standalone/nsXPCOMGlue.cpp +++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp @@ -11,7 +11,7 @@ #include #include "mozilla/FileUtils.h" -#include "mozilla/Result.h" +#include "mozilla/Try.h" #include "mozilla/UniquePtr.h" #include "mozilla/UniquePtrExtensions.h" diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp index 2abbbe4c0aab..9335ea081e43 100644 --- a/xpcom/io/SpecialSystemDirectory.cpp +++ b/xpcom/io/SpecialSystemDirectory.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "SpecialSystemDirectory.h" +#include "mozilla/Try.h" #include "nsString.h" #include "nsDependentString.h" #include "nsIXULAppInfo.h" diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h index d54dcafd7b12..0b4022823f4f 100644 --- a/xpcom/string/nsTSubstring.h +++ b/xpcom/string/nsTSubstring.h @@ -18,9 +18,9 @@ #include "mozilla/Maybe.h" #include "mozilla/MemoryReporting.h" #include "mozilla/IntegerTypeTraits.h" -#include "mozilla/Result.h" #include "mozilla/ResultExtensions.h" #include "mozilla/Span.h" +#include "mozilla/Try.h" #include "mozilla/Unused.h" #include "nsTStringRepr.h" @@ -1446,8 +1446,8 @@ static_assert(sizeof(nsTSubstring) == * Span integration */ namespace mozilla { -Span(const nsTSubstring&)->Span; -Span(const nsTSubstring&)->Span; +Span(const nsTSubstring&) -> Span; +Span(const nsTSubstring&) -> Span; } // namespace mozilla diff --git a/xpcom/threads/CPUUsageWatcher.cpp b/xpcom/threads/CPUUsageWatcher.cpp index 922ca81e8d6c..66579b6f4485 100644 --- a/xpcom/threads/CPUUsageWatcher.cpp +++ b/xpcom/threads/CPUUsageWatcher.cpp @@ -5,6 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozilla/CPUUsageWatcher.h" +#include "mozilla/Try.h" #include "prsystem.h" diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index 99d9b624361a..b350e9c0a9be 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -17,6 +17,7 @@ #include "mozilla/ResultExtensions.h" #include "mozilla/Sprintf.h" #include "mozilla/StaticMutex.h" +#include "mozilla/Try.h" #include "nsThreadManager.h" #include "nsThreadUtils.h" #include "pratom.h" diff --git a/xpfe/appshell/AppWindow.cpp b/xpfe/appshell/AppWindow.cpp index ea2b70294263..4c6728890687 100644 --- a/xpfe/appshell/AppWindow.cpp +++ b/xpfe/appshell/AppWindow.cpp @@ -20,6 +20,7 @@ #include "nsQueryObject.h" #include "mozilla/ProfilerLabels.h" #include "mozilla/Sprintf.h" +#include "mozilla/Try.h" // Interfaces needed to be included #include "nsGlobalWindowOuter.h" diff --git a/xpfe/appshell/nsAppShellService.cpp b/xpfe/appshell/nsAppShellService.cpp index d174144e52e6..7a21178caa80 100644 --- a/xpfe/appshell/nsAppShellService.cpp +++ b/xpfe/appshell/nsAppShellService.cpp @@ -33,6 +33,7 @@ #include "mozilla/StartupTimeline.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/StaticPrefs_fission.h" +#include "mozilla/Try.h" #include "mozilla/intl/LocaleService.h" #include "mozilla/dom/BrowsingContext.h" #include "mozilla/dom/Document.h" diff --git a/xpfe/appshell/nsChromeTreeOwner.cpp b/xpfe/appshell/nsChromeTreeOwner.cpp index a84c3faa908a..9c34cd20b9ce 100644 --- a/xpfe/appshell/nsChromeTreeOwner.cpp +++ b/xpfe/appshell/nsChromeTreeOwner.cpp @@ -17,6 +17,7 @@ #include "nsIAuthPrompt.h" #include "nsIWebProgress.h" #include "nsIWidget.h" +#include "mozilla/Try.h" #include "mozilla/dom/Element.h" using namespace mozilla; diff --git a/xpfe/appshell/nsContentTreeOwner.cpp b/xpfe/appshell/nsContentTreeOwner.cpp index fbb5872499de..62b3d1945313 100644 --- a/xpfe/appshell/nsContentTreeOwner.cpp +++ b/xpfe/appshell/nsContentTreeOwner.cpp @@ -39,6 +39,7 @@ #endif #include "mozilla/Preferences.h" +#include "mozilla/Try.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/ScriptSettings.h"