mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
This commit is contained in:
parent
869025981e
commit
c458754592
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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 <algorithm>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mozilla/AutoMemMap.h"
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/Try.h"
|
||||
#include "mozilla/ipc/FileDescriptor.h"
|
||||
|
||||
namespace mozilla::ipc {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "VideoUtils.h"
|
||||
#include "BufferReader.h"
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/CheckedInt.h"
|
||||
#include "mozilla/HelperMacros.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
extern mozilla::LogModule* GetDemuxerLog();
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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) \
|
||||
{ \
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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 {
|
||||
|
@ -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"
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/dom/BindContext.h"
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/SpinEventLoopUntil.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
using mozilla::LogLevel;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mozHunspellRLBoxHost.h"
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/Try.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsILoadInfo.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -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
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "mozilla/intl/String.h"
|
||||
#include "mozilla/Span.h"
|
||||
#include "mozilla/TextUtils.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 <algorithm>
|
||||
#include <stddef.h>
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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 <stddef.h> // size_t
|
||||
#include <stdint.h> // uint8_t, uint16_t, uint32_t
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "jit/WarpOracle.h"
|
||||
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -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 <functional>
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "vm/JSObject-inl.h"
|
||||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
#include <string.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 <stddef.h> // size_t
|
||||
|
@ -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 <cstdint>
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "ScriptPreloader-inl.h"
|
||||
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/Try.h"
|
||||
#include "mozilla/ipc/FileDescriptor.h"
|
||||
#include "nsIFile.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "mozilla/GenericFactory.h"
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/Try.h"
|
||||
#include "nsComponentManager.h"
|
||||
#include "xpctest_private.h"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
41
mfbt/Try.h
Normal file
41
mfbt/Try.h
Normal file
@ -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
|
@ -114,6 +114,7 @@ EXPORTS.mozilla = [
|
||||
"ThreadSafety.h",
|
||||
"ThreadSafeWeakPtr.h",
|
||||
"ToString.h",
|
||||
"Try.h",
|
||||
"TypedEnumBits.h",
|
||||
"Types.h",
|
||||
"UniquePtr.h",
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <string.h>
|
||||
#include "mozilla/ResultVariant.h"
|
||||
#include "mozilla/Try.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
|
||||
using mozilla::Err;
|
||||
|
@ -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"
|
||||
|
@ -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;
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
@ -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"
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef nsAboutProtocolUtils_h
|
||||
#define nsAboutProtocolUtils_h
|
||||
|
||||
#include "mozilla/Try.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/dom/MimeType.h"
|
||||
#include "mozilla/StaticPrefs_network.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/GfxMessageUtils.h" // For ParamTraits<GeckoProcessType>
|
||||
#include "mozilla/ResultExtensions.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
# include "shared-libraries.h"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "UtfConvert.h"
|
||||
|
||||
#include "mozilla/Buffer.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
namespace mozilla::default_agent {
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "mozilla/Try.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -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 <limits>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user