Diff
Modified: trunk/Source/WTF/ChangeLog (231307 => 231308)
--- trunk/Source/WTF/ChangeLog 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WTF/ChangeLog 2018-05-03 16:37:01 UTC (rev 231308)
@@ -1,3 +1,22 @@
+2018-05-03 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, rolling out r231223 and r231288.
+ https://bugs.webkit.org/show_bug.cgi?id=185256
+
+ The change in r231223 breaks internal builds, and r231288 is a
+ dependent change. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Use default std::optional if it is provided"
+ https://bugs.webkit.org/show_bug.cgi?id=185159
+ https://trac.webkit.org/changeset/231223
+
+ "Use pointer instead of
+ std::optional<std::reference_wrapper<>>"
+ https://bugs.webkit.org/show_bug.cgi?id=185186
+ https://trac.webkit.org/changeset/231288
+
2018-05-02 Commit Queue <commit-qu...@webkit.org>
Unreviewed, rolling out r231251.
Modified: trunk/Source/WTF/wtf/Expected.h (231307 => 231308)
--- trunk/Source/WTF/wtf/Expected.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WTF/wtf/Expected.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -573,5 +573,5 @@
}}} // namespace std::experimental::fundamentals_v3
-__EXPECTED_INLINE_VARIABLE constexpr auto& unexpect = std::experimental::unexpect;
+__EXPECTED_INLINE_VARIABLE constexpr std::experimental::unexpected_t& unexpect = std::experimental::unexpect;
template<class T, class E> using Expected = std::experimental::expected<T, E>;
Modified: trunk/Source/WTF/wtf/Optional.h (231307 => 231308)
--- trunk/Source/WTF/wtf/Optional.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WTF/wtf/Optional.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -47,16 +47,6 @@
# include <wtf/Compiler.h>
# include <wtf/StdLibExtras.h>
-#if !COMPILER(MSVC) && __has_include(<optional>)
-# include <optional>
-#endif
-
-#if !COMPILER(MSVC) && 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
@@ -1022,6 +1012,20 @@
} // 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>
@@ -1050,20 +1054,4 @@
# 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;
Modified: trunk/Source/WebCore/ChangeLog (231307 => 231308)
--- trunk/Source/WebCore/ChangeLog 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/ChangeLog 2018-05-03 16:37:01 UTC (rev 231308)
@@ -1,3 +1,22 @@
+2018-05-03 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, rolling out r231223 and r231288.
+ https://bugs.webkit.org/show_bug.cgi?id=185256
+
+ The change in r231223 breaks internal builds, and r231288 is a
+ dependent change. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Use default std::optional if it is provided"
+ https://bugs.webkit.org/show_bug.cgi?id=185159
+ https://trac.webkit.org/changeset/231223
+
+ "Use pointer instead of
+ std::optional<std::reference_wrapper<>>"
+ https://bugs.webkit.org/show_bug.cgi?id=185186
+ https://trac.webkit.org/changeset/231288
+
2018-05-03 Ryan Haddad <ryanhad...@apple.com>
Unreviewed, rolling out r231253.
Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp (231307 => 231308)
--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -301,7 +301,7 @@
}
// Implementation of https://w3c.github.io/webrtc-pc/#set-pc-configuration
-static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, const RTCConfiguration* existingConfiguration, bool isLocalDescriptionSet)
+static inline ExceptionOr<Vector<MediaEndpointConfiguration::IceServerInfo>> iceServersFromConfiguration(RTCConfiguration& newConfiguration, std::optional<const RTCConfiguration&> existingConfiguration, bool isLocalDescriptionSet)
{
if (existingConfiguration && newConfiguration.bundlePolicy != existingConfiguration->bundlePolicy)
return Exception { InvalidModificationError, "IceTransportPolicy does not match existing policy" };
@@ -342,7 +342,7 @@
{
INFO_LOG(LOGIDENTIFIER);
- auto servers = iceServersFromConfiguration(configuration, nullptr, false);
+ auto servers = iceServersFromConfiguration(configuration, std::nullopt, false);
if (servers.hasException())
return servers.releaseException();
@@ -360,7 +360,7 @@
INFO_LOG(LOGIDENTIFIER);
- auto servers = iceServersFromConfiguration(configuration, &m_configuration, m_backend->isLocalDescriptionSet());
+ auto servers = iceServersFromConfiguration(configuration, m_configuration, m_backend->isLocalDescriptionSet());
if (servers.hasException())
return servers.releaseException();
Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (231307 => 231308)
--- trunk/Source/WebCore/css/parser/CSSParser.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -178,7 +178,7 @@
return primitiveValue.color();
}
-Color CSSParser::parseSystemColor(const String& string, const CSSParserContext* context)
+Color CSSParser::parseSystemColor(const String& string, std::optional<const CSSParserContext&> context)
{
CSSValueID id = cssValueKeywordID(string);
if (!StyleColor::isSystemColor(id))
@@ -185,7 +185,7 @@
return Color();
OptionSet<StyleColor::Options> options;
- if (context && context->useSystemAppearance)
+ if (context && context.value().useSystemAppearance)
options |= StyleColor::Options::UseSystemAppearance;
return RenderTheme::singleton().systemColor(id, options);
}
Modified: trunk/Source/WebCore/css/parser/CSSParser.h (231307 => 231308)
--- trunk/Source/WebCore/css/parser/CSSParser.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/css/parser/CSSParser.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -78,7 +78,7 @@
RefPtr<CSSValue> parseValueWithVariableReferences(CSSPropertyID, const CSSValue&, const CustomPropertyValueMap& customProperties, TextDirection, WritingMode);
static Color parseColor(const String&, bool strict = false);
- static Color parseSystemColor(const String&, const CSSParserContext*);
+ static Color parseSystemColor(const String&, std::optional<const CSSParserContext&>);
private:
ParseResult parseValue(MutableStyleProperties&, CSSPropertyID, const String&, bool important);
Modified: trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp (231307 => 231308)
--- trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/dom/DatasetDOMStringMap.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -188,7 +188,7 @@
return names;
}
-const AtomicString* DatasetDOMStringMap::item(const String& propertyName) const
+std::optional<const AtomicString&> DatasetDOMStringMap::item(const String& propertyName) const
{
if (m_element.hasAttributes()) {
AttributeIteratorAccessor attributeIteratorAccessor = m_element.attributesIterator();
@@ -198,24 +198,22 @@
// 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 attribute.value();
} else {
AtomicString attributeName = convertPropertyNameToAttributeName(propertyName);
for (const Attribute& attribute : attributeIteratorAccessor) {
if (attribute.localName() == attributeName)
- return &attribute.value();
+ return attribute.value();
}
}
}
- return nullptr;
+ return std::nullopt;
}
String DatasetDOMStringMap::namedItem(const AtomicString& name) const
{
- if (const auto* value = item(name))
- return *value;
- return String { };
+ return item(name).value_or(String { });
}
ExceptionOr<void> DatasetDOMStringMap::setNamedItem(const String& name, const String& value)
Modified: trunk/Source/WebCore/dom/DatasetDOMStringMap.h (231307 => 231308)
--- trunk/Source/WebCore/dom/DatasetDOMStringMap.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/dom/DatasetDOMStringMap.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -53,7 +53,7 @@
Element& element() { return m_element; }
private:
- const AtomicString* item(const String& name) const;
+ std::optional<const AtomicString&> item(const String& name) const;
Element& m_element;
};
Modified: trunk/Source/WebCore/dom/Element.cpp (231307 => 231308)
--- trunk/Source/WebCore/dom/Element.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/dom/Element.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -3732,7 +3732,7 @@
}
// https://w3c.github.io/DOM-Parsing/#dom-element-insertadjacenthtml
-ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& markup, NodeVector* addedNodes)
+ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& markup, std::optional<NodeVector&> addedNodes)
{
// Steps 1 and 2.
auto contextElement = contextElementForInsertion(where, *this);
@@ -3758,7 +3758,7 @@
ExceptionOr<void> Element::insertAdjacentHTML(const String& where, const String& markup)
{
- return insertAdjacentHTML(where, markup, nullptr);
+ return insertAdjacentHTML(where, markup, std::nullopt);
}
ExceptionOr<void> Element::insertAdjacentText(const String& where, const String& text)
Modified: trunk/Source/WebCore/dom/Element.h (231307 => 231308)
--- trunk/Source/WebCore/dom/Element.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/dom/Element.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -314,7 +314,7 @@
WEBCORE_EXPORT void setTabIndex(int);
virtual RefPtr<Element> focusDelegate();
- ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html, NodeVector* addedNodes);
+ ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html, std::optional<NodeVector&> addedNodes);
WEBCORE_EXPORT ExceptionOr<Element*> insertAdjacentElement(const String& where, Element& newChild);
WEBCORE_EXPORT ExceptionOr<void> insertAdjacentHTML(const String& where, const String& html);
Modified: trunk/Source/WebCore/html/canvas/CanvasStyle.cpp (231307 => 231308)
--- trunk/Source/WebCore/html/canvas/CanvasStyle.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/html/canvas/CanvasStyle.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -53,7 +53,7 @@
Color color = CSSParser::parseColor(colorString);
if (color.isValid())
return color;
- return CSSParser::parseSystemColor(colorString, nullptr);
+ return CSSParser::parseSystemColor(colorString, std::nullopt);
}
Color currentColor(HTMLCanvasElement* canvas)
Modified: trunk/Source/WebCore/inspector/DOMEditor.cpp (231307 => 231308)
--- trunk/Source/WebCore/inspector/DOMEditor.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/inspector/DOMEditor.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -266,7 +266,7 @@
ExceptionOr<void> redo() final
{
- auto result = m_element->insertAdjacentHTML(m_position, m_html, &m_addedNodes);
+ auto result = m_element->insertAdjacentHTML(m_position, m_html, m_addedNodes);
if (result.hasException())
return result.releaseException();
return { };
Modified: trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp (231307 => 231308)
--- trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -69,15 +69,15 @@
}
}
-const Vector<char>* CurlFormDataStream::getPostData()
+std::optional<const Vector<char>&> CurlFormDataStream::getPostData()
{
if (!m_formData)
- return nullptr;
+ return std::nullopt;
if (!m_postData)
m_postData = std::make_unique<Vector<char>>(m_formData->flatten());
- return m_postData.get();
+ return *m_postData;
}
bool CurlFormDataStream::shouldUseChunkTransfer()
Modified: trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.h (231307 => 231308)
--- trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -41,7 +41,7 @@
size_t elementSize() { return m_formData ? m_formData->elements().size() : 0; }
- const Vector<char>* getPostData();
+ std::optional<const Vector<char>&> getPostData();
bool shouldUseChunkTransfer();
unsigned long long totalSize();
Modified: trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp (231307 => 231308)
--- trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -489,7 +489,7 @@
// Do not stream for simple POST data
if (elementSize == 1) {
- const auto* postData = m_formDataStream.getPostData();
+ auto postData = m_formDataStream.getPostData();
if (postData && postData->size())
m_curlHandle->setPostFields(postData->data(), postData->size());
} else
Modified: trunk/Source/WebCore/testing/MockCDMFactory.cpp (231307 => 231308)
--- trunk/Source/WebCore/testing/MockCDMFactory.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/testing/MockCDMFactory.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -81,12 +81,12 @@
return WTFMove(it->value);
}
-const Vector<Ref<SharedBuffer>>* MockCDMFactory::keysForSessionWithID(const String& id) const
+std::optional<const Vector<Ref<SharedBuffer>>&> MockCDMFactory::keysForSessionWithID(const String& id) const
{
auto it = m_sessions.find(id);
if (it == m_sessions.end())
- return nullptr;
- return &it->value;
+ return std::nullopt;
+ return it->value;
}
void MockCDMFactory::setSupportedDataTypes(Vector<String>&& types)
@@ -314,7 +314,7 @@
std::optional<KeyStatusVector> changedKeys;
if (responseVector.contains(String(ASCIILiteral("keys-changed")))) {
- const auto* keys = factory->keysForSessionWithID(sessionID);
+ std::optional<const Vector<Ref<SharedBuffer>>&> keys = factory->keysForSessionWithID(sessionID);
if (keys) {
KeyStatusVector keyStatusVector;
keyStatusVector.reserveInitialCapacity(keys->size());
Modified: trunk/Source/WebCore/testing/MockCDMFactory.h (231307 => 231308)
--- trunk/Source/WebCore/testing/MockCDMFactory.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebCore/testing/MockCDMFactory.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -73,7 +73,7 @@
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>>&&);
- const Vector<Ref<SharedBuffer>>* keysForSessionWithID(const String& id) const;
+ std::optional<const Vector<Ref<SharedBuffer>>&> keysForSessionWithID(const String& id) const;
Vector<Ref<SharedBuffer>> removeKeysFromSessionWithID(const String& id);
private:
Modified: trunk/Source/WebKit/ChangeLog (231307 => 231308)
--- trunk/Source/WebKit/ChangeLog 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebKit/ChangeLog 2018-05-03 16:37:01 UTC (rev 231308)
@@ -1,3 +1,22 @@
+2018-05-03 Commit Queue <commit-qu...@webkit.org>
+
+ Unreviewed, rolling out r231223 and r231288.
+ https://bugs.webkit.org/show_bug.cgi?id=185256
+
+ The change in r231223 breaks internal builds, and r231288 is a
+ dependent change. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "Use default std::optional if it is provided"
+ https://bugs.webkit.org/show_bug.cgi?id=185159
+ https://trac.webkit.org/changeset/231223
+
+ "Use pointer instead of
+ std::optional<std::reference_wrapper<>>"
+ https://bugs.webkit.org/show_bug.cgi?id=185186
+ https://trac.webkit.org/changeset/231288
+
2018-05-03 Per Arne Vollan <pvol...@apple.com>
An error message is written to stderr when the WebContent process is blocking WindowServer access.
Modified: trunk/Source/WebKit/Shared/SandboxExtension.h (231307 => 231308)
--- trunk/Source/WebKit/Shared/SandboxExtension.h 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebKit/Shared/SandboxExtension.h 2018-05-03 16:37:01 UTC (rev 231308)
@@ -120,7 +120,7 @@
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 SandboxExtension::Handle { }; }
+inline std::optional<SandboxExtension::Handle> SandboxExtension::Handle::decode(IPC::Decoder&) { return {{ }}; }
inline SandboxExtension::HandleArray::HandleArray() { }
inline SandboxExtension::HandleArray::~HandleArray() { }
inline void SandboxExtension::HandleArray::allocate(size_t) { }
Modified: trunk/Source/WebKit/Shared/TouchBarMenuItemData.cpp (231307 => 231308)
--- trunk/Source/WebKit/Shared/TouchBarMenuItemData.cpp 2018-05-03 16:31:53 UTC (rev 231307)
+++ trunk/Source/WebKit/Shared/TouchBarMenuItemData.cpp 2018-05-03 16:37:01 UTC (rev 231308)
@@ -65,7 +65,7 @@
if (!decoder.decode(result.priority))
return std::nullopt;
- return std::make_optional(WTFMove(result));
+ return WTFMove(result);
}
}