WebKit Bugzilla
Attachment 339245 Details for
Bug 185176
: Use more C++17
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
0001-Use-more-C-17.patch (text/plain), 30.46 KB, created by
JF Bastien
on 2018-05-01 17:15:42 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
JF Bastien
Created:
2018-05-01 17:15:42 PDT
Size:
30.46 KB
patch
obsolete
>From cf80b00955bdbe6358aff0ac1838f13c3ff91568 Mon Sep 17 00:00:00 2001 >From: JF Bastien <jfbastien@apple.com> >Date: Tue, 1 May 2018 17:07:23 -0700 >Subject: [PATCH] Use more C++17 > >--- > Source/JavaScriptCore/Configurations/Base.xcconfig | 2 +- > .../assembler/MacroAssemblerCodeRef.h | 4 +-- > Source/WTF/Configurations/Base.xcconfig | 2 +- > Source/WTF/wtf/Compiler.h | 2 ++ > Source/WTF/wtf/Expected.h | 2 +- > Source/WTF/wtf/Optional.h | 36 +++++++++++++-------- > Source/WTF/wtf/StdLibExtras.h | 37 +++------------------- > Source/WebCore/Configurations/Base.xcconfig | 2 +- > .../Modules/mediastream/RTCPeerConnection.cpp | 8 ++--- > Source/WebCore/PAL/Configurations/Base.xcconfig | 2 +- > ...electorPseudoClassAndCompatibilityElementMap.py | 4 ++- > .../WebCore/css/makeSelectorPseudoElementsMap.py | 4 ++- > Source/WebCore/css/makeprop.pl | 4 ++- > Source/WebCore/css/makevalues.pl | 4 ++- > Source/WebCore/css/parser/CSSParser.cpp | 4 +-- > Source/WebCore/css/parser/CSSParser.h | 2 +- > Source/WebCore/dom/DatasetDOMStringMap.cpp | 10 +++--- > Source/WebCore/dom/DatasetDOMStringMap.h | 2 +- > Source/WebCore/dom/Element.cpp | 4 +-- > Source/WebCore/dom/Element.h | 2 +- > Source/WebCore/inspector/DOMEditor.cpp | 2 +- > Source/WebCore/platform/ColorData.gperf | 1 - > .../platform/network/create-http-header-name-table | 4 ++- > .../platform/network/curl/CurlFormDataStream.cpp | 4 +-- > .../platform/network/curl/CurlFormDataStream.h | 2 +- > Source/WebCore/testing/MockCDMFactory.cpp | 10 +++--- > Source/WebCore/testing/MockCDMFactory.h | 2 +- > Source/WebInspectorUI/Configurations/Base.xcconfig | 2 +- > Source/WebKit/Configurations/Base.xcconfig | 2 +- > Source/WebKit/Shared/SandboxExtension.h | 2 +- > Source/WebKit/Shared/TouchBarMenuItemData.cpp | 2 +- > .../WebKitLegacy/mac/Configurations/Base.xcconfig | 2 +- > Source/bmalloc/Configurations/Base.xcconfig | 2 +- > Source/bmalloc/bmalloc/BCompiler.h | 13 ++++++++ > Source/bmalloc/bmalloc/Scavenger.h | 4 +-- > 35 files changed, 99 insertions(+), 92 deletions(-) > >diff --git a/Source/JavaScriptCore/Configurations/Base.xcconfig b/Source/JavaScriptCore/Configurations/Base.xcconfig >index d11c7d4..09ba0d5 100644 >--- a/Source/JavaScriptCore/Configurations/Base.xcconfig >+++ b/Source/JavaScriptCore/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h b/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h >index b1eb74c..ea49c3f 100644 >--- a/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h >+++ b/Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h >@@ -161,9 +161,9 @@ private: > template<PtrTag> friend class FunctionPtr; > }; > >-static_assert(sizeof(FunctionPtr<CFunctionPtrTag>) == sizeof(void*), ""); >+static_assert(sizeof(FunctionPtr<CFunctionPtrTag>) == sizeof(void*)); > #if COMPILER_SUPPORTS(BUILTIN_IS_TRIVIALLY_COPYABLE) >-static_assert(__is_trivially_copyable(FunctionPtr<CFunctionPtrTag>), ""); >+static_assert(__is_trivially_copyable(FunctionPtr<CFunctionPtrTag>)); > #endif > > // ReturnAddressPtr: >diff --git a/Source/WTF/Configurations/Base.xcconfig b/Source/WTF/Configurations/Base.xcconfig >index a7bf793..442c192 100644 >--- a/Source/WTF/Configurations/Base.xcconfig >+++ b/Source/WTF/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/WTF/wtf/Compiler.h b/Source/WTF/wtf/Compiler.h >index 1391ead..31c2936 100644 >--- a/Source/WTF/wtf/Compiler.h >+++ b/Source/WTF/wtf/Compiler.h >@@ -74,6 +74,8 @@ > #define WTF_CPP_STD_VER 11 > #elif __cplusplus <= 201402L > #define WTF_CPP_STD_VER 14 >+#elif __cplusplus <= 201703L >+#define WTF_CPP_STD_VER 17 > #endif > #endif > >diff --git a/Source/WTF/wtf/Expected.h b/Source/WTF/wtf/Expected.h >index dd045e5..e9b0ec9 100644 >--- a/Source/WTF/wtf/Expected.h >+++ b/Source/WTF/wtf/Expected.h >@@ -573,5 +573,5 @@ template<typename T, typename E> void swap(expected<T, E>& x, expected<T, E>& y) > > }}} // namespace std::experimental::fundamentals_v3 > >-__EXPECTED_INLINE_VARIABLE constexpr std::experimental::unexpected_t& unexpect = std::experimental::unexpect; >+__EXPECTED_INLINE_VARIABLE constexpr auto& unexpect = std::experimental::unexpect; > template<class T, class E> using Expected = std::experimental::expected<T, E>; >diff --git a/Source/WTF/wtf/Optional.h b/Source/WTF/wtf/Optional.h >index a3fc589..5d3b586 100644 >--- a/Source/WTF/wtf/Optional.h >+++ b/Source/WTF/wtf/Optional.h >@@ -37,6 +37,12 @@ > > #pragma once > >+#if __has_include(<optional>) >+ >+#include <optional> >+ >+#else >+ > # include <utility> > # include <type_traits> > # include <initializer_list> >@@ -1012,20 +1018,6 @@ constexpr optional<X&> make_optional(std::reference_wrapper<X> v) > > } // namespace std > >-namespace WTF { >- >-// -- WebKit Additions -- >-template <class OptionalType, class Callback> >-ALWAYS_INLINE >-auto valueOrCompute(OptionalType optional, Callback callback) -> typename OptionalType::value_type >-{ >- if (optional) >- return *optional; >- return callback(); >-} >- >-} // namespace WTF >- > namespace std > { > template <typename T> >@@ -1054,4 +1046,20 @@ namespace std > # undef TR2_OPTIONAL_REQUIRES > # undef TR2_OPTIONAL_ASSERTED_EXPRESSION > >+#endif // __has_include(<optional>) >+ >+namespace WTF { >+ >+// -- WebKit Additions -- >+template <class OptionalType, class Callback> >+ALWAYS_INLINE >+auto valueOrCompute(OptionalType optional, Callback callback) -> typename OptionalType::value_type >+{ >+ if (optional) >+ return *optional; >+ return callback(); >+} >+ >+} // namespace WTF >+ > using WTF::valueOrCompute; >diff --git a/Source/WTF/wtf/StdLibExtras.h b/Source/WTF/wtf/StdLibExtras.h >index 49f2e29..36c7739 100644 >--- a/Source/WTF/wtf/StdLibExtras.h >+++ b/Source/WTF/wtf/StdLibExtras.h >@@ -534,38 +534,6 @@ ALWAYS_INLINE constexpr typename remove_reference<T>::type&& move(T&& value) > return move(forward<T>(value)); > } > >-#if __cplusplus < 201703L && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) && !defined(__cpp_lib_logical_traits) >-template<class...> struct wtf_conjunction_impl; >-template<> struct wtf_conjunction_impl<> : true_type { }; >-template<class B0> struct wtf_conjunction_impl<B0> : B0 { }; >-template<class B0, class B1> struct wtf_conjunction_impl<B0, B1> : conditional<B0::value, B1, B0>::type { }; >-template<class B0, class B1, class B2, class... Bn> struct wtf_conjunction_impl<B0, B1, B2, Bn...> : conditional<B0::value, wtf_conjunction_impl<B1, B2, Bn...>, B0>::type { }; >-template<class... _Args> struct conjunction : wtf_conjunction_impl<_Args...> { }; >-#endif >- >-#if __cplusplus < 201703L >- >-// These are inline variable for C++17 and later. >-#define __IN_PLACE_INLINE_VARIABLE static const >- >-struct in_place_t { >- explicit in_place_t() = default; >-}; >-__IN_PLACE_INLINE_VARIABLE constexpr in_place_t in_place { }; >- >-template <class T> struct in_place_type_t { >- explicit in_place_type_t() = default; >-}; >-template <class T> >-__IN_PLACE_INLINE_VARIABLE constexpr in_place_type_t<T> in_place_type { }; >- >-template <size_t I> struct in_place_index_t { >- explicit in_place_index_t() = default; >-}; >-template <size_t I> >-__IN_PLACE_INLINE_VARIABLE constexpr in_place_index_t<I> in_place_index { }; >-#endif // __cplusplus < 201703L >- > enum class ZeroStatus { > MayBeZero, > NonZero >@@ -583,6 +551,11 @@ constexpr size_t clz(uint32_t value, ZeroStatus mightBeZero = ZeroStatus::MayBeZ > return 32; > } > >+struct in_place_t { >+ explicit in_place_t() = default; >+}; >+inline constexpr in_place_t in_place{}; >+ > } // namespace std > > #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) >diff --git a/Source/WebCore/Configurations/Base.xcconfig b/Source/WebCore/Configurations/Base.xcconfig >index 412ac21..d8de718 100644 >--- a/Source/WebCore/Configurations/Base.xcconfig >+++ b/Source/WebCore/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >index 851c9c8..536c552 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >@@ -301,12 +301,12 @@ void RTCPeerConnection::queuedAddIceCandidate(RTCIceCandidate* rtcCandidate, DOM > } > > // Implementation of https://w3c.github.io/webrtc-pc/#set-pc-configuration >-static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, std::optional<const RTCConfiguration&> existingConfiguration, bool isLocalDescriptionSet) >+static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, std::optional<std::reference_wrapper<const RTCConfiguration>> existingConfiguration, bool isLocalDescriptionSet) > { >- if (existingConfiguration && newConfiguration.bundlePolicy != existingConfiguration->bundlePolicy) >+ if (existingConfiguration && newConfiguration.bundlePolicy != existingConfiguration->get().bundlePolicy) > return Exception { InvalidModificationError, "IceTransportPolicy does not match existing policy" }; > >- if (existingConfiguration && newConfiguration.iceCandidatePoolSize != existingConfiguration->iceCandidatePoolSize && isLocalDescriptionSet) >+ if (existingConfiguration && newConfiguration.iceCandidatePoolSize != existingConfiguration->get().iceCandidatePoolSize && isLocalDescriptionSet) > return Exception { InvalidModificationError, "IceTransportPolicy pool size does not match existing pool size" }; > > Vector<MediaEndpointConfiguration::IceServerInfo> servers; >@@ -360,7 +360,7 @@ ExceptionOr<void> RTCPeerConnection::setConfiguration(RTCConfiguration&& configu > > INFO_LOG(LOGIDENTIFIER); > >- auto servers = iceServersFromConfiguration(configuration, m_configuration, m_backend->isLocalDescriptionSet()); >+ auto servers = iceServersFromConfiguration(configuration, std::cref(m_configuration), m_backend->isLocalDescriptionSet()); > if (servers.hasException()) > return servers.releaseException(); > >diff --git a/Source/WebCore/PAL/Configurations/Base.xcconfig b/Source/WebCore/PAL/Configurations/Base.xcconfig >index 5826fd0..ba5c849 100644 >--- a/Source/WebCore/PAL/Configurations/Base.xcconfig >+++ b/Source/WebCore/PAL/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py b/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py >index 7833227..f3c6ac2 100644 >--- a/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py >+++ b/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py >@@ -96,10 +96,12 @@ output_file.write(""" > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wunknown-pragmas" >-#pragma clang diagnostic ignored "-Wdeprecated-register" > #pragma clang diagnostic ignored "-Wimplicit-fallthrough" > #endif > >+// Older versions of gperf like to use the `register` keyword. >+#define register >+ > namespace WebCore { > > struct SelectorPseudoClassOrCompatibilityPseudoElementEntry { >diff --git a/Source/WebCore/css/makeSelectorPseudoElementsMap.py b/Source/WebCore/css/makeSelectorPseudoElementsMap.py >index 83b238e..f491a81 100644 >--- a/Source/WebCore/css/makeSelectorPseudoElementsMap.py >+++ b/Source/WebCore/css/makeSelectorPseudoElementsMap.py >@@ -94,10 +94,12 @@ output_file.write(""" > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wunknown-pragmas" >-#pragma clang diagnostic ignored "-Wdeprecated-register" > #pragma clang diagnostic ignored "-Wimplicit-fallthrough" > #endif > >+// Older versions of gperf like to use the `register` keyword. >+#define register >+ > namespace WebCore { > > struct SelectorPseudoTypeEntry { >diff --git a/Source/WebCore/css/makeprop.pl b/Source/WebCore/css/makeprop.pl >index 3af6952..8b3d1df 100755 >--- a/Source/WebCore/css/makeprop.pl >+++ b/Source/WebCore/css/makeprop.pl >@@ -252,10 +252,12 @@ print GPERF << "EOF"; > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored \"-Wunknown-pragmas\" >-#pragma clang diagnostic ignored \"-Wdeprecated-register\" > #pragma clang diagnostic ignored \"-Wimplicit-fallthrough\" > #endif > >+// Older versions of gperf like to use the `register` keyword. >+#define register >+ > namespace WebCore { > > // Using std::numeric_limits<uint16_t>::max() here would be cleaner, >diff --git a/Source/WebCore/css/makevalues.pl b/Source/WebCore/css/makevalues.pl >index 55c4e75..9b090ea 100755 >--- a/Source/WebCore/css/makevalues.pl >+++ b/Source/WebCore/css/makevalues.pl >@@ -76,10 +76,12 @@ print GPERF << "EOF"; > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored \"-Wunknown-pragmas\" >-#pragma clang diagnostic ignored \"-Wdeprecated-register\" > #pragma clang diagnostic ignored \"-Wimplicit-fallthrough\" > #endif > >+// Older versions of gperf like to use the `register` keyword. >+#define register >+ > namespace WebCore { > %} > %struct-type >diff --git a/Source/WebCore/css/parser/CSSParser.cpp b/Source/WebCore/css/parser/CSSParser.cpp >index 954ab08..33f52e1 100644 >--- a/Source/WebCore/css/parser/CSSParser.cpp >+++ b/Source/WebCore/css/parser/CSSParser.cpp >@@ -178,14 +178,14 @@ Color CSSParser::parseColor(const String& string, bool strict) > return primitiveValue.color(); > } > >-Color CSSParser::parseSystemColor(const String& string, std::optional<const CSSParserContext&> context) >+Color CSSParser::parseSystemColor(const String& string, std::optional<std::reference_wrapper<const CSSParserContext>> context) > { > CSSValueID id = cssValueKeywordID(string); > if (!StyleColor::isSystemColor(id)) > return Color(); > > OptionSet<StyleColor::Options> options; >- if (context && context.value().useSystemAppearance) >+ if (context && context->get().useSystemAppearance) > options |= StyleColor::Options::UseSystemAppearance; > return RenderTheme::singleton().systemColor(id, options); > } >diff --git a/Source/WebCore/css/parser/CSSParser.h b/Source/WebCore/css/parser/CSSParser.h >index d92fa5a..aee78e5 100644 >--- a/Source/WebCore/css/parser/CSSParser.h >+++ b/Source/WebCore/css/parser/CSSParser.h >@@ -78,7 +78,7 @@ public: > RefPtr<CSSValue> parseValueWithVariableReferences(CSSPropertyID, const CSSValue&, const CustomPropertyValueMap& customProperties, TextDirection, WritingMode); > > static Color parseColor(const String&, bool strict = false); >- static Color parseSystemColor(const String&, std::optional<const CSSParserContext&>); >+ static Color parseSystemColor(const String&, std::optional<std::reference_wrapper<const CSSParserContext>>); > > private: > ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important); >diff --git a/Source/WebCore/dom/DatasetDOMStringMap.cpp b/Source/WebCore/dom/DatasetDOMStringMap.cpp >index f2d8420..8e86aee 100644 >--- a/Source/WebCore/dom/DatasetDOMStringMap.cpp >+++ b/Source/WebCore/dom/DatasetDOMStringMap.cpp >@@ -188,7 +188,7 @@ Vector<String> DatasetDOMStringMap::supportedPropertyNames() const > return names; > } > >-std::optional<const AtomicString&> DatasetDOMStringMap::item(const String& propertyName) const >+std::optional<std::reference_wrapper<const AtomicString>> DatasetDOMStringMap::item(const String& propertyName) const > { > if (m_element.hasAttributes()) { > AttributeIteratorAccessor attributeIteratorAccessor = m_element.attributesIterator(); >@@ -198,12 +198,12 @@ std::optional<const AtomicString&> DatasetDOMStringMap::item(const String& prope > // Building a new AtomicString in that case is overkill so we do a direct character comparison. > const Attribute& attribute = *attributeIteratorAccessor.begin(); > if (propertyNameMatchesAttributeName(propertyName, attribute.localName())) >- return attribute.value(); >+ return std::cref(attribute.value()); > } else { > AtomicString attributeName = convertPropertyNameToAttributeName(propertyName); > for (const Attribute& attribute : attributeIteratorAccessor) { > if (attribute.localName() == attributeName) >- return attribute.value(); >+ return std::cref(attribute.value()); > } > } > } >@@ -213,7 +213,9 @@ std::optional<const AtomicString&> DatasetDOMStringMap::item(const String& prope > > String DatasetDOMStringMap::namedItem(const AtomicString& name) const > { >- return item(name).value_or(String { }); >+ if (auto value = item(name)) >+ return value->get(); >+ return String { }; > } > > ExceptionOr<void> DatasetDOMStringMap::setNamedItem(const String& name, const String& value) >diff --git a/Source/WebCore/dom/DatasetDOMStringMap.h b/Source/WebCore/dom/DatasetDOMStringMap.h >index 483f763..d6d10d1 100644 >--- a/Source/WebCore/dom/DatasetDOMStringMap.h >+++ b/Source/WebCore/dom/DatasetDOMStringMap.h >@@ -53,7 +53,7 @@ public: > Element& element() { return m_element; } > > private: >- std::optional<const AtomicString&> item(const String& name) const; >+ std::optional<std::reference_wrapper<const AtomicString>> item(const String& name) const; > > Element& m_element; > }; >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index a432397..273d8ca 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -3733,7 +3733,7 @@ static ExceptionOr<Ref<Element>> contextElementForInsertion(const String& where, > } > > // https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml >-ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& markup, std::optional<NodeVector&> addedNodes) >+ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& markup, std::optional<std::reference_wrapper<NodeVector>> addedNodes) > { > // Steps 1 and 2. > auto contextElement = contextElementForInsertion(where, *this); >@@ -3747,7 +3747,7 @@ ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& > if (UNLIKELY(addedNodes)) { > // Must be called before insertAdjacent, as otherwise the children of fragment will be moved > // to their new parent and will be harder to keep track of. >- *addedNodes = collectChildNodes(fragment.returnValue()); >+ addedNodes->get() = collectChildNodes(fragment.returnValue()); > } > > // Step 4. >diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h >index 9e52d33..9af4113 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -314,7 +314,7 @@ public: > WEBCORE_EXPORT void setTabIndex(int); > virtual RefPtr<Element> focusDelegate(); > >- ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html, std::optional<NodeVector&> addedNodes); >+ ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html, std::optional<std::reference_wrapper<NodeVector>> addedNodes); > > WEBCORE_EXPORT ExceptionOr<Element*> insertAdjacentElement(const String& where, Element& newChild); > WEBCORE_EXPORT ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html); >diff --git a/Source/WebCore/inspector/DOMEditor.cpp b/Source/WebCore/inspector/DOMEditor.cpp >index 3493b01..59eccd4 100644 >--- a/Source/WebCore/inspector/DOMEditor.cpp >+++ b/Source/WebCore/inspector/DOMEditor.cpp >@@ -266,7 +266,7 @@ private: > > ExceptionOr<void> redo() final > { >- auto result = m_element->insertAdjacentHTML(m_position, m_html, m_addedNodes); >+ auto result = m_element->insertAdjacentHTML(m_position, m_html, std::ref(m_addedNodes)); > if (result.hasException()) > return result.releaseException(); > return { }; >diff --git a/Source/WebCore/platform/ColorData.gperf b/Source/WebCore/platform/ColorData.gperf >index 3912341..c481e26 100644 >--- a/Source/WebCore/platform/ColorData.gperf >+++ b/Source/WebCore/platform/ColorData.gperf >@@ -5,7 +5,6 @@ > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wunknown-pragmas" >-#pragma clang diagnostic ignored "-Wdeprecated-register" > #pragma clang diagnostic ignored "-Wimplicit-fallthrough" > #endif > >diff --git a/Source/WebCore/platform/network/create-http-header-name-table b/Source/WebCore/platform/network/create-http-header-name-table >index 755d22e..4e4a3e7 100755 >--- a/Source/WebCore/platform/network/create-http-header-name-table >+++ b/Source/WebCore/platform/network/create-http-header-name-table >@@ -92,10 +92,12 @@ gperf_file.write(''' > #if defined(__clang__) > #pragma clang diagnostic push > #pragma clang diagnostic ignored "-Wunknown-pragmas" >-#pragma clang diagnostic ignored "-Wdeprecated-register" > #pragma clang diagnostic ignored "-Wimplicit-fallthrough" > #endif > >+// Older versions of gperf like to use the `register` keyword. >+#define register >+ > namespace WebCore { > > static const struct HeaderNameString { >diff --git a/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp b/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >index 84f5e2b..2ad6a18 100644 >--- a/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >+++ b/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >@@ -69,7 +69,7 @@ void CurlFormDataStream::clean() > } > } > >-std::optional<const Vector<char>&> CurlFormDataStream::getPostData() >+std::optional<std::reference_wrapper<const Vector<char>>> CurlFormDataStream::getPostData() > { > if (!m_formData) > return std::nullopt; >@@ -77,7 +77,7 @@ std::optional<const Vector<char>&> CurlFormDataStream::getPostData() > if (!m_postData) > m_postData = std::make_unique<Vector<char>>(m_formData->flatten()); > >- return *m_postData; >+ return std::cref(*m_postData); > } > > bool CurlFormDataStream::shouldUseChunkTransfer() >diff --git a/Source/WebCore/platform/network/curl/CurlFormDataStream.h b/Source/WebCore/platform/network/curl/CurlFormDataStream.h >index d1ca1ad..d33df78 100644 >--- a/Source/WebCore/platform/network/curl/CurlFormDataStream.h >+++ b/Source/WebCore/platform/network/curl/CurlFormDataStream.h >@@ -41,7 +41,7 @@ public: > > size_t elementSize() { return m_formData ? m_formData->elements().size() : 0; } > >- std::optional<const Vector<char>&> getPostData(); >+ std::optional<std::reference_wrapper<const Vector<char>>> getPostData(); > bool shouldUseChunkTransfer(); > unsigned long long totalSize(); > >diff --git a/Source/WebCore/testing/MockCDMFactory.cpp b/Source/WebCore/testing/MockCDMFactory.cpp >index 95f7e6b..445ea9b 100644 >--- a/Source/WebCore/testing/MockCDMFactory.cpp >+++ b/Source/WebCore/testing/MockCDMFactory.cpp >@@ -81,12 +81,12 @@ Vector<Ref<SharedBuffer>> MockCDMFactory::removeKeysFromSessionWithID(const Stri > return WTFMove(it->value); > } > >-std::optional<const Vector<Ref<SharedBuffer>>&> MockCDMFactory::keysForSessionWithID(const String& id) const >+std::optional<std::reference_wrapper<const Vector<Ref<SharedBuffer>>>> MockCDMFactory::keysForSessionWithID(const String& id) const > { > auto it = m_sessions.find(id); > if (it == m_sessions.end()) > return std::nullopt; >- return it->value; >+ return std::cref(it->value); > } > > void MockCDMFactory::setSupportedDataTypes(Vector<String>&& types) >@@ -314,11 +314,11 @@ void MockCDMInstance::updateLicense(const String& sessionID, LicenseType, const > > std::optional<KeyStatusVector> changedKeys; > if (responseVector.contains(String(ASCIILiteral("keys-changed")))) { >- std::optional<const Vector<Ref<SharedBuffer>>&> keys = factory->keysForSessionWithID(sessionID); >+ std::optional<std::reference_wrapper<const Vector<Ref<SharedBuffer>>>> keys = factory->keysForSessionWithID(sessionID); > if (keys) { > KeyStatusVector keyStatusVector; >- keyStatusVector.reserveInitialCapacity(keys->size()); >- for (auto& key : *keys) >+ keyStatusVector.reserveInitialCapacity(keys->get().size()); >+ for (auto& key : (*keys).get()) > keyStatusVector.uncheckedAppend({ key.copyRef(), KeyStatus::Usable }); > > changedKeys = WTFMove(keyStatusVector); >diff --git a/Source/WebCore/testing/MockCDMFactory.h b/Source/WebCore/testing/MockCDMFactory.h >index 237b2b3..3e6db21 100644 >--- a/Source/WebCore/testing/MockCDMFactory.h >+++ b/Source/WebCore/testing/MockCDMFactory.h >@@ -73,7 +73,7 @@ public: > bool hasSessionWithID(const String& id) { return m_sessions.contains(id); } > void removeSessionWithID(const String& id) { m_sessions.remove(id); } > void addKeysToSessionWithID(const String& id, Vector<Ref<SharedBuffer>>&&); >- std::optional<const Vector<Ref<SharedBuffer>>&> keysForSessionWithID(const String& id) const; >+ std::optional<std::reference_wrapper<const Vector<Ref<SharedBuffer>>>> keysForSessionWithID(const String& id) const; > Vector<Ref<SharedBuffer>> removeKeysFromSessionWithID(const String& id); > > private: >diff --git a/Source/WebInspectorUI/Configurations/Base.xcconfig b/Source/WebInspectorUI/Configurations/Base.xcconfig >index 850c617..77fe413 100644 >--- a/Source/WebInspectorUI/Configurations/Base.xcconfig >+++ b/Source/WebInspectorUI/Configurations/Base.xcconfig >@@ -12,7 +12,7 @@ DEBUG_INFORMATION_FORMAT = dwarf-with-dsym; > ALWAYS_SEARCH_USER_PATHS = NO; > FRAMEWORK_SEARCH_PATHS = $(WK_QUOTED_OVERRIDE_FRAMEWORKS_DIR) $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks $(inherited); > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/WebKit/Configurations/Base.xcconfig b/Source/WebKit/Configurations/Base.xcconfig >index b07a5b1..c06587a 100644 >--- a/Source/WebKit/Configurations/Base.xcconfig >+++ b/Source/WebKit/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/WebKit/Shared/SandboxExtension.h b/Source/WebKit/Shared/SandboxExtension.h >index 1f76808..8b31c17 100644 >--- a/Source/WebKit/Shared/SandboxExtension.h >+++ b/Source/WebKit/Shared/SandboxExtension.h >@@ -120,7 +120,7 @@ private: > inline SandboxExtension::Handle::Handle() { } > inline SandboxExtension::Handle::~Handle() { } > inline void SandboxExtension::Handle::encode(IPC::Encoder&) const { } >-inline std::optional<SandboxExtension::Handle> SandboxExtension::Handle::decode(IPC::Decoder&) { return {{ }}; } >+ inline std::optional<SandboxExtension::Handle> SandboxExtension::Handle::decode(IPC::Decoder&) { return SanboxExtension::Handle { }; } > inline SandboxExtension::HandleArray::HandleArray() { } > inline SandboxExtension::HandleArray::~HandleArray() { } > inline void SandboxExtension::HandleArray::allocate(size_t) { } >diff --git a/Source/WebKit/Shared/TouchBarMenuItemData.cpp b/Source/WebKit/Shared/TouchBarMenuItemData.cpp >index d0226bb..3cdee82 100644 >--- a/Source/WebKit/Shared/TouchBarMenuItemData.cpp >+++ b/Source/WebKit/Shared/TouchBarMenuItemData.cpp >@@ -65,7 +65,7 @@ std::optional<TouchBarMenuItemData> TouchBarMenuItemData::decode(IPC::Decoder& d > if (!decoder.decode(result.priority)) > return std::nullopt; > >- return WTFMove(result); >+ return std::make_optional(WTFMove(result)); > } > > } >diff --git a/Source/WebKitLegacy/mac/Configurations/Base.xcconfig b/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >index 0a8e2d4..6f2f763 100644 >--- a/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/bmalloc/Configurations/Base.xcconfig b/Source/bmalloc/Configurations/Base.xcconfig >index 9f57289..e90d9d0 100644 >--- a/Source/bmalloc/Configurations/Base.xcconfig >+++ b/Source/bmalloc/Configurations/Base.xcconfig >@@ -30,7 +30,7 @@ USE_INTERNAL_SDK_Release = $(HAVE_INTERNAL_SDK); > > ALWAYS_SEARCH_USER_PATHS = NO; > >-CLANG_CXX_LANGUAGE_STANDARD = gnu++14; >+CLANG_CXX_LANGUAGE_STANDARD = gnu++17; > CLANG_CXX_LIBRARY = libc++; > CLANG_ENABLE_OBJC_WEAK = YES; > CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; >diff --git a/Source/bmalloc/bmalloc/BCompiler.h b/Source/bmalloc/bmalloc/BCompiler.h >index 1a927d8..b903c5f 100644 >--- a/Source/bmalloc/bmalloc/BCompiler.h >+++ b/Source/bmalloc/bmalloc/BCompiler.h >@@ -35,3 +35,16 @@ > > #define BASAN_ENABLED BCOMPILER_HAS_CLANG_FEATURE(address_sanitizer) > >+/* NO_RETURN */ >+ >+#if !defined(NO_RETURN) && defined(__GNUC__) >+#define BNO_RETURN __attribute((__noreturn__)) >+#endif >+ >+#if !defined(BNO_RETURN) && defined(_MSC_VER) >+#define BNO_RETURN __declspec(noreturn) >+#endif >+ >+#if !defined(BNO_RETURN) >+#define BNO_RETURN >+#endif >diff --git a/Source/bmalloc/bmalloc/Scavenger.h b/Source/bmalloc/bmalloc/Scavenger.h >index 858d66a..a7377c4 100644 >--- a/Source/bmalloc/bmalloc/Scavenger.h >+++ b/Source/bmalloc/bmalloc/Scavenger.h >@@ -80,8 +80,8 @@ private: > > void scheduleIfUnderMemoryPressureHoldingLock(size_t bytes); > >- static void threadEntryPoint(Scavenger*); >- void threadRunLoop(); >+ BNO_RETURN static void threadEntryPoint(Scavenger*); >+ BNO_RETURN void threadRunLoop(); > > void setSelfQOSClass(); > void setThreadName(const char*); >-- >2.10.1 >
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 185176
:
339244
|
339245
|
340503
|
340508
|
340557
|
340611
|
340624
|
340697
|
340858