WebKit Bugzilla
Attachment 339262 Details for
Bug 185159
: Use default std::optional if it is provided
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-185159-20180502122424.patch (text/plain), 23.07 KB, created by
Yusuke Suzuki
on 2018-05-01 20:24:26 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-05-01 20:24:26 PDT
Size:
23.07 KB
patch
obsolete
>Subversion Revision: 231220 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 881b164c933eb2ad221e365a7e5aac9cf346a5f7..ed7f5a2f574ffe32caaeccec949b3ba27a99716f 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,32 @@ >+2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Use default std::optional if it is provided >+ https://bugs.webkit.org/show_bug.cgi?id=185159 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Now C++17 flag is enabled. It means that any standard libraries can use <optional> internally. >+ If we define std::optional regardless of the existence of the standard library's <optional>, >+ it causes compile errors. For example, in GCC 7 (specifically GCC 7.3.0) environment, >+ <optional> is included in <unordered_map>. >+ We do not define std::optional in WebKit side if <optional> is offered. >+ >+ And we also remove std::optional<T&> use since this is not accepted in C++17. Use >+ std::optional<std::reference_wrapper<T>> instead. >+ >+ * wtf/Expected.h: >+ constexpr does not mean const in C++17. >+ >+ * wtf/Optional.h: >+ Do not define std::optional if <optional> is provided. >+ >+ (WTF::valueOrCompute): >+ >+ * wtf/Expected.h: >+ * wtf/Optional.h: >+ (WTF::valueOrCompute): >+ * wtf/StdLibExtras.h: >+ > 2018-05-01 Robin Morisset <rmorisset@apple.com> > > Correctly detect string overflow when using the 'Function' constructor >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d6feeb697fd8b46cbfc5b18eb48e406d2f99a6c3..bb497f386de70e5164e83a0c0223f97685e64136 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,35 @@ >+2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Use default std::optional if it is provided >+ https://bugs.webkit.org/show_bug.cgi?id=185159 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/mediastream/RTCPeerConnection.cpp: >+ (WebCore::iceServersFromConfiguration): >+ (WebCore::RTCPeerConnection::setConfiguration): >+ * css/parser/CSSParser.cpp: >+ (WebCore::CSSParser::parseSystemColor): >+ * css/parser/CSSParser.h: >+ * dom/DatasetDOMStringMap.cpp: >+ (WebCore::DatasetDOMStringMap::item const): >+ (WebCore::DatasetDOMStringMap::namedItem const): >+ (WebCore:: const): Deleted. >+ * dom/DatasetDOMStringMap.h: >+ * dom/Element.cpp: >+ (WebCore::Element::insertAdjacentHTML): >+ * dom/Element.h: >+ * inspector/DOMEditor.cpp: >+ * platform/network/curl/CurlFormDataStream.cpp: >+ (WebCore::CurlFormDataStream::getPostData): >+ (): Deleted. >+ * platform/network/curl/CurlFormDataStream.h: >+ * testing/MockCDMFactory.cpp: >+ (WebCore::MockCDMFactory::keysForSessionWithID const): >+ (WebCore::MockCDMInstance::updateLicense): >+ (WebCore:: const): Deleted. >+ * testing/MockCDMFactory.h: >+ > 2018-05-01 Wenson Hsieh <wenson_hsieh@apple.com> > > Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 5854d6db9669d574ed21d9d1612cd72dc51e2587..3a4c55b642c6cacbf42e1fc8d26b11c1540208ef 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Use default std::optional if it is provided >+ https://bugs.webkit.org/show_bug.cgi?id=185159 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/SandboxExtension.h: >+ (WebKit::SandboxExtension::Handle::decode): >+ * Shared/TouchBarMenuItemData.cpp: >+ (WebKit::TouchBarMenuItemData::decode): >+ > 2018-05-01 Jer Noble <jer.noble@apple.com> > > Production build error in Migrate Header phase when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value >diff --git a/Source/WTF/wtf/Expected.h b/Source/WTF/wtf/Expected.h >index dd045e59875e4f4767eb2eb179c1c2719e0af2e2..e9b0ec9f9e645eceedd6f40e42cf891405737a54 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 a3fc58908345ac1b0a224bc2f179846916d9d2d7..dc85c039018db12e68cc215374dcebf1163b25f5 100644 >--- a/Source/WTF/wtf/Optional.h >+++ b/Source/WTF/wtf/Optional.h >@@ -47,6 +47,16 @@ > # include <wtf/Compiler.h> > # include <wtf/StdLibExtras.h> > >+#if __has_include(<optional>) >+# include <optional> >+#endif >+ >+#if defined(__cpp_lib_optional) && __cpp_lib_optional >= 201603 >+ >+// Use default std::optional. >+ >+#else >+ > # define TR2_OPTIONAL_REQUIRES(...) typename std::enable_if<__VA_ARGS__::value, bool>::type = false > > # if defined __GNUC__ // NOTE: GNUC is also defined for Clang >@@ -1012,20 +1022,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 +1050,20 @@ namespace std > # undef TR2_OPTIONAL_REQUIRES > # undef TR2_OPTIONAL_ASSERTED_EXPRESSION > >+#endif // defined(__cpp_lib_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 49f2e2988d926bc56595ebc9a0ce927184087abe..676f9c6c0ee358e46291fc9ddfe83eb7e66933b8 100644 >--- a/Source/WTF/wtf/StdLibExtras.h >+++ b/Source/WTF/wtf/StdLibExtras.h >@@ -543,7 +543,7 @@ template<class B0, class B1, class B2, class... Bn> struct wtf_conjunction_impl< > template<class... _Args> struct conjunction : wtf_conjunction_impl<_Args...> { }; > #endif > >-#if __cplusplus < 201703L >+#if __cplusplus < 201703L && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918) > > // These are inline variable for C++17 and later. > #define __IN_PLACE_INLINE_VARIABLE static const >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >index 851c9c82af4097eed35f610c7acf5d25dbd44b35..536c5526a28b567b05f05fc57cc2acd50f7fbe70 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/css/parser/CSSParser.cpp b/Source/WebCore/css/parser/CSSParser.cpp >index 954ab082e9e663b65ba145864c767acbd67d36d6..33f52e1a653e5bd30ff64cddf2020d73bfa50e71 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 d92fa5a76c3d0c66decbe838dacc44d25d5b4aa4..aee78e57a1f79307e4201772d4246948b11580ba 100644 >--- a/Source/WebCore/css/parser/CSSParser.h >+++ b/Source/WebCore/css/parser/CSSParser.h >@@ -78,7 +78,7 @@ class CSSParser { > 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 f2d84207b97a3364954d730a10b488e3e383c648..8e86aeefe5dc7885377facc92f6cdc5c555122c6 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 483f763cc16cf9641bea53f4dbe69b483ba1b7d3..d6d10d126122dccc997d978f5ea254c3224fff34 100644 >--- a/Source/WebCore/dom/DatasetDOMStringMap.h >+++ b/Source/WebCore/dom/DatasetDOMStringMap.h >@@ -53,7 +53,7 @@ class DatasetDOMStringMap final : public ScriptWrappable { > 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 a432397d7179b141d20df80fcbe46953cb186496..273d8cae726adaa56be550e20a70bae2671bad5e 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 9e52d3315539945465703214117d7b206a3f2aa3..9af411304f4d998aab11b924af91d2190006fd96 100644 >--- a/Source/WebCore/dom/Element.h >+++ b/Source/WebCore/dom/Element.h >@@ -314,7 +314,7 @@ class Element : public ContainerNode { > 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 3493b017ca06b9f29762327fa31353db8f958698..59eccd405c037ef2a440c4d551c9cbca121c6aa0 100644 >--- a/Source/WebCore/inspector/DOMEditor.cpp >+++ b/Source/WebCore/inspector/DOMEditor.cpp >@@ -266,7 +266,7 @@ class DOMEditor::InsertAdjacentHTMLAction final : public InspectorHistory::Actio > > 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/network/curl/CurlFormDataStream.cpp b/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp >index 84f5e2b942b8a21cc2c4500fc35e11df095a66e8..2ad6a18724b2fac0424065601c529aaf92c9824a 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 d1ca1ad5f00a676ffae209602767db26b59b00d1..d33df78033a14579c1ecb25b84e5df0217a198fe 100644 >--- a/Source/WebCore/platform/network/curl/CurlFormDataStream.h >+++ b/Source/WebCore/platform/network/curl/CurlFormDataStream.h >@@ -41,7 +41,7 @@ class CurlFormDataStream { > > 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 95f7e6bdb28c85fe66f04e27800052d74389e7ad..445ea9b5879748f8d60d629f933c93e099701a0f 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 237b2b36426330bc75a04df350e081ab78861843..3e6db21d01bcd5a50af5e97650c3f14b8b79648d 100644 >--- a/Source/WebCore/testing/MockCDMFactory.h >+++ b/Source/WebCore/testing/MockCDMFactory.h >@@ -73,7 +73,7 @@ class MockCDMFactory : public RefCounted<MockCDMFactory>, private CDMFactory { > 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/WebKit/Shared/SandboxExtension.h b/Source/WebKit/Shared/SandboxExtension.h >index 1f76808564ed4db6e5c0ce1eb63021171e90ed1b..cb53aade63e39f32e2bf62678de7c3cb942df382 100644 >--- a/Source/WebKit/Shared/SandboxExtension.h >+++ b/Source/WebKit/Shared/SandboxExtension.h >@@ -120,7 +120,7 @@ class SandboxExtension : public RefCounted<SandboxExtension> { > 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 SandboxExtension::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 d0226bb9a9ec1bae1835bbdde1348c12866bd103..3cdee82d0adf3435c8ed9cfcd7dbd4639f810180 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/cmake/OptionsMSVC.cmake b/Source/cmake/OptionsMSVC.cmake >index 7f378ff8aa9f76cfbc6b6111f9f983d62f636605..ac18de4babc02fd4a2d7bc36a1eb4f557c4f3292 100644 >--- a/Source/cmake/OptionsMSVC.cmake >+++ b/Source/cmake/OptionsMSVC.cmake >@@ -32,6 +32,9 @@ add_compile_options(/Gy- /openmp- /GF-) > # Specify the source code encoding > add_compile_options(/utf-8 /validate-charset) > >+# Enable C++17 >+add_compile_options(/std:c++latest) >+ > if (${CMAKE_BUILD_TYPE} MATCHES "Debug") > set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /OPT:NOREF /OPT:NOICF") > set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /OPT:NOREF /OPT:NOICF") >diff --git a/ChangeLog b/ChangeLog >index 2a736dfc47d696408c736787eafbffdb3d9d142a..b61446dd3b0a60ad4cdc35bd52309e82f104e5f6 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,12 @@ >+2018-05-01 Yusuke Suzuki <utatane.tea@gmail.com> >+ >+ Use default std::optional if it is provided >+ https://bugs.webkit.org/show_bug.cgi?id=185159 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Source/cmake/OptionsMSVC.cmake: >+ > 2018-05-01 Leo Balter <leonardo.balter@gmail.com> > > Auto save the results for Test262
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 185159
:
339186
|
339187
|
339188
|
339194
|
339197
|
339261
|
339262
|
339263
|
339267
|
339489
|
339491