WebKit Bugzilla
Attachment 357854 Details for
Bug 192948
: Use Optional::hasValue() instead of Optional::has_value()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192948-20181220131157.patch (text/plain), 36.26 KB, created by
Chris Dumez
on 2018-12-20 13:12:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-12-20 13:12:01 PST
Size:
36.26 KB
patch
obsolete
>Subversion Revision: 239461 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 49dadec856072ea9b02f3537233620f03a9ce9d8..308d4fff86facf52de4d21b36265221f243a7e63 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-20 Chris Dumez <cdumez@apple.com> >+ >+ Use Optional::hasValue() instead of Optional::has_value() >+ https://bugs.webkit.org/show_bug.cgi?id=192948 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py: >+ (CppBackendDispatcherImplementationGenerator._generate_async_dispatcher_class_for_domain): >+ (CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): >+ > 2018-12-20 Chris Dumez <cdumez@apple.com> > > Use Optional::valueOr() instead of Optional::value_or() >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 36a3eae2a209273ab1e71cd3aa7a8aeb32e0ea66..42a0dc80fefaff835b3d423dc8a537b1b19ab80f 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,14 @@ >+2018-12-20 Chris Dumez <cdumez@apple.com> >+ >+ Use Optional::hasValue() instead of Optional::has_value() >+ https://bugs.webkit.org/show_bug.cgi?id=192948 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Hasher.h: >+ (WTF::add): >+ * wtf/Optional.h: >+ > 2018-12-20 Chris Dumez <cdumez@apple.com> > > Use Optional::valueOr() instead of Optional::value_or() >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6c10bac620ed624c6f2f1c07551afd5f72f42b6b..7162733e496354439661504b75fa350edb118cc1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,33 @@ >+2018-12-20 Chris Dumez <cdumez@apple.com> >+ >+ Use Optional::hasValue() instead of Optional::has_value() >+ https://bugs.webkit.org/show_bug.cgi?id=192948 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * bindings/js/DOMPromiseProxy.h: >+ (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): >+ (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const): >+ (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): >+ * dom/DataTransferItemList.h: >+ (WebCore::DataTransferItemList::hasItems const): >+ * dom/EventTarget.cpp: >+ (WebCore::EventTarget::addEventListener): >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::captionDisplayMode): >+ * platform/graphics/MediaPlayer.cpp: >+ (WebCore::MediaPlayer::wouldTaintOrigin const): >+ * platform/graphics/gstreamer/mse/AppendPipeline.cpp: >+ (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): >+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: >+ (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): >+ * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: >+ (webKitMediaSrcUpdatePresentationSize): >+ * platform/mac/NSScrollerImpDetails.mm: >+ (WebCore::ScrollerStyle::recommendedScrollerStyle): >+ * rendering/RenderListItem.cpp: >+ (WebCore::RenderListItem::setExplicitValue): >+ > 2018-12-20 Chris Dumez <cdumez@apple.com> > > Use Optional::valueOr() instead of Optional::value_or() >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6f5c5959550a02b6e1ec4c74605ea0d6ff4b22ed..b8f0226f799ec07712c8c0c4447e0a3d35784546 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-20 Chris Dumez <cdumez@apple.com> >+ >+ Use Optional::hasValue() instead of Optional::has_value() >+ https://bugs.webkit.org/show_bug.cgi?id=192948 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/Automation/WebAutomationSession.cpp: >+ (WebKit::AutomationCommandError::toProtocolString): >+ (WebKit::WebAutomationSession::willClosePage): >+ * WebProcess/Automation/WebAutomationSessionProxy.cpp: >+ (WebKit::WebAutomationSessionProxy::computeElementLayout): >+ > 2018-12-20 Chris Dumez <cdumez@apple.com> > > Use Optional::valueOr() instead of Optional::value_or() >diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py >index e20aaf3fa780aacc3acec62c8d4d55252c43544c..a15961a64744e111b580c8d1a0fa80558ee1ce4b 100755 >--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py >+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py >@@ -169,7 +169,7 @@ class CppBackendDispatcherImplementationGenerator(CppGenerator): > > if parameter.is_optional: > if CppGenerator.should_use_wrapper_for_return_type(parameter.type): >- out_parameter_assignments.append(' if (%(parameterName)s.has_value())' % param_args) >+ out_parameter_assignments.append(' if (%(parameterName)s.hasValue())' % param_args) > out_parameter_assignments.append(' jsonMessage->%(keyedSetMethod)s("%(parameterKey)s"_s, *%(parameterName)s);' % param_args) > else: > out_parameter_assignments.append(' if (%(parameterName)s)' % param_args) >@@ -264,7 +264,7 @@ class CppBackendDispatcherImplementationGenerator(CppGenerator): > out_parameter_declarations.append(' %(parameterType)s out_%(parameterName)s;' % param_args) > if parameter.is_optional: > if CppGenerator.should_use_wrapper_for_return_type(parameter.type): >- out_parameter_assignments.append(' if (out_%(parameterName)s.has_value())' % param_args) >+ out_parameter_assignments.append(' if (out_%(parameterName)s.hasValue())' % param_args) > out_parameter_assignments.append(' result->%(keyedSetMethod)s("%(parameterKey)s"_s, *out_%(parameterName)s);' % param_args) > else: > out_parameter_assignments.append(' if (out_%(parameterName)s)' % param_args) >diff --git a/Source/WTF/wtf/Hasher.h b/Source/WTF/wtf/Hasher.h >index a3fea4e0ad6d1a419ccc67688afc6a87c8956074..7ca33549ed90af70e0871677adb8b39342079d2a 100644 >--- a/Source/WTF/wtf/Hasher.h >+++ b/Source/WTF/wtf/Hasher.h >@@ -142,8 +142,8 @@ template<typename T1, typename T2> void add(Hasher& hasher, const std::pair<T1, > > template<typename T> void add(Hasher& hasher, const Optional<T>& optional) > { >- add(hasher, optional.has_value()); >- if (optional.has_value()) >+ add(hasher, optional.hasValue()); >+ if (optional.hasValue()) > add(hasher, optional.value()); > } > >diff --git a/Source/WTF/wtf/Optional.h b/Source/WTF/wtf/Optional.h >index 6d4e2426b745d927b5b4e66dd55ba3c68dbd4786..bf5a9402fb45cd277307deac71b0060188c76fe6 100644 >--- a/Source/WTF/wtf/Optional.h >+++ b/Source/WTF/wtf/Optional.h >@@ -506,7 +506,6 @@ public: > // 20.5.4.5, Observers > > explicit constexpr operator bool() const __NOEXCEPT { return initialized(); } >- constexpr bool has_value() const __NOEXCEPT { return initialized(); } // FIXME: Remove this. > constexpr bool hasValue() const __NOEXCEPT { return initialized(); } > > constexpr T const* operator ->() const { >@@ -673,7 +672,7 @@ public: > return ref != nullptr; > } > >- constexpr bool has_value() const __NOEXCEPT { >+ constexpr bool hasValue() const __NOEXCEPT { > return ref != nullptr; > } > >diff --git a/Source/WebCore/bindings/js/DOMPromiseProxy.h b/Source/WebCore/bindings/js/DOMPromiseProxy.h >index e75c3ed40a9ad4c32c90d82811d5ea75065ea755..48ac3f950becb54a07d04fa7c53501d96608150c 100644 >--- a/Source/WebCore/bindings/js/DOMPromiseProxy.h >+++ b/Source/WebCore/bindings/js/DOMPromiseProxy.h >@@ -145,7 +145,7 @@ inline void DOMPromiseProxy<IDLType>::clear() > template<typename IDLType> > inline bool DOMPromiseProxy<IDLType>::isFulfilled() const > { >- return m_valueOrException.has_value(); >+ return m_valueOrException.hasValue(); > } > > template<typename IDLType> >@@ -213,7 +213,7 @@ inline void DOMPromiseProxy<IDLVoid>::clear() > > inline bool DOMPromiseProxy<IDLVoid>::isFulfilled() const > { >- return m_valueOrException.has_value(); >+ return m_valueOrException.hasValue(); > } > > inline void DOMPromiseProxy<IDLVoid>::resolve() >@@ -282,7 +282,7 @@ inline void DOMPromiseProxyWithResolveCallback<IDLType>::clear() > template<typename IDLType> > inline bool DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled() const > { >- return m_valueOrException.has_value(); >+ return m_valueOrException.hasValue(); > } > > template<typename IDLType> >diff --git a/Source/WebCore/dom/DataTransferItemList.h b/Source/WebCore/dom/DataTransferItemList.h >index 9a55b23dff51fc47a88b9b8795e00eb5498e59a5..b2413b86b49eb64c8d44c07eaf654798615f9d26 100644 >--- a/Source/WebCore/dom/DataTransferItemList.h >+++ b/Source/WebCore/dom/DataTransferItemList.h >@@ -65,7 +65,7 @@ public: > > void didClearStringData(const String& type); > void didSetStringData(const String& type); >- bool hasItems() const { return m_items.has_value(); } >+ bool hasItems() const { return m_items.hasValue(); } > const Vector<Ref<DataTransferItem>>& items() const > { > ASSERT(m_items); >diff --git a/Source/WebCore/dom/EventTarget.cpp b/Source/WebCore/dom/EventTarget.cpp >index d1c87de5e498d59e1b2a85c698cebba1b2eb1c61..c37910e66fe833497b2e6a0375d0de01bc242b60 100644 >--- a/Source/WebCore/dom/EventTarget.cpp >+++ b/Source/WebCore/dom/EventTarget.cpp >@@ -67,7 +67,7 @@ bool EventTarget::addEventListener(const AtomicString& eventType, Ref<EventListe > { > auto passive = options.passive; > >- if (!passive.has_value() && eventNames().isTouchScrollBlockingEventType(eventType)) { >+ if (!passive.hasValue() && eventNames().isTouchScrollBlockingEventType(eventType)) { > if (is<DOMWindow>(*this)) { > auto& window = downcast<DOMWindow>(*this); > if (auto* document = window.document()) >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 35429f1c86b0c1ea9978fda4cf9ae04eb43f0e95..3442eda05eef011b81126f15f48b52e2e529144f 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -6583,7 +6583,7 @@ void HTMLMediaElement::captionPreferencesChanged() > > CaptionUserPreferences::CaptionDisplayMode HTMLMediaElement::captionDisplayMode() > { >- if (!m_captionDisplayMode.has_value()) { >+ if (!m_captionDisplayMode.hasValue()) { > if (document().page()) > m_captionDisplayMode = document().page()->group().captionPreferences().captionDisplayMode(); > else >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index 6551c1105ff5324e754208ff0d056efff2b48b2f..f1e5610b91e1d217c84611b56103126c0e9da57d 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -1061,7 +1061,7 @@ bool MediaPlayer::didPassCORSAccessCheck() const > bool MediaPlayer::wouldTaintOrigin(const SecurityOrigin& origin) const > { > auto wouldTaint = m_private->wouldTaintOrigin(origin); >- if (wouldTaint.has_value()) >+ if (wouldTaint.hasValue()) > return wouldTaint.value(); > > if (m_url.protocolIsData()) >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >index 9fbe7bfd6f48252161df470ce85ed4f2430dea51..d67ef250f0ad0117910e91fde623bf35a6bb90d8 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/AppendPipeline.cpp >@@ -383,7 +383,7 @@ void AppendPipeline::parseDemuxerSrcPadCaps(GstCaps* demuxerSrcPadCaps) > m_streamType = WebCore::MediaSourceStreamTypeGStreamer::Invalid; > } else if (doCapsHaveType(m_demuxerSrcPadCaps.get(), GST_VIDEO_CAPS_TYPE_PREFIX)) { > Optional<FloatSize> size = getVideoResolutionFromCaps(m_demuxerSrcPadCaps.get()); >- if (size.has_value()) >+ if (size.hasValue()) > m_presentationSize = size.value(); > else > m_presentationSize = WebCore::FloatSize(); >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >index 8ea89611d8cad1a2af20b01a3becd41045e0d722..6bfe48a2ed7b0bfbde81ce2dd054a3f77516d494 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp >@@ -721,7 +721,7 @@ void MediaPlayerPrivateGStreamerMSE::trackDetected(RefPtr<AppendPipeline> append > > if (doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) { > Optional<FloatSize> size = getVideoResolutionFromCaps(caps); >- if (size.has_value()) >+ if (size.hasValue()) > m_videoSize = size.value(); > } > >diff --git a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >index 3f50d76c7ba303b4fb01abf139ed5e788b5be77f..1ad442490219564d5001cf468dee287c0d412f11 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp >@@ -459,7 +459,7 @@ void webKitMediaSrcUpdatePresentationSize(GstCaps* caps, Stream* stream) > GST_OBJECT_LOCK(stream->parent); > if (WebCore::doCapsHaveType(caps, GST_VIDEO_CAPS_TYPE_PREFIX)) { > Optional<WebCore::FloatSize> size = WebCore::getVideoResolutionFromCaps(caps); >- if (size.has_value()) >+ if (size.hasValue()) > stream->presentationSize = size.value(); > else > stream->presentationSize = WebCore::FloatSize(); >diff --git a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >index bfe3ae20f2163185bc013531d28befb391694ada..dad045f0d6287a4ff726b65330ba988d4a9adbe2 100644 >--- a/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >+++ b/Source/WebCore/platform/mac/NSScrollerImpDetails.mm >@@ -38,7 +38,7 @@ Optional<bool> ScrollerStyle::m_useOverlayScrollbars; > > NSScrollerStyle ScrollerStyle::recommendedScrollerStyle() > { >- if (m_useOverlayScrollbars.has_value()) >+ if (m_useOverlayScrollbars.hasValue()) > return *m_useOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy; > > if (DeprecatedGlobalSettings::usesOverlayScrollbars()) >diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp >index e4837e184abb0ca36d021108beab431f13f9e6c6..d923eea3d053720d081071ff5334b5605605b427 100644 >--- a/Source/WebCore/rendering/RenderListItem.cpp >+++ b/Source/WebCore/rendering/RenderListItem.cpp >@@ -407,7 +407,7 @@ void RenderListItem::setExplicitValue(Optional<int> value) > if (m_valueWasSetExplicitly && m_value == value) > return; > } >- m_valueWasSetExplicitly = value.has_value(); >+ m_valueWasSetExplicitly = value.hasValue(); > m_value = value; > explicitValueChanged(); > } >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >index 57df5f3e0318103c42fb9dc9d0ddb1778b86a0eb..ba527d26010368a7a8a857f05cfe80011605d8d8 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >@@ -58,7 +58,7 @@ namespace WebKit { > String AutomationCommandError::toProtocolString() > { > String protocolErrorName = Inspector::Protocol::AutomationHelpers::getEnumConstantValue(type); >- if (!message.has_value()) >+ if (!message.hasValue()) > return protocolErrorName; > > return makeString(protocolErrorName, errorNameAndDetailsSeparator, message.value()); >@@ -784,7 +784,7 @@ void WebAutomationSession::willClosePage(const WebPageProxy& page) > > // Then tell the input dispatcher to cancel so timers are stopped, and let it go out of scope. > Optional<Ref<SimulatedInputDispatcher>> inputDispatcher = m_inputDispatchersByPage.take(page.pageID()); >- if (inputDispatcher.has_value()) >+ if (inputDispatcher.hasValue()) > inputDispatcher.value()->cancel(); > } > >diff --git a/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp b/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >index ac5b71bf338137c11f170cd3e9c1c801301f4b77..8edc5e9c96fe1c2eb2c01aa82eff09b82cae5b07 100644 >--- a/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >+++ b/Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp >@@ -594,7 +594,7 @@ void WebAutomationSessionProxy::computeElementLayout(uint64_t pageID, uint64_t f > bool isObscured = false; > if (containerElement) { > Optional<WebCore::FloatPoint> frameInViewCenterPoint = elementInViewClientCenterPoint(*containerElement, isObscured); >- if (frameInViewCenterPoint.has_value()) { >+ if (frameInViewCenterPoint.hasValue()) { > WebCore::IntPoint rootInViewCenterPoint = mainView->rootViewToContents(frameView->contentsToRootView(WebCore::IntPoint(frameInViewCenterPoint.value()))); > switch (coordinateSystem) { > case CoordinateSystem::Page: >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 2b84345254b15ef3f8898761303091a3678d9e33..7669bcf27df2a1f947eb9040f54e16c09a70dff3 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2018-12-20 Chris Dumez <cdumez@apple.com> >+ >+ Use Optional::hasValue() instead of Optional::has_value() >+ https://bugs.webkit.org/show_bug.cgi?id=192948 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: >+ (TestWebKitAPI::TEST): >+ * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: >+ (TestWebKitAPI::TEST): >+ * TestWebKitAPI/Tests/WebCore/FileSystem.cpp: >+ (TestWebKitAPI::TEST_F): >+ > 2018-12-20 Chris Dumez <cdumez@apple.com> > > Use Optional::valueOr() instead of Optional::value_or() >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp b/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >index fdeb501b74a7de2e3becb60520a7829a0e2ef121..3ab6047fc30184fb0417dc54659d386a15b56f9b 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp >@@ -64,7 +64,7 @@ TEST(CBORReaderTest, TestReadUint) > > for (const UintTestCase& testCase : kUintTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Unsigned); > EXPECT_EQ(cbor.value().getInteger(), testCase.value); > } >@@ -109,7 +109,7 @@ TEST(CBORReaderTest, TestUintEncodedWithNonMinimumByteLength) > CBORReader::DecoderError errorCode; > for (const auto& nonMinimalUint : nonMinimalUintEncodings) { > Optional<CBORValue> cbor = CBORReader::read(nonMinimalUint, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::NonMinimalCBOREncoding); > } > } >@@ -135,7 +135,7 @@ TEST(CBORReaderTest, TestReadNegativeInt) > > for (const NegativeIntTestCase& testCase : kNegativeIntTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::Negative); > EXPECT_EQ(cbor.value().getInteger(), testCase.negativeInt); > } >@@ -155,7 +155,7 @@ TEST(CBORReaderTest, TestReadBytes) > > for (const ByteTestCase& testCase : kByteStringTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::ByteString); > EXPECT_TRUE(cbor.value().getByteString() == testCase.value); > } >@@ -180,7 +180,7 @@ TEST(CBORReaderTest, TestReadString) > > for (const StringTestCase& testCase : kStringTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String); > EXPECT_TRUE(cbor.value().getString() == testCase.value); > } >@@ -208,7 +208,7 @@ TEST(CBORReaderTest, TestReadStringWithNUL) > > for (const auto& testCase : kStringTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::String); > EXPECT_TRUE(cbor.value().getString() == testCase.value); > } >@@ -225,7 +225,7 @@ TEST(CBORReaderTest, TestReadStringWithInvalidByteSequenceAfterNUL) > }; > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(stringWithInvalidContinuationByte, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::InvalidUTF8); > } > >@@ -239,7 +239,7 @@ TEST(CBORReaderTest, TestReadArray) > }; > > Optional<CBORValue> cbor = CBORReader::read(kArrayTestCaseCBOR); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > const CBORValue cborArray = WTFMove(cbor.value()); > ASSERT_TRUE(cborArray.type() == CBORValue::Type::Array); > ASSERT_EQ(cborArray.getArray().size(), 25u); >@@ -269,7 +269,7 @@ TEST(CBORReaderTest, TestReadMapWithMapValue) > }; > > Optional<CBORValue> cbor = CBORReader::read(kMapTestCaseCBOR); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); > ASSERT_EQ(cborVal.getMap().size(), 4u); >@@ -313,7 +313,7 @@ TEST(CBORReaderTest, TestReadMapWithIntegerKeys) > }; > > Optional<CBORValue> cbor = CBORReader::read(kMapWithIntegerKeyCBOR); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); > ASSERT_EQ(cborVal.getMap().size(), 4u); >@@ -353,7 +353,7 @@ TEST(CBORReaderTest, TestReadMapWithArray) > }; > > Optional<CBORValue> cbor = CBORReader::read(kMapArrayTestCaseCBOR); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); > ASSERT_EQ(cborVal.getMap().size(), 2u); >@@ -392,7 +392,7 @@ TEST(CBORReaderTest, TestReadNestedMap) > }; > > Optional<CBORValue> cbor = CBORReader::read(kNestedMapTestCase); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > const CBORValue cborVal = WTFMove(cbor.value()); > ASSERT_TRUE(cborVal.type() == CBORValue::Type::Map); > ASSERT_EQ(cborVal.getMap().size(), 2u); >@@ -429,11 +429,11 @@ TEST(CBORReaderTest, TestIntegerRange) > }; > > Optional<CBORValue> maxPositiveInt = CBORReader::read(kMaxPositiveInt); >- ASSERT_TRUE(maxPositiveInt.has_value()); >+ ASSERT_TRUE(maxPositiveInt.hasValue()); > EXPECT_EQ(maxPositiveInt.value().getInteger(), INT64_MAX); > > Optional<CBORValue> minNegativeInt = CBORReader::read(kMinNegativeInt); >- ASSERT_TRUE(minNegativeInt.has_value()); >+ ASSERT_TRUE(minNegativeInt.hasValue()); > EXPECT_EQ(minNegativeInt.value().getInteger(), INT64_MIN); > } > >@@ -471,7 +471,7 @@ TEST(CBORReaderTest, TestReadSimpleValue) > > for (const auto& testCase : kSimpleValueTestCases) { > Optional<CBORValue> cbor = CBORReader::read(testCase.cborData); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > ASSERT_TRUE(cbor.value().type() == CBORValue::Type::SimpleValue); > ASSERT_TRUE(cbor.value().getSimpleValue() == testCase.value); > } >@@ -491,7 +491,7 @@ TEST(CBORReaderTest, TestReadUnsupportedFloatingPointNumbers) > for (const auto& unsupported_floating_point : floatingPointCbors) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(unsupported_floating_point, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedFloatingPointValue); > } > } >@@ -517,7 +517,7 @@ TEST(CBORReaderTest, TestIncompleteCBORDataError) > for (const auto& incomplete_data : incompleteCborList) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(incomplete_data, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncompleteCBORData); > } > } >@@ -538,7 +538,7 @@ TEST(CBORReaderTest, TestUnsupportedMapKeyFormatError) > > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(kMapWithUintKey, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::IncorrectMapKeyType); > } > >@@ -567,7 +567,7 @@ TEST(CBORReaderTest, TestUnknownAdditionalInfoError) > for (const auto& incorrect_cbor : kUnknownAdditionalInfoList) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(incorrect_cbor, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnknownAdditionalInfo); > } > } >@@ -590,7 +590,7 @@ TEST(CBORReaderTest, TestTooMuchNestingError) > for (const auto& zeroDepthData : kZeroDepthCBORList) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(zeroDepthData, &errorCode, 0); >- EXPECT_TRUE(cbor.has_value()); >+ EXPECT_TRUE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } > >@@ -610,11 +610,11 @@ TEST(CBORReaderTest, TestTooMuchNestingError) > > CBORReader::DecoderError errorCode; > Optional<CBORValue> cborSingleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 1); >- EXPECT_FALSE(cborSingleLayerMax.has_value()); >+ EXPECT_FALSE(cborSingleLayerMax.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::TooMuchNesting); > > Optional<CBORValue> cborDoubleLayerMax = CBORReader::read(kNestedCBORData, &errorCode, 2); >- EXPECT_TRUE(cborDoubleLayerMax.has_value()); >+ EXPECT_TRUE(cborDoubleLayerMax.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } > >@@ -648,7 +648,7 @@ TEST(CBORReaderTest, TestOutOfOrderKeyError) > for (const auto& unsortedMap : kMapsWithUnsortedKeys) { > Optional<CBORValue> cbor = > CBORReader::read(unsortedMap, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::OutOfOrderKey); > } > } >@@ -679,7 +679,7 @@ TEST(CBORReaderTest, TestDuplicateKeyError) > CBORReader::DecoderError errorCode; > > Optional<CBORValue> cbor = CBORReader::read(kMapWithDuplicateKey, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::DuplicateKey); > } > >@@ -699,7 +699,7 @@ TEST(CBORReaderTest, TestIncorrectStringEncodingError) > CBORReader::DecoderError errorCode; > for (const auto& cbor_byte : utf8CharacterEncodings) { > Optional<CBORValue> correctlyEncodedCbor = CBORReader::read(cbor_byte, &errorCode); >- EXPECT_TRUE(correctlyEncodedCbor.has_value()); >+ EXPECT_TRUE(correctlyEncodedCbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::CBORNoError); > } > >@@ -728,7 +728,7 @@ TEST(CBORReaderTest, TestExtraneousCBORDataError) > for (const auto& extraneous_cborData : zeroPaddedCborList) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(extraneous_cborData, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::ExtraneousData); > } > } >@@ -759,7 +759,7 @@ TEST(CBORReaderTest, TestUnsupportedSimplevalue) > for (const auto& unsupportedSimpleVal : unsupportedSimpleValues) { > CBORReader::DecoderError errorCode; > Optional<CBORValue> cbor = CBORReader::read(unsupportedSimpleVal, &errorCode); >- EXPECT_FALSE(cbor.has_value()); >+ EXPECT_FALSE(cbor.hasValue()); > EXPECT_TRUE(errorCode == CBORReader::DecoderError::UnsupportedSimpleValue); > } > } >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp b/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp >index 1961a6cf39de01f131635b0e09adbc723b068ca6..3e9bdd26b597d734b960aab3a66014b7f42951c2 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp >@@ -81,7 +81,7 @@ TEST(CBORWriterTest, TestWriteUint) > > for (const UintTestCase& testCase : kUintTestCases) { > auto cbor = CBORWriter::write(CBORValue(testCase.value)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), testCase.cbor)); > } > } >@@ -108,7 +108,7 @@ TEST(CBORWriterTest, TestWriteNegativeInteger) > > for (const auto& testCase : kNegativeIntTestCases) { > auto cbor = CBORWriter::write(CBORValue(testCase.negativeInt)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), testCase.cbor)); > } > } >@@ -127,7 +127,7 @@ TEST(CBORWriterTest, TestWriteBytes) > > for (const BytesTestCase& testCase : kBytesTestCases) { > auto cbor = CBORWriter::write(CBORValue(testCase.bytes)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), testCase.cbor)); > } > } >@@ -151,7 +151,7 @@ TEST(CBORWriterTest, TestWriteString) > > for (const StringTestCase& testCase : kStringTestCases) { > auto cbor = CBORWriter::write(CBORValue(testCase.string)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), testCase.cbor)); > } > } >@@ -168,7 +168,7 @@ TEST(CBORWriterTest, TestWriteArray) > for (int64_t i = 1; i <= 25; i++) > array.append(CBORValue(i)); > auto cbor = CBORWriter::write(CBORValue(array)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), kArrayTestCaseCbor, sizeof(kArrayTestCaseCbor))); > } > >@@ -278,7 +278,7 @@ TEST(CBORWriterTest, TestWriteMapWithMapValue) > map[CBORValue(int64_t(4294967296))] = CBORValue("i"); > map[CBORValue(std::numeric_limits<int64_t>::max())] = CBORValue("j"); > auto cbor = CBORWriter::write(CBORValue(map)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), kMapTestCaseCbor, sizeof(kMapTestCaseCbor))); > } > >@@ -301,7 +301,7 @@ TEST(CBORWriterTest, TestWriteMapWithArray) > array.append(CBORValue(3)); > map[CBORValue("b")] = CBORValue(array); > auto cbor = CBORWriter::write(CBORValue(map)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), kMapArrayTestCaseCbor, sizeof(kMapArrayTestCaseCbor))); > } > >@@ -327,7 +327,7 @@ TEST(CBORWriterTest, TestWriteNestedMap) > nestedMap[CBORValue("d")] = CBORValue(3); > map[CBORValue("b")] = CBORValue(nestedMap); > auto cbor = CBORWriter::write(CBORValue(map)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), kNestedMapTestCase, sizeof(kNestedMapTestCase))); > } > >@@ -345,7 +345,7 @@ TEST(CBORWriterTest, TestWriteSimpleValue) > > for (const auto& testCase : kSimpleTestCase) { > auto cbor = CBORWriter::write(CBORValue(testCase.simpleValue)); >- ASSERT_TRUE(cbor.has_value()); >+ ASSERT_TRUE(cbor.hasValue()); > EXPECT_TRUE(eq(cbor.value(), testCase.cbor)); > } > } >@@ -370,18 +370,18 @@ TEST(CBORWriterTest, TestWriteSingleLayer) > const CBORValue singleLayerCborMap = CBORValue(simpleMap); > const CBORValue singleLayerCborArray = CBORValue(simpleArray); > >- EXPECT_TRUE(CBORWriter::write(simpleUint, 0).has_value()); >- EXPECT_TRUE(CBORWriter::write(simpleString, 0).has_value()); >- EXPECT_TRUE(CBORWriter::write(simpleBytestring, 0).has_value()); >+ EXPECT_TRUE(CBORWriter::write(simpleUint, 0).hasValue()); >+ EXPECT_TRUE(CBORWriter::write(simpleString, 0).hasValue()); >+ EXPECT_TRUE(CBORWriter::write(simpleBytestring, 0).hasValue()); > >- EXPECT_TRUE(CBORWriter::write(emptyArrayValue, 0).has_value()); >- EXPECT_TRUE(CBORWriter::write(emptyMapValue, 0).has_value()); >+ EXPECT_TRUE(CBORWriter::write(emptyArrayValue, 0).hasValue()); >+ EXPECT_TRUE(CBORWriter::write(emptyMapValue, 0).hasValue()); > >- EXPECT_FALSE(CBORWriter::write(singleLayerCborArray, 0).has_value()); >- EXPECT_TRUE(CBORWriter::write(singleLayerCborArray, 1).has_value()); >+ EXPECT_FALSE(CBORWriter::write(singleLayerCborArray, 0).hasValue()); >+ EXPECT_TRUE(CBORWriter::write(singleLayerCborArray, 1).hasValue()); > >- EXPECT_FALSE(CBORWriter::write(singleLayerCborMap, 0).has_value()); >- EXPECT_TRUE(CBORWriter::write(singleLayerCborMap, 1).has_value()); >+ EXPECT_FALSE(CBORWriter::write(singleLayerCborMap, 0).hasValue()); >+ EXPECT_TRUE(CBORWriter::write(singleLayerCborMap, 1).hasValue()); > } > > // Major type 5 nested CBOR map value with following structure. >@@ -396,8 +396,8 @@ TEST(CBORWriterTest, NestedMaps) > nestedMap[CBORValue("c")] = CBORValue(2); > nestedMap[CBORValue("d")] = CBORValue(3); > cborMap[CBORValue("b")] = CBORValue(nestedMap); >- EXPECT_TRUE(CBORWriter::write(CBORValue(cborMap), 2).has_value()); >- EXPECT_FALSE(CBORWriter::write(CBORValue(cborMap), 1).has_value()); >+ EXPECT_TRUE(CBORWriter::write(CBORValue(cborMap), 2).hasValue()); >+ EXPECT_FALSE(CBORWriter::write(CBORValue(cborMap), 1).hasValue()); > } > > // Testing Write() function for following CBOR structure with depth of 3. >@@ -422,8 +422,8 @@ TEST(CBORWriterTest, UnbalancedNestedContainers) > cborArray.append(CBORValue(3)); > cborArray.append(CBORValue(cborMap)); > >- EXPECT_TRUE(CBORWriter::write(CBORValue(cborArray), 3).has_value()); >- EXPECT_FALSE(CBORWriter::write(CBORValue(cborArray), 2).has_value()); >+ EXPECT_TRUE(CBORWriter::write(CBORValue(cborArray), 3).hasValue()); >+ EXPECT_FALSE(CBORWriter::write(CBORValue(cborArray), 2).hasValue()); > } > > // Testing Write() function for following CBOR structure. >@@ -456,8 +456,8 @@ TEST(CBORWriterTest, OverlyNestedCBOR) > nestedMap[CBORValue("h")] = CBORValue(innerNestedMap); > map[CBORValue("b")] = CBORValue(nestedMap); > >- EXPECT_TRUE(CBORWriter::write(CBORValue(map), 5).has_value()); >- EXPECT_FALSE(CBORWriter::write(CBORValue(map), 4).has_value()); >+ EXPECT_TRUE(CBORWriter::write(CBORValue(map), 5).hasValue()); >+ EXPECT_FALSE(CBORWriter::write(CBORValue(map), 4).hasValue()); > } > > } // namespace TestWebKitAPI >diff --git a/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp b/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp >index 483f46d5fed085b9acbe2893d43c7c79d661ce6b..76625025309727ea605cb52cfc9ecd4b33e77875 100644 >--- a/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp >+++ b/Tools/TestWebKitAPI/Tests/WebCore/FileSystem.cpp >@@ -129,12 +129,12 @@ TEST_F(FileSystemTest, FilesHaveSameVolume) > TEST_F(FileSystemTest, GetFileMetadataSymlink) > { > auto symlinkMetadata = FileSystem::fileMetadata(tempFileSymlinkPath()); >- ASSERT_TRUE(symlinkMetadata.has_value()); >+ ASSERT_TRUE(symlinkMetadata.hasValue()); > EXPECT_TRUE(symlinkMetadata.value().type == FileMetadata::Type::SymbolicLink); > EXPECT_FALSE(static_cast<size_t>(symlinkMetadata.value().length) == strlen(FileSystemTestData)); > > auto targetMetadata = FileSystem::fileMetadataFollowingSymlinks(tempFileSymlinkPath()); >- ASSERT_TRUE(targetMetadata.has_value()); >+ ASSERT_TRUE(targetMetadata.hasValue()); > EXPECT_TRUE(targetMetadata.value().type == FileMetadata::Type::File); > EXPECT_EQ(strlen(FileSystemTestData), static_cast<size_t>(targetMetadata.value().length)); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192948
: 357854