haikuwebkit/Source/WTF/wtf/Variant.h

2085 lines
68 KiB
C
Raw Permalink Normal View History

// Copyright (c) 2015, Just Software Solutions Ltd
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above
// copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of
// its contributors may be used to endorse or promote products
// derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Copied from https://bitbucket.org/anthonyw/variant/src (5bce47fa788648f79e5ea1d77b0eef2e8f0b2999)
// Modified to make it compile with exceptions disabled.
#pragma once
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
#include <functional>
#include <limits.h>
#include <new>
#include <stddef.h>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
#include <wtf/Compiler.h>
#include <wtf/StdLibExtras.h>
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
#if COMPILER(MSVC)
#pragma warning(push)
#pragma warning(disable:4245)
#pragma warning(disable:4521)
#pragma warning(disable:4522)
#pragma warning(disable:4814)
#endif
#if !COMPILER(CLANG) || WTF_CPP_STD_VER >= 14
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
namespace WTF {
#if COMPILER_SUPPORTS(EXCEPTIONS)
#define __THROW_EXCEPTION(__exception) throw __exception;
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
#define __NOEXCEPT noexcept
#define __NOEXCEPT_(__exception) noexcept(__exception)
#else
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
#define __THROW_EXCEPTION(__exception) do { (void)__exception; CRASH(); } while (0);
#define __NOEXCEPT
#define __NOEXCEPT_(...)
#endif
struct __in_place_private{
template<typename>
struct __type_holder;
template<size_t>
struct __value_holder;
};
struct in_place_tag {
in_place_tag() = delete;
};
using in_place_t = in_place_tag(&)(__in_place_private&);
template <class _Type>
using in_place_type_t = in_place_tag(&)(__in_place_private::__type_holder<_Type>&);
template <size_t _Index>
using in_place_index_t = in_place_tag(&)(__in_place_private::__value_holder<_Index>&);
in_place_tag in_place(__in_place_private&);
template <class _Type>
in_place_tag in_place(__in_place_private::__type_holder<_Type> &) {
__THROW_EXCEPTION(__in_place_private());
}
template <size_t _Index>
in_place_tag in_place(__in_place_private::__value_holder<_Index> &) {
__THROW_EXCEPTION(__in_place_private());
}
class bad_variant_access: public std::logic_error{
public:
explicit bad_variant_access(const std::string& what_arg):
std::logic_error(what_arg)
{}
explicit bad_variant_access(const char* what_arg):
std::logic_error(what_arg)
{}
};
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
template<typename T>
NO_RETURN_DUE_TO_CRASH inline T __throw_bad_variant_access(const char* what_arg){
__THROW_EXCEPTION(bad_variant_access(what_arg))
}
template<ptrdiff_t _Offset,typename _Type,typename ... _Types>
struct __type_index_helper;
template<ptrdiff_t _Offset,typename _Type,typename _Head,typename ... _Rest>
struct __type_index_helper<_Offset,_Type,_Head,_Rest...>{
static constexpr ptrdiff_t __value=
__type_index_helper<_Offset+1,_Type,_Rest...>::__value;
};
template<ptrdiff_t _Offset,typename _Type,typename ... _Rest>
struct __type_index_helper<_Offset,_Type,_Type,_Rest...>{
static constexpr ptrdiff_t __value=_Offset;
};
template<typename _Type,typename ... _Types>
struct __type_index{
static constexpr ptrdiff_t __value=
__type_index_helper<0,_Type,_Types...>::__value;
};
template<ptrdiff_t _Index,typename ... _Types>
struct __indexed_type;
template<typename _Head,typename ... _Rest>
struct __indexed_type<0,_Head,_Rest...>{
typedef _Head __type;
};
template<typename _Head,typename ... _Rest>
struct __indexed_type<-1,_Head,_Rest...>{
typedef void __type;
};
template<ptrdiff_t _Index,typename _Head,typename ... _Rest>
struct __indexed_type<_Index,_Head,_Rest...>{
typedef typename __indexed_type<_Index-1,_Rest...>::__type __type;
};
template<ptrdiff_t _Index,typename ..._Types>
struct __next_index{
static constexpr ptrdiff_t __value=
(_Index>=ptrdiff_t(sizeof...(_Types)-1))?-1:_Index+1;
};
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
class Variant;
template<typename>
struct variant_size;
template <typename _Type>
struct variant_size<const _Type> : variant_size<_Type> {};
template <typename _Type>
struct variant_size<volatile _Type> : variant_size<_Type> {};
template <typename _Type>
struct variant_size<const volatile _Type> : variant_size<_Type> {};
template <typename... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct variant_size<Variant<_Types...>>
: std::integral_constant<size_t, sizeof...(_Types)> {};
template<size_t _Index,typename _Type>
struct variant_alternative;
template<size_t _Index,typename _Type>
using variant_alternative_t=typename variant_alternative<_Index,_Type>::type;
template <size_t _Index, typename _Type>
struct variant_alternative<_Index, const _Type>{
using type=std::add_const_t<variant_alternative_t<_Index,_Type>>;
};
template <size_t _Index, typename _Type>
struct variant_alternative<_Index, volatile _Type>{
using type=std::add_volatile_t<variant_alternative_t<_Index,_Type>>;
};
template <size_t _Index, typename _Type>
struct variant_alternative<_Index, volatile const _Type>{
using type=std::add_volatile_t<std::add_const_t<variant_alternative_t<_Index,_Type>>>;
};
template<size_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct variant_alternative<_Index,Variant<_Types...>>{
using type=typename __indexed_type<_Index,_Types...>::__type;
};
constexpr size_t variant_npos=-1;
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type& get(Variant<_Types...>&);
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type const& get(Variant<_Types...> const&);
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type&& get(Variant<_Types...>&&);
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr const _Type&& get(Variant<_Types...> const&&);
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr typename __indexed_type<_Index,_Types...>::__type& get(Variant<_Types...>&);
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr typename __indexed_type<_Index,_Types...>::__type&& get(Variant<_Types...>&&);
template<ptrdiff_t _Index,typename ... _Types>
constexpr typename __indexed_type<_Index,_Types...>::__type const& get(
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant<_Types...> const&);
template <ptrdiff_t _Index, typename... _Types>
constexpr const typename __indexed_type<_Index, _Types...>::__type &&
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
get(Variant<_Types...> const &&);
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>&);
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const&);
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type> get_if(Variant<_Types...>&);
template<ptrdiff_t _Index,typename ... _Types>
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type const> get_if(
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant<_Types...> const&);
template<ptrdiff_t _Index,typename ... _Types>
struct __variant_accessor;
template<size_t __count,
bool __larger_than_char=(__count>SCHAR_MAX),
bool __larger_than_short=(__count>SHRT_MAX),
bool __larger_than_int=(__count>INT_MAX)>
struct __discriminator_type{
typedef signed char __type;
};
template<size_t __count>
struct __discriminator_type<__count,true,false,false>{
typedef signed short __type;
};
template<size_t __count>
struct __discriminator_type<__count,true,true,false>{
typedef int __type;
};
template<size_t __count>
struct __discriminator_type<__count,true,true,true>{
typedef signed long __type;
};
template<typename _Type>
struct __stored_type{
typedef _Type __type;
};
template<typename _Type>
struct __stored_type<_Type&>{
typedef _Type* __type;
};
template<typename ... _Types>
struct __all_trivially_destructible;
template<>
struct __all_trivially_destructible<> {
static constexpr bool __value=true;
};
template<typename _Type>
struct __all_trivially_destructible<_Type> {
static constexpr bool __value=
std::is_trivially_destructible<typename __stored_type<_Type>::__type>::value;
};
template<typename _Head,typename ... _Rest>
struct __all_trivially_destructible<_Head,_Rest...> {
static constexpr bool __value=
__all_trivially_destructible<_Head>::__value &&
__all_trivially_destructible<_Rest...>::__value;
};
template<typename _Target,typename ... _Args>
struct __storage_nothrow_constructible{
static const bool __value=
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
std::is_nothrow_constructible<_Target, _Args...>::value;
};
template<typename ... _Types>
struct __storage_nothrow_move_constructible;
template<>
struct __storage_nothrow_move_constructible<> {
static constexpr bool __value=true;
};
template<typename _Type>
struct __storage_nothrow_move_constructible<_Type> {
static constexpr bool __value=
std::is_nothrow_move_constructible<
typename __stored_type<_Type>::__type>::value;
};
template<typename _Head,typename ... _Rest>
struct __storage_nothrow_move_constructible<_Head,_Rest...> {
static constexpr bool __value=
__storage_nothrow_move_constructible<_Head>::__value &&
__storage_nothrow_move_constructible<_Rest...>::__value;
};
template<ptrdiff_t _Index,typename ... _Types>
struct __other_storage_nothrow_move_constructible;
template<typename _Head,typename ... _Rest>
struct __other_storage_nothrow_move_constructible<0,_Head,_Rest...>{
static const bool __value=__storage_nothrow_move_constructible<_Rest...>::__value;
};
template<typename _Head,typename ... _Rest>
struct __other_storage_nothrow_move_constructible<-1,_Head,_Rest...>{
static const bool __value=
__storage_nothrow_move_constructible<_Head,_Rest...>::__value;
};
template<ptrdiff_t _Index,typename _Head,typename ... _Rest>
struct __other_storage_nothrow_move_constructible<_Index,_Head,_Rest...>{
static const bool __value=
__storage_nothrow_move_constructible<_Head>::__value &&
__other_storage_nothrow_move_constructible<_Index-1,_Rest...>::__value;
};
template<ptrdiff_t _Index,typename ... _Types>
struct __backup_storage_required{
static const bool __value=
!__storage_nothrow_move_constructible<
typename __indexed_type<_Index,_Types...>::__type>::__value &&
!__other_storage_nothrow_move_constructible<_Index,_Types...>::__value;
};
template<ptrdiff_t _Index,ptrdiff_t _Count,typename ... _Types>
struct __any_backup_storage_required_impl{
static const bool __value=
__backup_storage_required<_Index,_Types...>::__value ||
__any_backup_storage_required_impl<_Index+1,_Count-1,_Types...>::__value;
};
template<ptrdiff_t _Index,typename ... _Types>
struct __any_backup_storage_required_impl<_Index,0,_Types...>{
static const bool __value=false;
};
template<typename _Variant>
struct __any_backup_storage_required;
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct __any_backup_storage_required<Variant<_Types...> >{
static const bool __value=
__any_backup_storage_required_impl<0,sizeof...(_Types),_Types...>::__value;
};
template<typename ... _Types>
union __variant_data;
// std::is_literal_type is deprecated in C++17 and removed in C++20
ALLOW_DEPRECATED_DECLARATIONS_BEGIN
template<typename _Type,bool=std::is_literal_type<_Type>::value>
struct __variant_storage{
typedef _Type __type;
static constexpr _Type& __get(__type& __val){
return __val;
}
static constexpr _Type&& __get_rref(__type& __val){
return std::move(__val);
}
static constexpr const _Type& __get(__type const& __val){
return __val;
}
static constexpr const _Type&& __get_rref(__type const& __val){
return std::move(__val);
}
static void __destroy(__type&){}
};
ALLOW_DEPRECATED_DECLARATIONS_END
template<typename _Type>
struct __storage_wrapper{
typename std::aligned_storage<sizeof(_Type),alignof(_Type)>::type __storage;
template<typename ... _Args>
static constexpr void __construct(void* __p,_Args&& ... __args){
new (__p) _Type(std::forward<_Args>(__args)...);
}
template <typename _Dummy = _Type>
__storage_wrapper(
typename std::enable_if<std::is_default_constructible<_Dummy>::value,
void (__storage_wrapper::*)()>::type = nullptr) {
__construct(&__storage);
}
template <typename _Dummy = _Type>
__storage_wrapper(
typename std::enable_if<!std::is_default_constructible<_Dummy>::value,
void (__storage_wrapper::*)()>::type = nullptr) {
}
template<typename _First,typename ... _Args>
__storage_wrapper(_First&& __first,_Args&& ... __args){
__construct(&__storage,std::forward<_First>(__first),std::forward<_Args>(__args)...);
}
_Type& __get(){
return *static_cast<_Type*>(static_cast<void*>(&__storage));
}
constexpr _Type const& __get() const{
return *static_cast<_Type const*>(static_cast<void const*>(&__storage));
}
void __destroy(){
__get().~_Type();
}
};
template<typename _Type>
struct __storage_wrapper<_Type&>{
_Type* __storage;
template<typename _Arg>
constexpr __storage_wrapper(_Arg& __arg):
__storage(&__arg){}
_Type& __get(){
return *__storage;
}
constexpr _Type const& __get() const{
return *__storage;
}
};
template<typename _Type>
struct __variant_storage<_Type,false>{
typedef __storage_wrapper<_Type> __type;
static constexpr _Type& __get(__type& __val){
return __val.__get();
}
static constexpr _Type&& __get_rref(__type& __val){
return std::move(__val.__get());
}
static constexpr const _Type& __get(__type const& __val){
return __val.__get();
}
static constexpr const _Type&& __get_rref(__type const& __val){
return std::move(__val.__get());
}
static void __destroy(__type& __val){
__val.__destroy();
}
};
template<typename _Type,bool __b>
struct __variant_storage<_Type&,__b>{
typedef _Type* __type;
static constexpr _Type& __get(__type& __val){
return *__val;
}
static constexpr _Type& __get_rref(__type& __val){
return *__val;
}
static constexpr _Type& __get(__type const& __val){
return *__val;
}
static constexpr _Type& __get_rref(__type const& __val){
return *__val;
}
static void __destroy(__type&){}
};
template<typename _Type,bool __b>
struct __variant_storage<_Type&&,__b>{
typedef _Type* __type;
static constexpr _Type&& __get(__type& __val){
return static_cast<_Type&&>(*__val);
}
static constexpr _Type&& __get_rref(__type& __val){
return static_cast<_Type&&>(*__val);
}
static constexpr _Type&& __get(__type const& __val){
return static_cast<_Type&&>(*__val);
}
static constexpr _Type&& __get_rref(__type const& __val){
return static_cast<_Type&&>(*__val);
}
static void __destroy(__type&){}
};
template<>
union __variant_data<>{
constexpr __variant_data(){}
};
template<typename _Type>
union __variant_data<_Type>{
typename __variant_storage<_Type>::__type __val;
struct __dummy_type{} __dummy;
constexpr __variant_data():__dummy(){}
template<typename ... _Args>
constexpr __variant_data(in_place_index_t<0>,_Args&& ... __args):
__val(std::forward<_Args>(__args)...){}
_Type& __get(in_place_index_t<0>){
return __variant_storage<_Type>::__get(__val);
}
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
/*constexpr*/ _Type&& __get_rref(in_place_index_t<0>){
return __variant_storage<_Type>::__get_rref(__val);
}
constexpr const _Type& __get(in_place_index_t<0>) const{
return __variant_storage<_Type>::__get(__val);
}
constexpr const _Type&& __get_rref(in_place_index_t<0>) const{
return __variant_storage<_Type>::__get_rref(__val);
}
void __destroy(in_place_index_t<0>){
__variant_storage<_Type>::__destroy(__val);
}
};
template<typename _Type>
union __variant_data<_Type&>{
typename __variant_storage<_Type&>::__type __val;
struct __dummy_type{} __dummy;
constexpr __variant_data():__dummy(){}
template<typename ... _Args>
constexpr __variant_data(in_place_index_t<0>,_Args&& ... __args):
__val(&std::forward<_Args>(__args)...){}
_Type& __get(in_place_index_t<0>){
return __variant_storage<_Type&>::__get(__val);
}
constexpr _Type& __get(in_place_index_t<0>) const{
return __variant_storage<_Type&>::__get(__val);
}
_Type& __get_rref(in_place_index_t<0>){
return __variant_storage<_Type&>::__get_rref(__val);
}
constexpr _Type& __get_rref(in_place_index_t<0>) const{
return __variant_storage<_Type&>::__get_rref(__val);
}
void __destroy(in_place_index_t<0>){
__variant_storage<_Type&>::__destroy(__val);
}
};
template<typename _Type>
union __variant_data<_Type&&>{
typename __variant_storage<_Type&&>::__type __val;
struct __dummy_type{} __dummy;
constexpr __variant_data():__dummy(){}
template<typename _Arg>
__variant_data(in_place_index_t<0>,_Arg&& __arg):
__val(&__arg){}
_Type&& __get(in_place_index_t<0>){
return __variant_storage<_Type&&>::__get(__val);
}
constexpr _Type&& __get(in_place_index_t<0>) const{
return __variant_storage<_Type&&>::__get(__val);
}
_Type&& __get_rref(in_place_index_t<0>){
return __variant_storage<_Type&&>::__get_rref(__val);
}
constexpr _Type&& __get_rref(in_place_index_t<0>) const{
return __variant_storage<_Type&&>::__get_rref(__val);
}
void __destroy(in_place_index_t<0>){
__variant_storage<_Type&&>::__destroy(__val);
}
};
template<typename _Head,typename ... _Rest>
union __variant_data<_Head,_Rest...>{
__variant_data<_Head> __head;
__variant_data<_Rest...> __rest;
constexpr __variant_data():
__head(){}
template<typename ... _Args>
constexpr __variant_data(in_place_index_t<0>,_Args&& ... __args):
__head(in_place<0>,std::forward<_Args>(__args)...){}
template<size_t _Index,typename ... _Args>
constexpr __variant_data(in_place_index_t<_Index>,_Args&& ... __args):
__rest(in_place<_Index-1>,std::forward<_Args>(__args)...){}
_Head& __get(in_place_index_t<0>){
return __head.__get(in_place<0>);
}
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
/*constexpr*/ _Head&& __get_rref(in_place_index_t<0>){
return __head.__get_rref(in_place<0>);
}
constexpr const _Head& __get(in_place_index_t<0>) const{
return __head.__get(in_place<0>);
}
constexpr const _Head&& __get_rref(in_place_index_t<0>) const{
return __head.__get_rref(in_place<0>);
}
template<size_t _Index>
typename __indexed_type<_Index-1,_Rest...>::__type& __get(
in_place_index_t<_Index>){
return __rest.__get(in_place<_Index-1>);
}
template<size_t _Index>
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
/*constexpr*/ typename __indexed_type<_Index-1,_Rest...>::__type&& __get_rref(
in_place_index_t<_Index>){
return __rest.__get_rref(in_place<_Index-1>);
}
template<size_t _Index>
constexpr const typename __indexed_type<_Index-1,_Rest...>::__type& __get(
in_place_index_t<_Index>) const{
return __rest.__get(in_place<_Index-1>);
}
template<size_t _Index>
constexpr const typename __indexed_type<_Index-1,_Rest...>::__type&& __get_rref(
in_place_index_t<_Index>) const{
return __rest.__get_rref(in_place<_Index-1>);
}
void __destroy(in_place_index_t<0>){
__head.__destroy(in_place<0>);
}
template<size_t _Index>
void __destroy(in_place_index_t<_Index>){
__rest.__destroy(in_place<_Index-1>);
}
};
template<ptrdiff_t... _Indices>
struct __index_sequence{
typedef __index_sequence<_Indices...,sizeof...(_Indices)> __next;
static constexpr size_t __length=sizeof...(_Indices);
};
template<typename ... _Types>
struct __type_indices;
template<>
struct __type_indices<>{
typedef __index_sequence<> __type;
};
template<typename _Type>
struct __type_indices<_Type>{
typedef __index_sequence<0> __type;
};
template<typename _Type,typename ... _Rest>
struct __type_indices<_Type,_Rest...>{
typedef typename __type_indices<_Rest...>::__type::__next __type;
};
template<typename _Variant>
struct __variant_indices;
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct __variant_indices<Variant<_Types...>>{
typedef typename __type_indices<_Types...>::__type __type;
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __move_construct_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __move_construct_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant*,_Variant&);
template<ptrdiff_t _Index>
static void __move_construct_func(
_Variant * __lhs,_Variant& __rhs){
__lhs->template __emplace_construct<_Index>(
std::move(get<_Index>(__rhs)));
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __move_construct_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__move_construct_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__move_construct_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __move_assign_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __move_assign_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant*,_Variant&);
template<ptrdiff_t _Index>
static void __move_assign_func(
_Variant * __lhs,_Variant& __rhs){
get<_Index>(*__lhs)=std::move(get<_Index>(__rhs));
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __move_assign_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__move_assign_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__move_assign_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __copy_construct_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __copy_construct_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant*,_Variant const&);
template<ptrdiff_t _Index>
static void __copy_construct_func(
_Variant * __lhs,_Variant const& __rhs){
__lhs->template __emplace_construct<_Index>(
get<_Index>(__rhs));
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __copy_construct_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__copy_construct_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__copy_construct_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __copy_assign_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __copy_assign_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant*,_Variant const&);
template<ptrdiff_t _Index>
static void __copy_assign_func(
_Variant * __lhs,_Variant const& __rhs){
get<_Index>(*__lhs)=get<_Index>(__rhs);
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __copy_assign_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__copy_assign_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__copy_assign_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __destroy_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __destroy_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant*);
template<ptrdiff_t _Index>
static void __destroy_func(
_Variant * __self){
if(__self->__index>=0){
__self->__storage.__destroy(in_place<_Index>);
}
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __destroy_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__destroy_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__destroy_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __swap_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __swap_op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __func_type)(_Variant&,_Variant&);
template<ptrdiff_t _Index>
static void __swap_func(
_Variant & __lhs,_Variant & __rhs){
swap(get<_Index>(__lhs),get<_Index>(__rhs));
}
static const __func_type __apply[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __swap_op_table<_Variant,__index_sequence<_Indices...>>::
__func_type
__swap_op_table<_Variant,__index_sequence<_Indices...>>::__apply[
sizeof...(_Indices)]={
&__swap_func<_Indices>...
};
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __equality_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __equality_op_table<_Variant,__index_sequence<_Indices...>>{
typedef bool(* const __compare_func_type)(_Variant const&,_Variant const&);
template<ptrdiff_t _Index>
static constexpr bool __equality_compare_func(
_Variant const& __lhs,_Variant const& __rhs){
return get<_Index>(__lhs)==get<_Index>(__rhs);
}
static constexpr __compare_func_type __equality_compare[sizeof...(_Indices)]={
&__equality_compare_func<_Indices>...
};
};
template<typename _Variant,ptrdiff_t ... _Indices>
constexpr typename __equality_op_table<_Variant,__index_sequence<_Indices...>>::
__compare_func_type
__equality_op_table<_Variant,__index_sequence<_Indices...>>::__equality_compare[
sizeof...(_Indices)];
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __less_than_op_table;
template<typename _Variant,ptrdiff_t ... _Indices>
struct __less_than_op_table<_Variant,__index_sequence<_Indices...>>{
typedef bool(* const __compare_func_type)(_Variant const&,_Variant const&);
template<ptrdiff_t _Index>
static constexpr bool __less_than_compare_func(
_Variant const& __lhs,_Variant const& __rhs){
return get<_Index>(__lhs)<get<_Index>(__rhs);
}
static constexpr __compare_func_type __less_than_compare[sizeof...(_Indices)]={
&__less_than_compare_func<_Indices>...
};
};
template<typename _Variant,ptrdiff_t ... _Indices>
constexpr typename __less_than_op_table<_Variant,__index_sequence<_Indices...>>::
__compare_func_type
__less_than_op_table<_Variant,__index_sequence<_Indices...>>::__less_than_compare[
sizeof...(_Indices)];
template<typename _Variant>
struct __variant_storage_type;
template<typename _Derived,bool __trivial_destructor>
struct __variant_base
{
~__variant_base(){
static_cast<_Derived*>(this)->__destroy_self();
}
};
template<typename _Derived>
struct __variant_base<_Derived,true>{
};
template<ptrdiff_t _Offset,typename _CurrentSequence,
typename _Type,typename ... _Types>
struct __all_indices_helper;
template<ptrdiff_t _Offset,ptrdiff_t ... _Indices,
typename _Type,typename ... _Rest>
struct __all_indices_helper<
_Offset,__index_sequence<_Indices...>,
_Type,_Type,_Rest...>{
typedef typename __all_indices_helper<
_Offset+1,__index_sequence<_Indices...,_Offset>,_Type,_Rest...>::__type
__type;
};
template<ptrdiff_t _Offset,typename _CurrentSequence,
typename _Type,typename _Head,typename ... _Rest>
struct __all_indices_helper<_Offset,_CurrentSequence,_Type,_Head,_Rest...>{
typedef typename __all_indices_helper<
_Offset+1,_CurrentSequence,_Type,_Rest...>::__type __type;
};
template<ptrdiff_t _Offset,typename _CurrentSequence,typename _Type>
struct __all_indices_helper<_Offset,_CurrentSequence,_Type>{
typedef _CurrentSequence __type;
};
template<typename _Type,typename ... _Types>
struct __all_indices{
typedef typename __all_indices_helper<
0,__index_sequence<>,_Type,_Types...>::__type __type;
};
template<typename ... _Sequences>
struct __combine_sequences;
template<ptrdiff_t ... _Indices1,ptrdiff_t ... _Indices2>
struct __combine_sequences<
__index_sequence<_Indices1...>,__index_sequence<_Indices2...>>{
typedef __index_sequence<_Indices1...,_Indices2...> __type;
};
template<typename _Sequence,typename ... _Rest>
struct __combine_sequences<_Sequence,_Rest...>{
typedef typename __combine_sequences<
_Sequence,
typename __combine_sequences<_Rest...>::__type>::__type __type;
};
template<typename _Indices>
struct __first_index;
template<ptrdiff_t _FirstIndex,ptrdiff_t ... _Rest>
struct __first_index<__index_sequence<_FirstIndex,_Rest...>>{
static constexpr ptrdiff_t __value=_FirstIndex;
};
template<ptrdiff_t _Offset,typename _CurrentSequence,
typename _Type,typename ... _Types>
struct __constructible_matches_helper;
template<ptrdiff_t _Offset,typename _Sequence,typename _Type>
struct __constructible_matches_helper<
_Offset,_Sequence,_Type>{
typedef _Sequence __type;
};
template<bool _Accept,ptrdiff_t _Entry>
struct __sequence_or_empty{
typedef __index_sequence<> __type;
};
template<ptrdiff_t _Entry>
struct __sequence_or_empty<true,_Entry>{
typedef __index_sequence<_Entry> __type;
};
template<ptrdiff_t _Offset,typename _CurrentSequence,
typename _Type,typename _Head,typename ... _Rest>
struct __constructible_matches_helper<
_Offset,_CurrentSequence,_Type,_Head,_Rest...>{
typedef
typename __constructible_matches_helper<
_Offset+1,
typename __combine_sequences<
_CurrentSequence,
typename __sequence_or_empty<
std::is_constructible<_Head,_Type>::value,
_Offset>::__type>::__type,
_Type,_Rest...>::__type __type;
};
template<typename _Type,typename ... _Types>
struct __constructible_matches{
typedef typename __constructible_matches_helper<
0,__index_sequence<>,_Type,_Types...>::__type __type;
};
template<typename _Type,typename ... _Types>
struct __type_index_to_construct{
typedef typename __all_indices<_Type,_Types...>::__type __direct_matches;
typedef typename __all_indices<
typename std::remove_const<
typename std::remove_reference<_Type>::type
>::type,_Types...>::__type __value_matches;
typedef typename __all_indices<
_Type,
typename std::remove_const<
typename std::remove_reference<_Types>::type
>::type...>::__type __rref_matches;
typedef typename __constructible_matches<_Type,_Types...>::__type
__constructibles;
static_assert(
(__direct_matches::__length>0) ||
(__value_matches::__length>0) ||
(__rref_matches::__length>0) ||
(__constructibles::__length==1),
"For conversion construction of variants, exactly one type must be constructible");
typedef typename __combine_sequences<
__direct_matches,__value_matches,__rref_matches,
__constructibles>::__type __all_matches;
static constexpr ptrdiff_t __value=__first_index<__all_matches>::__value;
};
struct __replace_construct_helper{
template<
ptrdiff_t _Index,
bool __construct_directly,
bool __indexed_type_has_nothrow_move,
bool __other_types_have_nothrow_move>
struct __helper;
template<typename _Variant,
typename _Indices=typename __variant_indices<_Variant>::__type>
struct __op_table;
};
template<
ptrdiff_t _Index,
bool __other_types_have_nothrow_move>
struct __replace_construct_helper::__helper<
_Index,false,true,__other_types_have_nothrow_move>{
template<typename _Variant,typename ... _Args>
static void __trampoline(_Variant& __v,_Args&& ... __args){
__v.template __two_stage_replace<_Index>(__args...);
}
};
template<
ptrdiff_t _Index,
bool __indexed_type_has_nothrow_move,
bool __other_types_have_nothrow_move>
struct __replace_construct_helper::__helper<
_Index,true,__indexed_type_has_nothrow_move,
__other_types_have_nothrow_move>{
template<typename _Variant,typename ... _Args>
static void __trampoline(_Variant& __v,_Args&& ... __args){
__v.template __direct_replace<_Index>(std::forward<_Args>(__args)...);
}
};
template<
ptrdiff_t _Index>
struct __replace_construct_helper::__helper<
_Index,false,false,true>{
template<typename _Variant,typename ... _Args>
static void __trampoline(_Variant& __v,_Args&& ... __args){
__v.template __local_backup_replace<_Index>(std::forward<_Args>(__args)...);
}
};
template<
ptrdiff_t _Index>
struct __replace_construct_helper::__helper<
_Index,false,false,false>{
template<typename _Variant,typename ... _Args>
static void __trampoline(_Variant& __v,_Args&& ... __args){
__v.template __direct_replace<_Index>(std::forward<_Args>(__args)...);
}
};
template<typename _Variant,ptrdiff_t ... _Indices>
struct __replace_construct_helper::__op_table<_Variant,__index_sequence<_Indices...>>{
typedef void(* const __move_func_type)(_Variant*,_Variant&);
typedef void(* const __copy_func_type)(_Variant*,_Variant const&);
template<ptrdiff_t _Index>
static void __move_assign_func(
_Variant * __lhs,_Variant& __rhs){
__lhs->template __replace_construct<_Index>(std::move(get<_Index>(__rhs)));
__rhs.__destroy_self();
}
template<ptrdiff_t _Index>
static void __copy_assign_func(
_Variant * __lhs,_Variant const& __rhs){
__lhs->template __replace_construct<_Index>(get<_Index>(__rhs));
}
static const __move_func_type __move_assign[sizeof...(_Indices)];
static const __copy_func_type __copy_assign[sizeof...(_Indices)];
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __replace_construct_helper::__op_table<
_Variant,__index_sequence<_Indices...>>::__move_func_type
__replace_construct_helper::__op_table<
_Variant,__index_sequence<_Indices...>>::__move_assign[
sizeof...(_Indices)]={
&__move_assign_func<_Indices>...
};
template<typename _Variant,ptrdiff_t ... _Indices>
const typename __replace_construct_helper::__op_table<
_Variant,__index_sequence<_Indices...>>::__copy_func_type
__replace_construct_helper::__op_table<
_Variant,__index_sequence<_Indices...>>::__copy_assign[
sizeof...(_Indices)]={
&__copy_assign_func<_Indices>...
};
template<ptrdiff_t _Index,ptrdiff_t _MaskIndex,typename _Storage>
struct __backup_storage_ops{
static void __move_construct_func(
_Storage * __dest,_Storage& __source){
new(__dest) _Storage(
in_place<_Index>,
std::move(__source.__get(in_place<_Index>)));
}
static void __destroy_func(_Storage * __obj){
__obj->__destroy(in_place<_Index>);
};
};
template<ptrdiff_t _Index,typename _Storage>
struct __backup_storage_ops<_Index,_Index,_Storage>{
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
static void __move_construct_func(_Storage *,_Storage&){
__THROW_EXCEPTION(std::bad_alloc());
};
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
static void __destroy_func(_Storage *){
__THROW_EXCEPTION(std::bad_alloc());
};
};
template<ptrdiff_t _MaskIndex,typename _Storage,typename _Indices>
struct __backup_storage_op_table;
template<ptrdiff_t _MaskIndex,typename _Storage,ptrdiff_t ... _Indices>
struct __backup_storage_op_table<
_MaskIndex,_Storage,__index_sequence<_Indices...> >
{
typedef void (*__move_func_type)(_Storage * __dest,_Storage& __source);
typedef void (*__destroy_func_type)(_Storage * __obj);
template<size_t _Index>
struct __helper{
typedef __backup_storage_ops<_Index,_MaskIndex,_Storage> __ops;
};
static const __move_func_type __move_ops[sizeof...(_Indices)];
static const __destroy_func_type __destroy_ops[sizeof...(_Indices)];
};
template<ptrdiff_t _MaskIndex,typename _Storage,ptrdiff_t ... _Indices>
const typename __backup_storage_op_table<
_MaskIndex,_Storage,__index_sequence<_Indices...> >::__move_func_type
__backup_storage_op_table<
_MaskIndex,_Storage,__index_sequence<_Indices...> >::__move_ops[
sizeof...(_Indices)]={
&__helper<_Indices>::__ops::__move_construct_func...
};
template<ptrdiff_t _MaskIndex,typename _Storage,ptrdiff_t ... _Indices>
const typename __backup_storage_op_table<
_MaskIndex,_Storage,__index_sequence<_Indices...> >::__destroy_func_type
__backup_storage_op_table<
_MaskIndex,_Storage,__index_sequence<_Indices...> >::__destroy_ops[
sizeof...(_Indices)]={
&__helper<_Indices>::__ops::__destroy_func...
};
template<ptrdiff_t _Index,typename ... _Types>
struct __backup_storage{
typedef __variant_data<_Types...> __storage_type;
typedef __backup_storage_op_table<
_Index,__storage_type,typename __type_indices<_Types...>::__type>
__op_table_type;
ptrdiff_t __backup_index;
__storage_type& __live_storage;
__storage_type __backup;
__backup_storage(ptrdiff_t __live_index_,__storage_type& __live_storage_):
__backup_index(__live_index_),__live_storage(__live_storage_){
if(__backup_index>=0){
__op_table_type::__move_ops[__backup_index](
&__backup,__live_storage);
__op_table_type::__destroy_ops[__backup_index](
&__live_storage);
}
}
void __destroy(){
if(__backup_index>=0)
__op_table_type::__destroy_ops[__backup_index](
&__backup);
__backup_index=-1;
}
~__backup_storage(){
if(__backup_index>=0){
__op_table_type::__move_ops[__backup_index](
&__live_storage,__backup);
__destroy();
}
}
};
template<typename ... _Types>
struct __all_move_constructible;
template<typename _Head,typename ... _Rest>
struct __all_move_constructible<_Head,_Rest...>
{
static constexpr bool value=std::is_move_constructible<_Head>::value && __all_move_constructible<_Rest...>::value;
};
template<>
struct __all_move_constructible<>:
std::true_type{};
template<typename ... _Types>
struct __all_move_assignable;
template<typename _Head,typename ... _Rest>
struct __all_move_assignable<_Head,_Rest...>
{
static constexpr bool value=std::is_move_assignable<_Head>::value && __all_move_assignable<_Rest...>::value;
};
template<>
struct __all_move_assignable<>:
std::true_type{};
template<typename ... _Types>
struct __all_copy_assignable;
template<typename _Head,typename ... _Rest>
struct __all_copy_assignable<_Head,_Rest...>
{
static constexpr bool value=std::is_copy_assignable<_Head>::value && __all_copy_assignable<_Rest...>::value;
};
template<>
struct __all_copy_assignable<>:
std::true_type{};
namespace __swap_test_detail{
using std::swap;
template<typename _Other>
struct __swap_result{};
template<typename>
static char __test(...);
template <typename _Other>
static std::pair<char, std::pair<char, __swap_result<decltype(
swap(std::declval<_Other &>(),std::declval<_Other &>()))>>>
__test(_Other *);
}
template <typename _Type> struct __is_swappable {
static constexpr bool value =
[clang-tidy] Run modernize-use-nullptr over WTF https://bugs.webkit.org/show_bug.cgi?id=211628 Reviewed by Yusuke Suzuki. Use the fix option in clang-tidy to ensure nullptr is being used across WTF. * wtf/Assertions.cpp: * wtf/BumpPointerAllocator.h: (WTF::BumpPointerPool::BumpPointerPool): (WTF::BumpPointerPool::create): (WTF::BumpPointerAllocator::BumpPointerAllocator): * wtf/DataLog.cpp: (WTF::setDataFile): * wtf/DateMath.cpp: (WTF::parseES5DatePortion): (WTF::parseES5TimePortion): * wtf/FastMalloc.cpp: (WTF::fastZeroedMalloc): (WTF::fastStrDup): (WTF::tryFastZeroedMalloc): (WTF::isFastMallocEnabled): (WTF::fastMallocGoodSize): (WTF::fastAlignedMalloc): (WTF::tryFastAlignedMalloc): (WTF::fastAlignedFree): (WTF::tryFastMalloc): (WTF::fastMalloc): (WTF::tryFastCalloc): (WTF::fastCalloc): (WTF::fastFree): (WTF::fastRealloc): (WTF::tryFastRealloc): (WTF::releaseFastMallocFreeMemory): (WTF::releaseFastMallocFreeMemoryForThisThread): (WTF::fastMallocStatistics): (WTF::fastMallocSize): (WTF::fastCommitAlignedMemory): (WTF::fastDecommitAlignedMemory): (WTF::fastEnableMiniMode): (WTF::fastDisableScavenger): (WTF::fastMallocDumpMallocStats): (WTF::AvoidRecordingScope::avoidRecordingCount): (WTF::AvoidRecordingScope::AvoidRecordingScope): (WTF::AvoidRecordingScope::~AvoidRecordingScope): (WTF::MallocCallTracker::MallocSiteData::MallocSiteData): (WTF::MallocCallTracker::singleton): (WTF::MallocCallTracker::MallocCallTracker): (WTF::MallocCallTracker::recordMalloc): (WTF::MallocCallTracker::recordRealloc): (WTF::MallocCallTracker::recordFree): (WTF::MallocCallTracker::dumpStats): * wtf/HashTable.h: (WTF::KeyTraits>::inlineLookup): (WTF::KeyTraits>::lookupForWriting): (WTF::KeyTraits>::fullLookupForWriting): (WTF::KeyTraits>::add): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::findAndRemoveFreeSpace): * wtf/ParallelJobsGeneric.cpp: * wtf/RandomDevice.cpp: (WTF::RandomDevice::cryptographicallyRandomValues): * wtf/RawPointer.h: (WTF::RawPointer::RawPointer): * wtf/RedBlackTree.h: * wtf/SHA1.cpp: (WTF::SHA1::hexDigest): * wtf/SchedulePair.h: (WTF::SchedulePair::SchedulePair): * wtf/StackTrace.cpp: (WTFGetBacktrace): (WTF::StackTrace::dump const): * wtf/StringExtras.h: (strnstr): * wtf/Variant.h: * wtf/Vector.h: (WTF::VectorBufferBase::deallocateBuffer): (WTF::VectorBufferBase::releaseBuffer): (WTF::VectorBufferBase::VectorBufferBase): * wtf/cf/CFURLExtras.cpp: (WTF::createCFURLFromBuffer): (WTF::getURLBytes): * wtf/cf/CFURLExtras.h: * wtf/cf/FileSystemCF.cpp: (WTF::FileSystem::pathAsURL): * wtf/dtoa/double-conversion.cc: * wtf/dtoa/utils.h: (WTF::double_conversion::BufferReference::BufferReference): * wtf/text/CString.cpp: (WTF::CString::mutableData): * wtf/text/CString.h: * wtf/text/StringBuffer.h: (WTF::StringBuffer::release): * wtf/text/StringImpl.cpp: (WTF::StringImpl::createUninitializedInternal): (WTF::StringImpl::reallocateInternal): * wtf/text/StringImpl.h: (WTF::StringImpl::constructInternal<LChar>): (WTF::StringImpl::constructInternal<UChar>): (WTF::StringImpl::characters<LChar> const): (WTF::StringImpl::characters<UChar> const): (WTF::find): (WTF::reverseFindLineTerminator): (WTF::reverseFind): (WTF::equalIgnoringNullity): (WTF::codePointCompare): (WTF::isSpaceOrNewline): (WTF::lengthOfNullTerminatedString): (WTF::StringImplShape::StringImplShape): (WTF::StringImpl::isolatedCopy const): (WTF::StringImpl::isAllASCII const): (WTF::StringImpl::isAllLatin1 const): (WTF::isAllSpecialCharacters): (WTF::isSpecialCharacter const): (WTF::StringImpl::StringImpl): (WTF::StringImpl::create8BitIfPossible): (WTF::StringImpl::createSubstringSharingImpl): (WTF::StringImpl::createFromLiteral): (WTF::StringImpl::tryCreateUninitialized): (WTF::StringImpl::adopt): (WTF::StringImpl::cost const): (WTF::StringImpl::costDuringGC): (WTF::StringImpl::setIsAtom): (WTF::StringImpl::setHash const): (WTF::StringImpl::ref): (WTF::StringImpl::deref): (WTF::StringImpl::copyCharacters): (WTF::StringImpl::at const): (WTF::StringImpl::allocationSize): (WTF::StringImpl::maxInternalLength): (WTF::StringImpl::tailOffset): (WTF::StringImpl::requiresCopy const): (WTF::StringImpl::tailPointer const): (WTF::StringImpl::tailPointer): (WTF::StringImpl::substringBuffer const): (WTF::StringImpl::substringBuffer): (WTF::StringImpl::assertHashIsCorrect const): (WTF::StringImpl::StaticStringImpl::StaticStringImpl): (WTF::StringImpl::StaticStringImpl::operator StringImpl&): (WTF::equalIgnoringASCIICase): (WTF::startsWithLettersIgnoringASCIICase): (WTF::equalLettersIgnoringASCIICase): * wtf/text/TextBreakIterator.cpp: (WTF::initializeIterator): (WTF::setContextAwareTextForIterator): (WTF::openLineBreakIterator): * wtf/text/TextBreakIterator.h: (WTF::LazyLineBreakIterator::get): * wtf/text/WTFString.cpp: (WTF::charactersToFloat): * wtf/text/cf/StringImplCF.cpp: (WTF::StringWrapperCFAllocator::allocate): (WTF::StringWrapperCFAllocator::create): (WTF::StringImpl::createCFString): * wtf/text/icu/UTextProviderLatin1.cpp: (WTF::uTextLatin1Clone): (WTF::openLatin1ContextAwareUTextProvider): * wtf/text/icu/UTextProviderUTF16.cpp: (WTF::openUTF16ContextAwareUTextProvider): * wtf/win/FileSystemWin.cpp: (WTF::FileSystemImpl::makeAllDirectories): (WTF::FileSystemImpl::storageDirectory): (WTF::FileSystemImpl::openTemporaryFile): (WTF::FileSystemImpl::openFile): (WTF::FileSystemImpl::writeToFile): (WTF::FileSystemImpl::readFromFile): (WTF::FileSystemImpl::deleteNonEmptyDirectory): * wtf/win/LanguageWin.cpp: (WTF::localeInfo): * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThreadPlatform): * wtf/win/OSAllocatorWin.cpp: (WTF::OSAllocator::reserveUncommitted): (WTF::OSAllocator::reserveAndCommit): * wtf/win/RunLoopWin.cpp: (WTF::RunLoop::run): (WTF::RunLoop::iterate): (WTF::RunLoop::RunLoop): (WTF::RunLoop::cycle): (WTF::RunLoop::TimerBase::start): * wtf/win/ThreadingWin.cpp: (WTF::Thread::establishHandle): Canonical link: https://commits.webkit.org/224543@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-08 17:31:54 +00:00
sizeof(__swap_test_detail::__test<_Type>(nullptr)) != 1;
};
template<typename ... _Types>
struct __all_swappable;
template<typename _Head,typename ... _Rest>
struct __all_swappable<_Head,_Rest...>
{
static constexpr bool value=__is_swappable<_Head>::value && __all_swappable<_Rest...>::value;
};
template<>
struct __all_swappable<>:
std::true_type{};
template<bool _MoveConstructible,typename ... _Types>
struct __noexcept_variant_move_construct_impl{};
template<typename _Head,typename ... _Rest>
struct __noexcept_variant_move_construct_impl<true,_Head,_Rest...>{
static constexpr bool value=noexcept(_Head(std::declval<_Head&&>())) && __noexcept_variant_move_construct_impl<true,_Rest...>::value;
};
template<>
struct __noexcept_variant_move_construct_impl<true>{
static constexpr bool value=true;
};
template<typename ... _Types>
struct __noexcept_variant_move_construct:
__noexcept_variant_move_construct_impl<__all_move_constructible<_Types...>::value,_Types...>
{};
template<bool _MoveAssignable,typename ... _Types>
struct __noexcept_variant_move_assign_impl{};
template <typename _Head, typename... _Rest>
struct __noexcept_variant_move_assign_impl<true, _Head, _Rest...> {
static constexpr bool value =
std::is_nothrow_move_assignable<_Head>::value &&
std::is_nothrow_move_constructible<_Head>::value &&
__noexcept_variant_move_assign_impl<true, _Rest...>::value;
};
template<>
struct __noexcept_variant_move_assign_impl<true>{
static constexpr bool value=true;
};
template <typename... _Types>
struct __noexcept_variant_move_assign
: __noexcept_variant_move_assign_impl<
__all_move_assignable<_Types...>::value &&
__all_move_constructible<_Types...>::value,
_Types...> {};
template<typename ... _Types>
struct __all_copy_constructible;
template<typename _Head,typename ... _Rest>
struct __all_copy_constructible<_Head,_Rest...>
{
static constexpr bool value=std::is_copy_constructible<_Head>::value && __all_copy_constructible<_Rest...>::value;
};
template<>
struct __all_copy_constructible<>:
std::true_type{};
template<bool _CopyConstructible,typename ... _Types>
struct __noexcept_variant_const_copy_construct_impl{};
template<typename _Head,typename ... _Rest>
struct __noexcept_variant_const_copy_construct_impl<true,_Head,_Rest...>{
static constexpr bool value=noexcept(_Head(std::declval<_Head const&>())) && __noexcept_variant_const_copy_construct_impl<true,_Rest...>::value;
};
template<>
struct __noexcept_variant_const_copy_construct_impl<true>{
static constexpr bool value=true;
};
template<typename ... _Types>
struct __noexcept_variant_const_copy_construct:
__noexcept_variant_const_copy_construct_impl<__all_copy_constructible<_Types...>::value,_Types...>
{};
template<bool _CopyNon_Constructible,typename ... _Types>
struct __noexcept_variant_non_const_copy_construct_impl{};
template<typename _Head,typename ... _Rest>
struct __noexcept_variant_non_const_copy_construct_impl<true,_Head,_Rest...>{
static constexpr bool value=noexcept(_Head(std::declval<_Head&>())) && __noexcept_variant_non_const_copy_construct_impl<true,_Rest...>::value;
};
template<>
struct __noexcept_variant_non_const_copy_construct_impl<true>{
static constexpr bool value=true;
};
template<typename ... _Types>
struct __noexcept_variant_non_const_copy_construct:
__noexcept_variant_non_const_copy_construct_impl<__all_copy_constructible<_Types...>::value,_Types...>
{};
template<bool _Swappable,typename ... _Types>
struct __noexcept_variant_swap_impl{};
template <typename _Head, typename... _Rest>
struct __noexcept_variant_swap_impl<true, _Head, _Rest...> {
static constexpr bool value =
noexcept(swap(std::declval<_Head&>(),std::declval<_Head&>())) &&
__noexcept_variant_swap_impl<true, _Rest...>::value;
};
template<>
struct __noexcept_variant_swap_impl<true>{
static constexpr bool value=true;
};
template<typename ... _Types>
struct __noexcept_variant_swap:
__noexcept_variant_swap_impl<__all_swappable<_Types...>::value,_Types...>
{};
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
class Variant:
private __variant_base<
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant<_Types...>,__all_trivially_destructible<_Types...>::__value>
{
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced https://bugs.webkit.org/show_bug.cgi?id=200611 Reviewed by Saam Barati. Source/JavaScriptCore: This patch aggressively puts many classes into FastMalloc. In JSC side, we grep `std::make_unique` etc. to find potentially system-malloc-allocated classes. After this patch, all the JSC related allocations in JetStream2 cli is done from bmalloc. In the future, it would be nice that we add `WTF::makeUnique<T>` helper function and throw a compile error if `T` is not FastMalloc annotated[1]. Putting WebKit classes in FastMalloc has many benefits. 1. Simply, it is fast. 2. vmmap can tell the amount of memory used for WebKit. 3. bmalloc can isolate WebKit memory allocation from the rest of the world. This is useful since we can know more about what component is corrupting the memory from the memory corruption crash. [1]: https://bugs.webkit.org/show_bug.cgi?id=200620 * API/ObjCCallbackFunction.mm: * assembler/AbstractMacroAssembler.h: * b3/B3PhiChildren.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirDisassembler.h: * bytecode/AccessCaseSnippetParams.h: * bytecode/CallVariant.h: * bytecode/DeferredSourceDump.h: * bytecode/ExecutionCounter.h: * bytecode/GetByIdStatus.h: * bytecode/GetByIdVariant.h: * bytecode/InByIdStatus.h: * bytecode/InByIdVariant.h: * bytecode/InstanceOfStatus.h: * bytecode/InstanceOfVariant.h: * bytecode/PutByIdStatus.h: * bytecode/PutByIdVariant.h: * bytecode/ValueProfile.h: * dfg/DFGAbstractInterpreter.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::newVariableAccessData): * dfg/DFGFlowIndexing.h: * dfg/DFGFlowMap.h: * dfg/DFGLiveCatchVariablePreservationPhase.cpp: (JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData): * dfg/DFGMaximalFlushInsertionPhase.cpp: (JSC::DFG::MaximalFlushInsertionPhase::newVariableAccessData): * dfg/DFGOSRExit.h: * dfg/DFGSpeculativeJIT.h: * dfg/DFGVariableAccessData.h: * disassembler/ARM64/A64DOpcode.h: * inspector/remote/socket/RemoteInspectorMessageParser.h: * inspector/remote/socket/RemoteInspectorSocket.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/PCToCodeOriginMap.h: * runtime/BasicBlockLocation.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/JSRunLoopTimer.h: * runtime/PromiseDeferredTimer.h: (JSC::PromiseDeferredTimer::create): PromiseDeferredTimer should be allocated as `Ref<>` instead of `std::unique_ptr` since it is inheriting ThreadSafeRefCounted<>. Holding such a class with std::unique_ptr could lead to potentially dangerous operations (like, someone holds it with Ref<> while it is deleted by std::unique_ptr<>). * runtime/RandomizingFuzzerAgent.h: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * tools/JSDollarVM.cpp: * tools/SigillCrashAnalyzer.cpp: * wasm/WasmFormat.h: * wasm/WasmMemory.cpp: * wasm/WasmSignature.h: * yarr/YarrJIT.h: Source/WebCore: Changed the accessor since we changed std::unique_ptr to Ref for this field. No behavior change. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): Source/WTF: WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`. Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited. * wtf/Assertions.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/Bag.h: (WTF::Bag::Bag): Deleted. (WTF::Bag::~Bag): Deleted. (WTF::Bag::clear): Deleted. (WTF::Bag::add): Deleted. (WTF::Bag::iterator::iterator): Deleted. (WTF::Bag::iterator::operator! const): Deleted. (WTF::Bag::iterator::operator* const): Deleted. (WTF::Bag::iterator::operator++): Deleted. (WTF::Bag::iterator::operator== const): Deleted. (WTF::Bag::iterator::operator!= const): Deleted. (WTF::Bag::begin): Deleted. (WTF::Bag::begin const): Deleted. (WTF::Bag::end const): Deleted. (WTF::Bag::isEmpty const): Deleted. (WTF::Bag::unwrappedHead const): Deleted. * wtf/BitVector.h: (WTF::BitVector::BitVector): Deleted. (WTF::BitVector::~BitVector): Deleted. (WTF::BitVector::operator=): Deleted. (WTF::BitVector::size const): Deleted. (WTF::BitVector::ensureSize): Deleted. (WTF::BitVector::quickGet const): Deleted. (WTF::BitVector::quickSet): Deleted. (WTF::BitVector::quickClear): Deleted. (WTF::BitVector::get const): Deleted. (WTF::BitVector::contains const): Deleted. (WTF::BitVector::set): Deleted. (WTF::BitVector::add): Deleted. (WTF::BitVector::ensureSizeAndSet): Deleted. (WTF::BitVector::clear): Deleted. (WTF::BitVector::remove): Deleted. (WTF::BitVector::merge): Deleted. (WTF::BitVector::filter): Deleted. (WTF::BitVector::exclude): Deleted. (WTF::BitVector::bitCount const): Deleted. (WTF::BitVector::isEmpty const): Deleted. (WTF::BitVector::findBit const): Deleted. (WTF::BitVector::isEmptyValue const): Deleted. (WTF::BitVector::isDeletedValue const): Deleted. (WTF::BitVector::isEmptyOrDeletedValue const): Deleted. (WTF::BitVector::operator== const): Deleted. (WTF::BitVector::hash const): Deleted. (WTF::BitVector::iterator::iterator): Deleted. (WTF::BitVector::iterator::operator* const): Deleted. (WTF::BitVector::iterator::operator++): Deleted. (WTF::BitVector::iterator::isAtEnd const): Deleted. (WTF::BitVector::iterator::operator== const): Deleted. (WTF::BitVector::iterator::operator!= const): Deleted. (WTF::BitVector::begin const): Deleted. (WTF::BitVector::end const): Deleted. (WTF::BitVector::bitsInPointer): Deleted. (WTF::BitVector::maxInlineBits): Deleted. (WTF::BitVector::byteCount): Deleted. (WTF::BitVector::makeInlineBits): Deleted. (WTF::BitVector::cleanseInlineBits): Deleted. (WTF::BitVector::bitCount): Deleted. (WTF::BitVector::findBitFast const): Deleted. (WTF::BitVector::findBitSimple const): Deleted. (WTF::BitVector::OutOfLineBits::numBits const): Deleted. (WTF::BitVector::OutOfLineBits::numWords const): Deleted. (WTF::BitVector::OutOfLineBits::bits): Deleted. (WTF::BitVector::OutOfLineBits::bits const): Deleted. (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted. (WTF::BitVector::isInline const): Deleted. (WTF::BitVector::outOfLineBits const): Deleted. (WTF::BitVector::outOfLineBits): Deleted. (WTF::BitVector::bits): Deleted. (WTF::BitVector::bits const): Deleted. * wtf/Bitmap.h: (WTF::Bitmap::size): Deleted. (WTF::Bitmap::iterator::iterator): Deleted. (WTF::Bitmap::iterator::operator* const): Deleted. (WTF::Bitmap::iterator::operator++): Deleted. (WTF::Bitmap::iterator::operator== const): Deleted. (WTF::Bitmap::iterator::operator!= const): Deleted. (WTF::Bitmap::begin const): Deleted. (WTF::Bitmap::end const): Deleted. * wtf/Box.h: * wtf/BumpPointerAllocator.h: * wtf/CPUTime.h: * wtf/CheckedBoolean.h: * wtf/CommaPrinter.h: (WTF::CommaPrinter::CommaPrinter): Deleted. (WTF::CommaPrinter::dump const): Deleted. (WTF::CommaPrinter::didPrint const): Deleted. * wtf/CompactPointerTuple.h: (WTF::CompactPointerTuple::encodeType): Deleted. (WTF::CompactPointerTuple::decodeType): Deleted. (WTF::CompactPointerTuple::CompactPointerTuple): Deleted. (WTF::CompactPointerTuple::pointer const): Deleted. (WTF::CompactPointerTuple::setPointer): Deleted. (WTF::CompactPointerTuple::type const): Deleted. (WTF::CompactPointerTuple::setType): Deleted. * wtf/CompilationThread.h: (WTF::CompilationScope::CompilationScope): Deleted. (WTF::CompilationScope::~CompilationScope): Deleted. (WTF::CompilationScope::leaveEarly): Deleted. * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): (WTF::Detail::CallableWrapper<CompletionHandler<Out): (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted. * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::growExact): Deleted. (WTF::ConcurrentBuffer::grow): Deleted. (WTF::ConcurrentBuffer::array const): Deleted. (WTF::ConcurrentBuffer::operator[]): Deleted. (WTF::ConcurrentBuffer::operator[] const): Deleted. (WTF::ConcurrentBuffer::createArray): Deleted. * wtf/ConcurrentPtrHashSet.h: (WTF::ConcurrentPtrHashSet::contains): Deleted. (WTF::ConcurrentPtrHashSet::add): Deleted. (WTF::ConcurrentPtrHashSet::size const): Deleted. (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted. (WTF::ConcurrentPtrHashSet::hash): Deleted. (WTF::ConcurrentPtrHashSet::cast): Deleted. (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted. (WTF::ConcurrentPtrHashSet::addImpl): Deleted. * wtf/ConcurrentVector.h: (WTF::ConcurrentVector::~ConcurrentVector): Deleted. (WTF::ConcurrentVector::size const): Deleted. (WTF::ConcurrentVector::isEmpty const): Deleted. (WTF::ConcurrentVector::at): Deleted. (WTF::ConcurrentVector::at const): Deleted. (WTF::ConcurrentVector::operator[]): Deleted. (WTF::ConcurrentVector::operator[] const): Deleted. (WTF::ConcurrentVector::first): Deleted. (WTF::ConcurrentVector::first const): Deleted. (WTF::ConcurrentVector::last): Deleted. (WTF::ConcurrentVector::last const): Deleted. (WTF::ConcurrentVector::takeLast): Deleted. (WTF::ConcurrentVector::append): Deleted. (WTF::ConcurrentVector::alloc): Deleted. (WTF::ConcurrentVector::removeLast): Deleted. (WTF::ConcurrentVector::grow): Deleted. (WTF::ConcurrentVector::begin): Deleted. (WTF::ConcurrentVector::end): Deleted. (WTF::ConcurrentVector::segmentExistsFor): Deleted. (WTF::ConcurrentVector::segmentFor): Deleted. (WTF::ConcurrentVector::subscriptFor): Deleted. (WTF::ConcurrentVector::ensureSegmentsFor): Deleted. (WTF::ConcurrentVector::ensureSegment): Deleted. (WTF::ConcurrentVector::allocateSegment): Deleted. * wtf/Condition.h: (WTF::Condition::waitUntil): Deleted. (WTF::Condition::waitFor): Deleted. (WTF::Condition::wait): Deleted. (WTF::Condition::notifyOne): Deleted. (WTF::Condition::notifyAll): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::LockHooks::lockHook): Deleted. (WTF::CountingLock::LockHooks::unlockHook): Deleted. (WTF::CountingLock::LockHooks::parkHook): Deleted. (WTF::CountingLock::LockHooks::handoffHook): Deleted. (WTF::CountingLock::tryLock): Deleted. (WTF::CountingLock::lock): Deleted. (WTF::CountingLock::unlock): Deleted. (WTF::CountingLock::isHeld const): Deleted. (WTF::CountingLock::isLocked const): Deleted. (WTF::CountingLock::Count::operator bool const): Deleted. (WTF::CountingLock::Count::operator== const): Deleted. (WTF::CountingLock::Count::operator!= const): Deleted. (WTF::CountingLock::tryOptimisticRead): Deleted. (WTF::CountingLock::validate): Deleted. (WTF::CountingLock::doOptimizedRead): Deleted. (WTF::CountingLock::tryOptimisticFencelessRead): Deleted. (WTF::CountingLock::fencelessValidate): Deleted. (WTF::CountingLock::doOptimizedFencelessRead): Deleted. (WTF::CountingLock::getCount): Deleted. * wtf/CrossThreadQueue.h: * wtf/CrossThreadTask.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/DataMutex.h: * wtf/DateMath.h: * wtf/Deque.h: (WTF::Deque::size const): Deleted. (WTF::Deque::isEmpty const): Deleted. (WTF::Deque::begin): Deleted. (WTF::Deque::end): Deleted. (WTF::Deque::begin const): Deleted. (WTF::Deque::end const): Deleted. (WTF::Deque::rbegin): Deleted. (WTF::Deque::rend): Deleted. (WTF::Deque::rbegin const): Deleted. (WTF::Deque::rend const): Deleted. (WTF::Deque::first): Deleted. (WTF::Deque::first const): Deleted. (WTF::Deque::last): Deleted. (WTF::Deque::last const): Deleted. (WTF::Deque::append): Deleted. * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/Expected.h: * wtf/FastBitVector.h: * wtf/FileMetadata.h: * wtf/FileSystem.h: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.h: (WTF::GregorianDateTime::GregorianDateTime): Deleted. (WTF::GregorianDateTime::year const): Deleted. (WTF::GregorianDateTime::month const): Deleted. (WTF::GregorianDateTime::yearDay const): Deleted. (WTF::GregorianDateTime::monthDay const): Deleted. (WTF::GregorianDateTime::weekDay const): Deleted. (WTF::GregorianDateTime::hour const): Deleted. (WTF::GregorianDateTime::minute const): Deleted. (WTF::GregorianDateTime::second const): Deleted. (WTF::GregorianDateTime::utcOffset const): Deleted. (WTF::GregorianDateTime::isDST const): Deleted. (WTF::GregorianDateTime::setYear): Deleted. (WTF::GregorianDateTime::setMonth): Deleted. (WTF::GregorianDateTime::setYearDay): Deleted. (WTF::GregorianDateTime::setMonthDay): Deleted. (WTF::GregorianDateTime::setWeekDay): Deleted. (WTF::GregorianDateTime::setHour): Deleted. (WTF::GregorianDateTime::setMinute): Deleted. (WTF::GregorianDateTime::setSecond): Deleted. (WTF::GregorianDateTime::setUtcOffset): Deleted. (WTF::GregorianDateTime::setIsDST): Deleted. (WTF::GregorianDateTime::operator tm const): Deleted. (WTF::GregorianDateTime::copyFrom): Deleted. * wtf/HashTable.h: * wtf/Hasher.h: * wtf/HexNumber.h: * wtf/Indenter.h: * wtf/IndexMap.h: * wtf/IndexSet.h: * wtf/IndexSparseSet.h: * wtf/IndexedContainerIterator.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/KeyValuePair.h: * wtf/ListHashSet.h: (WTF::ListHashSet::begin): Deleted. (WTF::ListHashSet::end): Deleted. (WTF::ListHashSet::begin const): Deleted. (WTF::ListHashSet::end const): Deleted. (WTF::ListHashSet::random): Deleted. (WTF::ListHashSet::random const): Deleted. (WTF::ListHashSet::rbegin): Deleted. (WTF::ListHashSet::rend): Deleted. (WTF::ListHashSet::rbegin const): Deleted. (WTF::ListHashSet::rend const): Deleted. * wtf/Liveness.h: * wtf/LocklessBag.h: (WTF::LocklessBag::LocklessBag): Deleted. (WTF::LocklessBag::add): Deleted. (WTF::LocklessBag::iterate): Deleted. (WTF::LocklessBag::consumeAll): Deleted. (WTF::LocklessBag::consumeAllWithNode): Deleted. (WTF::LocklessBag::~LocklessBag): Deleted. * wtf/LoggingHashID.h: * wtf/MD5.h: * wtf/MachSendRight.h: * wtf/MainThreadData.h: * wtf/Markable.h: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.h: * wtf/MessageQueue.h: (WTF::MessageQueue::MessageQueue): Deleted. * wtf/MetaAllocator.h: * wtf/MonotonicTime.h: (WTF::MonotonicTime::MonotonicTime): Deleted. (WTF::MonotonicTime::fromRawSeconds): Deleted. (WTF::MonotonicTime::infinity): Deleted. (WTF::MonotonicTime::nan): Deleted. (WTF::MonotonicTime::secondsSinceEpoch const): Deleted. (WTF::MonotonicTime::approximateMonotonicTime const): Deleted. (WTF::MonotonicTime::operator bool const): Deleted. (WTF::MonotonicTime::operator+ const): Deleted. (WTF::MonotonicTime::operator- const): Deleted. (WTF::MonotonicTime::operator% const): Deleted. (WTF::MonotonicTime::operator+=): Deleted. (WTF::MonotonicTime::operator-=): Deleted. (WTF::MonotonicTime::operator== const): Deleted. (WTF::MonotonicTime::operator!= const): Deleted. (WTF::MonotonicTime::operator< const): Deleted. (WTF::MonotonicTime::operator> const): Deleted. (WTF::MonotonicTime::operator<= const): Deleted. (WTF::MonotonicTime::operator>= const): Deleted. (WTF::MonotonicTime::isolatedCopy const): Deleted. (WTF::MonotonicTime::encode const): Deleted. (WTF::MonotonicTime::decode): Deleted. * wtf/NaturalLoops.h: * wtf/NoLock.h: * wtf/OSAllocator.h: * wtf/OptionSet.h: * wtf/Optional.h: * wtf/OrderMaker.h: * wtf/Packed.h: (WTF::alignof): * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): Deleted. (WTF::PackedIntVector::operator=): Deleted. (WTF::PackedIntVector::size const): Deleted. (WTF::PackedIntVector::ensureSize): Deleted. (WTF::PackedIntVector::resize): Deleted. (WTF::PackedIntVector::clearAll): Deleted. (WTF::PackedIntVector::get const): Deleted. (WTF::PackedIntVector::set): Deleted. (WTF::PackedIntVector::mask): Deleted. * wtf/PageBlock.h: * wtf/ParallelJobsOpenMP.h: * wtf/ParkingLot.h: * wtf/PriorityQueue.h: (WTF::PriorityQueue::size const): Deleted. (WTF::PriorityQueue::isEmpty const): Deleted. (WTF::PriorityQueue::enqueue): Deleted. (WTF::PriorityQueue::peek const): Deleted. (WTF::PriorityQueue::dequeue): Deleted. (WTF::PriorityQueue::decreaseKey): Deleted. (WTF::PriorityQueue::increaseKey): Deleted. (WTF::PriorityQueue::begin const): Deleted. (WTF::PriorityQueue::end const): Deleted. (WTF::PriorityQueue::isValidHeap const): Deleted. (WTF::PriorityQueue::parentOf): Deleted. (WTF::PriorityQueue::leftChildOf): Deleted. (WTF::PriorityQueue::rightChildOf): Deleted. (WTF::PriorityQueue::siftUp): Deleted. (WTF::PriorityQueue::siftDown): Deleted. * wtf/RandomDevice.h: * wtf/Range.h: * wtf/RangeSet.h: (WTF::RangeSet::RangeSet): Deleted. (WTF::RangeSet::~RangeSet): Deleted. (WTF::RangeSet::add): Deleted. (WTF::RangeSet::contains const): Deleted. (WTF::RangeSet::overlaps const): Deleted. (WTF::RangeSet::clear): Deleted. (WTF::RangeSet::dump const): Deleted. (WTF::RangeSet::dumpRaw const): Deleted. (WTF::RangeSet::begin const): Deleted. (WTF::RangeSet::end const): Deleted. (WTF::RangeSet::addAll): Deleted. (WTF::RangeSet::compact): Deleted. (WTF::RangeSet::overlapsNonEmpty): Deleted. (WTF::RangeSet::subsumesNonEmpty): Deleted. (WTF::RangeSet::findRange const): Deleted. * wtf/RecursableLambda.h: * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor const): Deleted. (WTF::RedBlackTree::Node::predecessor const): Deleted. (WTF::RedBlackTree::Node::successor): Deleted. (WTF::RedBlackTree::Node::predecessor): Deleted. (WTF::RedBlackTree::Node::reset): Deleted. (WTF::RedBlackTree::Node::parent const): Deleted. (WTF::RedBlackTree::Node::setParent): Deleted. (WTF::RedBlackTree::Node::left const): Deleted. (WTF::RedBlackTree::Node::setLeft): Deleted. (WTF::RedBlackTree::Node::right const): Deleted. (WTF::RedBlackTree::Node::setRight): Deleted. (WTF::RedBlackTree::Node::color const): Deleted. (WTF::RedBlackTree::Node::setColor): Deleted. (WTF::RedBlackTree::RedBlackTree): Deleted. (WTF::RedBlackTree::insert): Deleted. (WTF::RedBlackTree::remove): Deleted. (WTF::RedBlackTree::findExact const): Deleted. (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted. (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted. (WTF::RedBlackTree::first const): Deleted. (WTF::RedBlackTree::last const): Deleted. (WTF::RedBlackTree::size): Deleted. (WTF::RedBlackTree::isEmpty): Deleted. (WTF::RedBlackTree::treeMinimum): Deleted. (WTF::RedBlackTree::treeMaximum): Deleted. (WTF::RedBlackTree::treeInsert): Deleted. (WTF::RedBlackTree::leftRotate): Deleted. (WTF::RedBlackTree::rightRotate): Deleted. (WTF::RedBlackTree::removeFixup): Deleted. * wtf/ResourceUsage.h: * wtf/RunLoop.cpp: * wtf/RunLoopTimer.h: * wtf/SHA1.h: * wtf/Seconds.h: (WTF::Seconds::Seconds): Deleted. (WTF::Seconds::value const): Deleted. (WTF::Seconds::minutes const): Deleted. (WTF::Seconds::seconds const): Deleted. (WTF::Seconds::milliseconds const): Deleted. (WTF::Seconds::microseconds const): Deleted. (WTF::Seconds::nanoseconds const): Deleted. (WTF::Seconds::minutesAs const): Deleted. (WTF::Seconds::secondsAs const): Deleted. (WTF::Seconds::millisecondsAs const): Deleted. (WTF::Seconds::microsecondsAs const): Deleted. (WTF::Seconds::nanosecondsAs const): Deleted. (WTF::Seconds::fromMinutes): Deleted. (WTF::Seconds::fromHours): Deleted. (WTF::Seconds::fromMilliseconds): Deleted. (WTF::Seconds::fromMicroseconds): Deleted. (WTF::Seconds::fromNanoseconds): Deleted. (WTF::Seconds::infinity): Deleted. (WTF::Seconds::nan): Deleted. (WTF::Seconds::operator bool const): Deleted. (WTF::Seconds::operator+ const): Deleted. (WTF::Seconds::operator- const): Deleted. (WTF::Seconds::operator* const): Deleted. (WTF::Seconds::operator/ const): Deleted. (WTF::Seconds::operator% const): Deleted. (WTF::Seconds::operator+=): Deleted. (WTF::Seconds::operator-=): Deleted. (WTF::Seconds::operator*=): Deleted. (WTF::Seconds::operator/=): Deleted. (WTF::Seconds::operator%=): Deleted. (WTF::Seconds::operator== const): Deleted. (WTF::Seconds::operator!= const): Deleted. (WTF::Seconds::operator< const): Deleted. (WTF::Seconds::operator> const): Deleted. (WTF::Seconds::operator<= const): Deleted. (WTF::Seconds::operator>= const): Deleted. (WTF::Seconds::isolatedCopy const): Deleted. (WTF::Seconds::encode const): Deleted. (WTF::Seconds::decode): Deleted. * wtf/SegmentedVector.h: (WTF::SegmentedVector::~SegmentedVector): Deleted. (WTF::SegmentedVector::size const): Deleted. (WTF::SegmentedVector::isEmpty const): Deleted. (WTF::SegmentedVector::at): Deleted. (WTF::SegmentedVector::at const): Deleted. (WTF::SegmentedVector::operator[]): Deleted. (WTF::SegmentedVector::operator[] const): Deleted. (WTF::SegmentedVector::first): Deleted. (WTF::SegmentedVector::first const): Deleted. (WTF::SegmentedVector::last): Deleted. (WTF::SegmentedVector::last const): Deleted. (WTF::SegmentedVector::takeLast): Deleted. (WTF::SegmentedVector::append): Deleted. (WTF::SegmentedVector::alloc): Deleted. (WTF::SegmentedVector::removeLast): Deleted. (WTF::SegmentedVector::grow): Deleted. (WTF::SegmentedVector::clear): Deleted. (WTF::SegmentedVector::begin): Deleted. (WTF::SegmentedVector::end): Deleted. (WTF::SegmentedVector::shrinkToFit): Deleted. (WTF::SegmentedVector::deleteAllSegments): Deleted. (WTF::SegmentedVector::segmentExistsFor): Deleted. (WTF::SegmentedVector::segmentFor): Deleted. (WTF::SegmentedVector::subscriptFor): Deleted. (WTF::SegmentedVector::ensureSegmentsFor): Deleted. (WTF::SegmentedVector::ensureSegment): Deleted. (WTF::SegmentedVector::allocateSegment): Deleted. * wtf/SetForScope.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SmallPtrSet.h: * wtf/SpanningTree.h: * wtf/Spectrum.h: * wtf/StackBounds.h: * wtf/StackShot.h: * wtf/StackShotProfiler.h: * wtf/StackStats.h: * wtf/StackTrace.h: * wtf/StreamBuffer.h: * wtf/SynchronizedFixedQueue.h: (WTF::SynchronizedFixedQueue::create): Deleted. (WTF::SynchronizedFixedQueue::open): Deleted. (WTF::SynchronizedFixedQueue::close): Deleted. (WTF::SynchronizedFixedQueue::isOpen): Deleted. (WTF::SynchronizedFixedQueue::enqueue): Deleted. (WTF::SynchronizedFixedQueue::dequeue): Deleted. (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted. * wtf/SystemTracing.h: * wtf/ThreadGroup.h: (WTF::ThreadGroup::create): Deleted. (WTF::ThreadGroup::threads const): Deleted. (WTF::ThreadGroup::getLock): Deleted. (WTF::ThreadGroup::weakFromThis): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingPrimitives.h: (WTF::Mutex::impl): Deleted. * wtf/TimeWithDynamicClockType.h: (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted. (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted. (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted. (WTF::TimeWithDynamicClockType::clockType const): Deleted. (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted. (WTF::TimeWithDynamicClockType::operator bool const): Deleted. (WTF::TimeWithDynamicClockType::operator+ const): Deleted. (WTF::TimeWithDynamicClockType::operator- const): Deleted. (WTF::TimeWithDynamicClockType::operator+=): Deleted. (WTF::TimeWithDynamicClockType::operator-=): Deleted. (WTF::TimeWithDynamicClockType::operator== const): Deleted. (WTF::TimeWithDynamicClockType::operator!= const): Deleted. * wtf/TimingScope.h: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/URLParser.cpp: * wtf/URLParser.h: * wtf/Unexpected.h: * wtf/Variant.h: * wtf/WTFSemaphore.h: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::signal): Deleted. (WTF::Semaphore::waitUntil): Deleted. (WTF::Semaphore::waitFor): Deleted. (WTF::Semaphore::wait): Deleted. * wtf/WallTime.h: (WTF::WallTime::WallTime): Deleted. (WTF::WallTime::fromRawSeconds): Deleted. (WTF::WallTime::infinity): Deleted. (WTF::WallTime::nan): Deleted. (WTF::WallTime::secondsSinceEpoch const): Deleted. (WTF::WallTime::approximateWallTime const): Deleted. (WTF::WallTime::operator bool const): Deleted. (WTF::WallTime::operator+ const): Deleted. (WTF::WallTime::operator- const): Deleted. (WTF::WallTime::operator+=): Deleted. (WTF::WallTime::operator-=): Deleted. (WTF::WallTime::operator== const): Deleted. (WTF::WallTime::operator!= const): Deleted. (WTF::WallTime::operator< const): Deleted. (WTF::WallTime::operator> const): Deleted. (WTF::WallTime::operator<= const): Deleted. (WTF::WallTime::operator>= const): Deleted. (WTF::WallTime::isolatedCopy const): Deleted. * wtf/WeakHashSet.h: (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted. (WTF::WeakHashSet::WeakHashSet): Deleted. (WTF::WeakHashSet::begin const): Deleted. (WTF::WeakHashSet::end const): Deleted. (WTF::WeakHashSet::add): Deleted. (WTF::WeakHashSet::remove): Deleted. (WTF::WeakHashSet::contains const): Deleted. (WTF::WeakHashSet::capacity const): Deleted. (WTF::WeakHashSet::computesEmpty const): Deleted. (WTF::WeakHashSet::hasNullReferences const): Deleted. (WTF::WeakHashSet::computeSize const): Deleted. (WTF::WeakHashSet::checkConsistency const): Deleted. * wtf/WeakRandom.h: (WTF::WeakRandom::WeakRandom): Deleted. (WTF::WeakRandom::setSeed): Deleted. (WTF::WeakRandom::seed const): Deleted. (WTF::WeakRandom::get): Deleted. (WTF::WeakRandom::getUint32): Deleted. (WTF::WeakRandom::lowOffset): Deleted. (WTF::WeakRandom::highOffset): Deleted. (WTF::WeakRandom::nextState): Deleted. (WTF::WeakRandom::generate): Deleted. (WTF::WeakRandom::advance): Deleted. * wtf/WordLock.h: (WTF::WordLock::lock): Deleted. (WTF::WordLock::unlock): Deleted. (WTF::WordLock::isHeld const): Deleted. (WTF::WordLock::isLocked const): Deleted. (WTF::WordLock::isFullyReset const): Deleted. * wtf/generic/MainThreadGeneric.cpp: * wtf/glib/GMutexLocker.h: * wtf/linux/CurrentProcessMemoryStatus.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::~Semaphore): Deleted. (WTF::Semaphore::wait): Deleted. (WTF::Semaphore::post): Deleted. * wtf/text/ASCIILiteral.h: (WTF::ASCIILiteral::operator const char* const): Deleted. (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted. (WTF::ASCIILiteral::null): Deleted. (WTF::ASCIILiteral::characters const): Deleted. (WTF::ASCIILiteral::ASCIILiteral): Deleted. * wtf/text/AtomString.h: (WTF::AtomString::operator=): Deleted. (WTF::AtomString::isHashTableDeletedValue const): Deleted. (WTF::AtomString::existingHash const): Deleted. (WTF::AtomString::operator const String& const): Deleted. (WTF::AtomString::string const): Deleted. (WTF::AtomString::impl const): Deleted. (WTF::AtomString::is8Bit const): Deleted. (WTF::AtomString::characters8 const): Deleted. (WTF::AtomString::characters16 const): Deleted. (WTF::AtomString::length const): Deleted. (WTF::AtomString::operator[] const): Deleted. (WTF::AtomString::contains const): Deleted. (WTF::AtomString::containsIgnoringASCIICase const): Deleted. (WTF::AtomString::find const): Deleted. (WTF::AtomString::findIgnoringASCIICase const): Deleted. (WTF::AtomString::startsWith const): Deleted. (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::endsWith const): Deleted. (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::toInt const): Deleted. (WTF::AtomString::toDouble const): Deleted. (WTF::AtomString::toFloat const): Deleted. (WTF::AtomString::percentage const): Deleted. (WTF::AtomString::isNull const): Deleted. (WTF::AtomString::isEmpty const): Deleted. (WTF::AtomString::operator NSString * const): Deleted. * wtf/text/AtomStringImpl.h: (WTF::AtomStringImpl::lookUp): Deleted. (WTF::AtomStringImpl::add): Deleted. (WTF::AtomStringImpl::addWithStringTableProvider): Deleted. * wtf/text/CString.h: (WTF::CStringBuffer::data): Deleted. (WTF::CStringBuffer::length const): Deleted. (WTF::CStringBuffer::CStringBuffer): Deleted. (WTF::CStringBuffer::mutableData): Deleted. (WTF::CString::CString): Deleted. (WTF::CString::data const): Deleted. (WTF::CString::length const): Deleted. (WTF::CString::isNull const): Deleted. (WTF::CString::buffer const): Deleted. (WTF::CString::isHashTableDeletedValue const): Deleted. * wtf/text/ExternalStringImpl.h: (WTF::ExternalStringImpl::freeExternalBuffer): Deleted. * wtf/text/LineBreakIteratorPoolICU.h: * wtf/text/NullTextBreakIterator.h: * wtf/text/OrdinalNumber.h: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.h: * wtf/text/StringConcatenateNumbers.h: * wtf/text/StringHasher.h: * wtf/text/StringImpl.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: (WTF::StringView::left const): Deleted. (WTF::StringView::right const): Deleted. (WTF::StringView::underlyingStringIsValid const): Deleted. (WTF::StringView::setUnderlyingString): Deleted. * wtf/text/SymbolImpl.h: (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted. (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted. (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted. (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted. (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted. (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted. * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.h: * wtf/text/WTFString.h: (WTF::String::swap): Deleted. (WTF::String::adopt): Deleted. (WTF::String::isNull const): Deleted. (WTF::String::isEmpty const): Deleted. (WTF::String::impl const): Deleted. (WTF::String::releaseImpl): Deleted. (WTF::String::length const): Deleted. (WTF::String::characters8 const): Deleted. (WTF::String::characters16 const): Deleted. (WTF::String::is8Bit const): Deleted. (WTF::String::sizeInBytes const): Deleted. (WTF::String::operator[] const): Deleted. (WTF::String::find const): Deleted. (WTF::String::findIgnoringASCIICase const): Deleted. (WTF::String::reverseFind const): Deleted. (WTF::String::contains const): Deleted. (WTF::String::containsIgnoringASCIICase const): Deleted. (WTF::String::startsWith const): Deleted. (WTF::String::startsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixStartingAt const): Deleted. (WTF::String::endsWith const): Deleted. (WTF::String::endsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixEndingAt const): Deleted. (WTF::String::append): Deleted. (WTF::String::left const): Deleted. (WTF::String::right const): Deleted. (WTF::String::createUninitialized): Deleted. (WTF::String::fromUTF8WithLatin1Fallback): Deleted. (WTF::String::isAllASCII const): Deleted. (WTF::String::isAllLatin1 const): Deleted. (WTF::String::isSpecialCharacter const): Deleted. (WTF::String::isHashTableDeletedValue const): Deleted. (WTF::String::hash const): Deleted. (WTF::String::existingHash const): Deleted. * wtf/text/cf/TextBreakIteratorCF.h: * wtf/text/icu/TextBreakIteratorICU.h: * wtf/text/icu/UTextProviderLatin1.h: * wtf/threads/BinarySemaphore.h: (WTF::BinarySemaphore::waitFor): Deleted. (WTF::BinarySemaphore::wait): Deleted. * wtf/unicode/Collator.h: * wtf/win/GDIObject.h: * wtf/win/PathWalker.h: * wtf/win/Win32Handle.h: Canonical link: https://commits.webkit.org/214396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-12 20:57:15 +00:00
WTF_MAKE_FAST_ALLOCATED;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
typedef __variant_base<Variant<_Types...>,__all_trivially_destructible<_Types...>::__value> __base_type;
friend __base_type;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
friend struct __copy_construct_op_table<Variant>;
friend struct __copy_assign_op_table<Variant>;
friend struct __move_construct_op_table<Variant>;
friend struct __move_assign_op_table<Variant>;
friend struct __destroy_op_table<Variant>;
template<ptrdiff_t _Index,typename ... _Types2>
friend struct __variant_accessor;
friend struct __replace_construct_helper;
typedef __variant_data<_Types...> __storage_type;
__storage_type __storage;
typename __discriminator_type<sizeof ... (_Types)>::__type __index;
template<size_t _Index,typename ... _Args>
size_t __emplace_construct(_Args&& ... __args){
new(&__storage) __storage_type(
in_place<_Index>,std::forward<_Args>(__args)...);
return _Index;
}
void __destroy_self(){
if(valueless_by_exception())
return;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__destroy_op_table<Variant>::__apply[index()](this);
__index=-1;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
ptrdiff_t __move_construct(Variant& __other){
ptrdiff_t const __other_index=__other.index();
if(__other_index==-1)
return -1;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__move_construct_op_table<Variant>::__apply[__other_index](this,__other);
__other.__destroy_self();
return __other_index;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
ptrdiff_t __copy_construct(Variant const& __other){
ptrdiff_t const __other_index=__other.index();
if(__other_index==-1)
return -1;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__copy_construct_op_table<Variant>::__apply[__other_index](this,__other);
return __other_index;
}
template<size_t _Index,typename ... _Args>
void __replace_construct(_Args&& ... __args){
typedef typename __indexed_type<_Index,_Types...>::__type __this_type;
__replace_construct_helper::__helper<
_Index,
__storage_nothrow_constructible<__this_type,_Args...>::__value ||
(sizeof...(_Types)==1),
__storage_nothrow_move_constructible<__this_type>::__value,
__other_storage_nothrow_move_constructible<
_Index,_Types...>::__value
>::__trampoline(*this,std::forward<_Args>(__args)...);
}
template<size_t _Index,typename ... _Args>
void __two_stage_replace(_Args&& ... __args){
typedef typename __indexed_type<_Index,_Types...>::__type __type;
__variant_data<__type> __local(
in_place<0>,std::forward<_Args>(__args)...);
__destroy_self();
__emplace_construct<_Index>(
std::move(__local.__get(in_place<0>)));
__index=_Index;
__local.__destroy(in_place<0>);
}
template<size_t _Index,typename ... _Args>
void __local_backup_replace(_Args&& ... __args){
__backup_storage<_Index,_Types...> __backup(__index,__storage);
__emplace_construct<_Index>(std::forward<_Args>(__args)...);
__index=_Index;
__backup.__destroy();
}
template<size_t _Index,typename ... _Args>
void __direct_replace(_Args&& ... __args) {
__destroy_self();
__emplace_construct<_Index>(std::forward<_Args>(__args)...);
__index=_Index;
}
struct __private_type{};
public:
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant()
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__NOEXCEPT_(noexcept(typename __indexed_type<0,_Types...>::__type())):
__storage(in_place<0>),
__index(0)
{}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<__all_move_constructible<_Types...>::value,Variant,__private_type>::type&& __other)
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__NOEXCEPT_(__noexcept_variant_move_construct<_Types...>::value):
__index(__move_construct(__other))
{}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<!__all_move_constructible<_Types...>::value,Variant,__private_type>::type&& __other)=delete;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<__all_copy_constructible<_Types...>::value,Variant,__private_type>::type& __other)
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__NOEXCEPT_(__noexcept_variant_non_const_copy_construct<_Types...>::value):
__index(__copy_construct(__other))
{}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<!__all_copy_constructible<_Types...>::value,Variant,__private_type>::type& __other)=delete;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<__all_copy_constructible<_Types...>::value,Variant,__private_type>::type const& __other)
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__NOEXCEPT_(__noexcept_variant_const_copy_construct<_Types...>::value):
__index(__copy_construct(__other))
{}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(typename std::conditional<!__all_copy_constructible<_Types...>::value,Variant,__private_type>::type const& __other)=delete;
template<typename _Type,typename ... _Args>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
explicit constexpr Variant(in_place_type_t<_Type>,_Args&& ... __args):
__storage(
in_place<__type_index<_Type,_Types...>::__value>,
std::forward<_Args>(__args)...),
__index(__type_index<_Type,_Types...>::__value)
{
static_assert(std::is_constructible<_Type,_Args...>::value,"Type must be constructible from args");
}
template<size_t _Index,typename ... _Args>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
explicit constexpr Variant(in_place_index_t<_Index>,_Args&& ... __args):
__storage(in_place<_Index>,std::forward<_Args>(__args)...),
__index(_Index)
{
static_assert(std::is_constructible<typename __indexed_type<_Index,_Types...>::__type,_Args...>::value,"Type must be constructible from args");
}
template<typename _Type>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(_Type&& __x):
__storage(
in_place<
__type_index_to_construct<_Type,_Types...>::__value>,
std::forward<_Type>(__x)),
__index(__type_index_to_construct<_Type,_Types...>::__value)
{}
template<typename _Type,
typename _Enable=
typename std::enable_if<
(__constructible_matches<std::initializer_list<_Type>,_Types...>::__type::__length>0)
>::type>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr Variant(std::initializer_list<_Type> __x):
__storage(
in_place<
__type_index_to_construct<std::initializer_list<_Type>,_Types...>::__value>,
__x),
__index(__type_index_to_construct<std::initializer_list<_Type>,_Types...>::__value)
{}
template<typename _Type>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant& operator=(_Type&& __x){
constexpr size_t _Index=
__type_index_to_construct<_Type,_Types...>::__value;
if(_Index==__index){
get<_Index>(*this)=std::forward<_Type>(__x);
}
else{
__replace_construct<_Index>(std::forward<_Type>(__x));
}
return *this;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<
!(__all_copy_constructible<_Types...>::value &&
__all_move_constructible<_Types...>::value &&
__all_copy_assignable<_Types...>::value),
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type const &__other) = delete;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<
__all_copy_constructible<_Types...>::value &&
__all_move_constructible<_Types...>::value &&
__all_copy_assignable<_Types...>::value,
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type const &__other) {
if (__other.valueless_by_exception()) {
__destroy_self();
}
else if(__other.index()==index()){
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__copy_assign_op_table<Variant>::__apply[index()](this,__other);
}
else{
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__replace_construct_helper::__op_table<Variant>::__copy_assign[
__other.index()](this,__other);
}
return *this;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<
!(__all_copy_constructible<_Types...>::value &&
__all_move_constructible<_Types...>::value &&
__all_copy_assignable<_Types...>::value),
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type &__other) = delete;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<
__all_copy_constructible<_Types...>::value &&
__all_move_constructible<_Types...>::value &&
__all_copy_assignable<_Types...>::value,
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type &__other) {
if(__other.valueless_by_exception()){
__destroy_self();
}
else if(__other.index()==index()){
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__copy_assign_op_table<Variant>::__apply[index()](this,__other);
}
else{
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__replace_construct_helper::__op_table<Variant>::__copy_assign[
__other.index()](this,__other);
}
return *this;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<
!(__all_move_constructible<_Types...>::value &&
__all_move_assignable<_Types...>::value),
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type &&__other) = delete;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant &operator=(
typename std::conditional<__all_move_constructible<_Types...>::value &&
__all_move_assignable<_Types...>::value,
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type &&
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__other) __NOEXCEPT_(__noexcept_variant_move_assign<_Types...>::value) {
if (__other.valueless_by_exception()) {
__destroy_self();
}
else if(__other.index()==index()){
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__move_assign_op_table<Variant>::__apply[index()](this,__other);
__other.__destroy_self();
}
else{
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__replace_construct_helper::__op_table<Variant>::__move_assign[
__other.index()](this,__other);
}
return *this;
}
template<typename _Type,typename ... _Args>
void emplace(_Args&& ... __args){
__direct_replace<__type_index<_Type,_Types...>::__value>(
std::forward<_Args>(__args)...);
}
template<size_t _Index,typename ... _Args>
void emplace(_Args&& ... __args){
__direct_replace<_Index>(std::forward<_Args>(__args)...);
}
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
constexpr bool valueless_by_exception() const __NOEXCEPT{
return __index==-1;
}
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
constexpr ptrdiff_t index() const __NOEXCEPT{
return __index;
}
void swap(
typename std::conditional<
__all_swappable<_Types...>::value &&
__all_move_constructible<_Types...>::value,
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant, __private_type>::type
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
&__other) __NOEXCEPT_(__noexcept_variant_swap<_Types...>::value) {
if (__other.index() == index()) {
if(!valueless_by_exception())
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__swap_op_table<Variant>::__apply[index()](*this,__other);
}
else{
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant __temp(std::move(__other));
__other.__index=__other.__move_construct(*this);
__index=__move_construct(__temp);
}
}
};
template<>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
class Variant<>{
public:
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced https://bugs.webkit.org/show_bug.cgi?id=200611 Reviewed by Saam Barati. Source/JavaScriptCore: This patch aggressively puts many classes into FastMalloc. In JSC side, we grep `std::make_unique` etc. to find potentially system-malloc-allocated classes. After this patch, all the JSC related allocations in JetStream2 cli is done from bmalloc. In the future, it would be nice that we add `WTF::makeUnique<T>` helper function and throw a compile error if `T` is not FastMalloc annotated[1]. Putting WebKit classes in FastMalloc has many benefits. 1. Simply, it is fast. 2. vmmap can tell the amount of memory used for WebKit. 3. bmalloc can isolate WebKit memory allocation from the rest of the world. This is useful since we can know more about what component is corrupting the memory from the memory corruption crash. [1]: https://bugs.webkit.org/show_bug.cgi?id=200620 * API/ObjCCallbackFunction.mm: * assembler/AbstractMacroAssembler.h: * b3/B3PhiChildren.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirDisassembler.h: * bytecode/AccessCaseSnippetParams.h: * bytecode/CallVariant.h: * bytecode/DeferredSourceDump.h: * bytecode/ExecutionCounter.h: * bytecode/GetByIdStatus.h: * bytecode/GetByIdVariant.h: * bytecode/InByIdStatus.h: * bytecode/InByIdVariant.h: * bytecode/InstanceOfStatus.h: * bytecode/InstanceOfVariant.h: * bytecode/PutByIdStatus.h: * bytecode/PutByIdVariant.h: * bytecode/ValueProfile.h: * dfg/DFGAbstractInterpreter.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::newVariableAccessData): * dfg/DFGFlowIndexing.h: * dfg/DFGFlowMap.h: * dfg/DFGLiveCatchVariablePreservationPhase.cpp: (JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData): * dfg/DFGMaximalFlushInsertionPhase.cpp: (JSC::DFG::MaximalFlushInsertionPhase::newVariableAccessData): * dfg/DFGOSRExit.h: * dfg/DFGSpeculativeJIT.h: * dfg/DFGVariableAccessData.h: * disassembler/ARM64/A64DOpcode.h: * inspector/remote/socket/RemoteInspectorMessageParser.h: * inspector/remote/socket/RemoteInspectorSocket.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/PCToCodeOriginMap.h: * runtime/BasicBlockLocation.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/JSRunLoopTimer.h: * runtime/PromiseDeferredTimer.h: (JSC::PromiseDeferredTimer::create): PromiseDeferredTimer should be allocated as `Ref<>` instead of `std::unique_ptr` since it is inheriting ThreadSafeRefCounted<>. Holding such a class with std::unique_ptr could lead to potentially dangerous operations (like, someone holds it with Ref<> while it is deleted by std::unique_ptr<>). * runtime/RandomizingFuzzerAgent.h: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * tools/JSDollarVM.cpp: * tools/SigillCrashAnalyzer.cpp: * wasm/WasmFormat.h: * wasm/WasmMemory.cpp: * wasm/WasmSignature.h: * yarr/YarrJIT.h: Source/WebCore: Changed the accessor since we changed std::unique_ptr to Ref for this field. No behavior change. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): Source/WTF: WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`. Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited. * wtf/Assertions.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/Bag.h: (WTF::Bag::Bag): Deleted. (WTF::Bag::~Bag): Deleted. (WTF::Bag::clear): Deleted. (WTF::Bag::add): Deleted. (WTF::Bag::iterator::iterator): Deleted. (WTF::Bag::iterator::operator! const): Deleted. (WTF::Bag::iterator::operator* const): Deleted. (WTF::Bag::iterator::operator++): Deleted. (WTF::Bag::iterator::operator== const): Deleted. (WTF::Bag::iterator::operator!= const): Deleted. (WTF::Bag::begin): Deleted. (WTF::Bag::begin const): Deleted. (WTF::Bag::end const): Deleted. (WTF::Bag::isEmpty const): Deleted. (WTF::Bag::unwrappedHead const): Deleted. * wtf/BitVector.h: (WTF::BitVector::BitVector): Deleted. (WTF::BitVector::~BitVector): Deleted. (WTF::BitVector::operator=): Deleted. (WTF::BitVector::size const): Deleted. (WTF::BitVector::ensureSize): Deleted. (WTF::BitVector::quickGet const): Deleted. (WTF::BitVector::quickSet): Deleted. (WTF::BitVector::quickClear): Deleted. (WTF::BitVector::get const): Deleted. (WTF::BitVector::contains const): Deleted. (WTF::BitVector::set): Deleted. (WTF::BitVector::add): Deleted. (WTF::BitVector::ensureSizeAndSet): Deleted. (WTF::BitVector::clear): Deleted. (WTF::BitVector::remove): Deleted. (WTF::BitVector::merge): Deleted. (WTF::BitVector::filter): Deleted. (WTF::BitVector::exclude): Deleted. (WTF::BitVector::bitCount const): Deleted. (WTF::BitVector::isEmpty const): Deleted. (WTF::BitVector::findBit const): Deleted. (WTF::BitVector::isEmptyValue const): Deleted. (WTF::BitVector::isDeletedValue const): Deleted. (WTF::BitVector::isEmptyOrDeletedValue const): Deleted. (WTF::BitVector::operator== const): Deleted. (WTF::BitVector::hash const): Deleted. (WTF::BitVector::iterator::iterator): Deleted. (WTF::BitVector::iterator::operator* const): Deleted. (WTF::BitVector::iterator::operator++): Deleted. (WTF::BitVector::iterator::isAtEnd const): Deleted. (WTF::BitVector::iterator::operator== const): Deleted. (WTF::BitVector::iterator::operator!= const): Deleted. (WTF::BitVector::begin const): Deleted. (WTF::BitVector::end const): Deleted. (WTF::BitVector::bitsInPointer): Deleted. (WTF::BitVector::maxInlineBits): Deleted. (WTF::BitVector::byteCount): Deleted. (WTF::BitVector::makeInlineBits): Deleted. (WTF::BitVector::cleanseInlineBits): Deleted. (WTF::BitVector::bitCount): Deleted. (WTF::BitVector::findBitFast const): Deleted. (WTF::BitVector::findBitSimple const): Deleted. (WTF::BitVector::OutOfLineBits::numBits const): Deleted. (WTF::BitVector::OutOfLineBits::numWords const): Deleted. (WTF::BitVector::OutOfLineBits::bits): Deleted. (WTF::BitVector::OutOfLineBits::bits const): Deleted. (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted. (WTF::BitVector::isInline const): Deleted. (WTF::BitVector::outOfLineBits const): Deleted. (WTF::BitVector::outOfLineBits): Deleted. (WTF::BitVector::bits): Deleted. (WTF::BitVector::bits const): Deleted. * wtf/Bitmap.h: (WTF::Bitmap::size): Deleted. (WTF::Bitmap::iterator::iterator): Deleted. (WTF::Bitmap::iterator::operator* const): Deleted. (WTF::Bitmap::iterator::operator++): Deleted. (WTF::Bitmap::iterator::operator== const): Deleted. (WTF::Bitmap::iterator::operator!= const): Deleted. (WTF::Bitmap::begin const): Deleted. (WTF::Bitmap::end const): Deleted. * wtf/Box.h: * wtf/BumpPointerAllocator.h: * wtf/CPUTime.h: * wtf/CheckedBoolean.h: * wtf/CommaPrinter.h: (WTF::CommaPrinter::CommaPrinter): Deleted. (WTF::CommaPrinter::dump const): Deleted. (WTF::CommaPrinter::didPrint const): Deleted. * wtf/CompactPointerTuple.h: (WTF::CompactPointerTuple::encodeType): Deleted. (WTF::CompactPointerTuple::decodeType): Deleted. (WTF::CompactPointerTuple::CompactPointerTuple): Deleted. (WTF::CompactPointerTuple::pointer const): Deleted. (WTF::CompactPointerTuple::setPointer): Deleted. (WTF::CompactPointerTuple::type const): Deleted. (WTF::CompactPointerTuple::setType): Deleted. * wtf/CompilationThread.h: (WTF::CompilationScope::CompilationScope): Deleted. (WTF::CompilationScope::~CompilationScope): Deleted. (WTF::CompilationScope::leaveEarly): Deleted. * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): (WTF::Detail::CallableWrapper<CompletionHandler<Out): (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted. * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::growExact): Deleted. (WTF::ConcurrentBuffer::grow): Deleted. (WTF::ConcurrentBuffer::array const): Deleted. (WTF::ConcurrentBuffer::operator[]): Deleted. (WTF::ConcurrentBuffer::operator[] const): Deleted. (WTF::ConcurrentBuffer::createArray): Deleted. * wtf/ConcurrentPtrHashSet.h: (WTF::ConcurrentPtrHashSet::contains): Deleted. (WTF::ConcurrentPtrHashSet::add): Deleted. (WTF::ConcurrentPtrHashSet::size const): Deleted. (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted. (WTF::ConcurrentPtrHashSet::hash): Deleted. (WTF::ConcurrentPtrHashSet::cast): Deleted. (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted. (WTF::ConcurrentPtrHashSet::addImpl): Deleted. * wtf/ConcurrentVector.h: (WTF::ConcurrentVector::~ConcurrentVector): Deleted. (WTF::ConcurrentVector::size const): Deleted. (WTF::ConcurrentVector::isEmpty const): Deleted. (WTF::ConcurrentVector::at): Deleted. (WTF::ConcurrentVector::at const): Deleted. (WTF::ConcurrentVector::operator[]): Deleted. (WTF::ConcurrentVector::operator[] const): Deleted. (WTF::ConcurrentVector::first): Deleted. (WTF::ConcurrentVector::first const): Deleted. (WTF::ConcurrentVector::last): Deleted. (WTF::ConcurrentVector::last const): Deleted. (WTF::ConcurrentVector::takeLast): Deleted. (WTF::ConcurrentVector::append): Deleted. (WTF::ConcurrentVector::alloc): Deleted. (WTF::ConcurrentVector::removeLast): Deleted. (WTF::ConcurrentVector::grow): Deleted. (WTF::ConcurrentVector::begin): Deleted. (WTF::ConcurrentVector::end): Deleted. (WTF::ConcurrentVector::segmentExistsFor): Deleted. (WTF::ConcurrentVector::segmentFor): Deleted. (WTF::ConcurrentVector::subscriptFor): Deleted. (WTF::ConcurrentVector::ensureSegmentsFor): Deleted. (WTF::ConcurrentVector::ensureSegment): Deleted. (WTF::ConcurrentVector::allocateSegment): Deleted. * wtf/Condition.h: (WTF::Condition::waitUntil): Deleted. (WTF::Condition::waitFor): Deleted. (WTF::Condition::wait): Deleted. (WTF::Condition::notifyOne): Deleted. (WTF::Condition::notifyAll): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::LockHooks::lockHook): Deleted. (WTF::CountingLock::LockHooks::unlockHook): Deleted. (WTF::CountingLock::LockHooks::parkHook): Deleted. (WTF::CountingLock::LockHooks::handoffHook): Deleted. (WTF::CountingLock::tryLock): Deleted. (WTF::CountingLock::lock): Deleted. (WTF::CountingLock::unlock): Deleted. (WTF::CountingLock::isHeld const): Deleted. (WTF::CountingLock::isLocked const): Deleted. (WTF::CountingLock::Count::operator bool const): Deleted. (WTF::CountingLock::Count::operator== const): Deleted. (WTF::CountingLock::Count::operator!= const): Deleted. (WTF::CountingLock::tryOptimisticRead): Deleted. (WTF::CountingLock::validate): Deleted. (WTF::CountingLock::doOptimizedRead): Deleted. (WTF::CountingLock::tryOptimisticFencelessRead): Deleted. (WTF::CountingLock::fencelessValidate): Deleted. (WTF::CountingLock::doOptimizedFencelessRead): Deleted. (WTF::CountingLock::getCount): Deleted. * wtf/CrossThreadQueue.h: * wtf/CrossThreadTask.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/DataMutex.h: * wtf/DateMath.h: * wtf/Deque.h: (WTF::Deque::size const): Deleted. (WTF::Deque::isEmpty const): Deleted. (WTF::Deque::begin): Deleted. (WTF::Deque::end): Deleted. (WTF::Deque::begin const): Deleted. (WTF::Deque::end const): Deleted. (WTF::Deque::rbegin): Deleted. (WTF::Deque::rend): Deleted. (WTF::Deque::rbegin const): Deleted. (WTF::Deque::rend const): Deleted. (WTF::Deque::first): Deleted. (WTF::Deque::first const): Deleted. (WTF::Deque::last): Deleted. (WTF::Deque::last const): Deleted. (WTF::Deque::append): Deleted. * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/Expected.h: * wtf/FastBitVector.h: * wtf/FileMetadata.h: * wtf/FileSystem.h: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.h: (WTF::GregorianDateTime::GregorianDateTime): Deleted. (WTF::GregorianDateTime::year const): Deleted. (WTF::GregorianDateTime::month const): Deleted. (WTF::GregorianDateTime::yearDay const): Deleted. (WTF::GregorianDateTime::monthDay const): Deleted. (WTF::GregorianDateTime::weekDay const): Deleted. (WTF::GregorianDateTime::hour const): Deleted. (WTF::GregorianDateTime::minute const): Deleted. (WTF::GregorianDateTime::second const): Deleted. (WTF::GregorianDateTime::utcOffset const): Deleted. (WTF::GregorianDateTime::isDST const): Deleted. (WTF::GregorianDateTime::setYear): Deleted. (WTF::GregorianDateTime::setMonth): Deleted. (WTF::GregorianDateTime::setYearDay): Deleted. (WTF::GregorianDateTime::setMonthDay): Deleted. (WTF::GregorianDateTime::setWeekDay): Deleted. (WTF::GregorianDateTime::setHour): Deleted. (WTF::GregorianDateTime::setMinute): Deleted. (WTF::GregorianDateTime::setSecond): Deleted. (WTF::GregorianDateTime::setUtcOffset): Deleted. (WTF::GregorianDateTime::setIsDST): Deleted. (WTF::GregorianDateTime::operator tm const): Deleted. (WTF::GregorianDateTime::copyFrom): Deleted. * wtf/HashTable.h: * wtf/Hasher.h: * wtf/HexNumber.h: * wtf/Indenter.h: * wtf/IndexMap.h: * wtf/IndexSet.h: * wtf/IndexSparseSet.h: * wtf/IndexedContainerIterator.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/KeyValuePair.h: * wtf/ListHashSet.h: (WTF::ListHashSet::begin): Deleted. (WTF::ListHashSet::end): Deleted. (WTF::ListHashSet::begin const): Deleted. (WTF::ListHashSet::end const): Deleted. (WTF::ListHashSet::random): Deleted. (WTF::ListHashSet::random const): Deleted. (WTF::ListHashSet::rbegin): Deleted. (WTF::ListHashSet::rend): Deleted. (WTF::ListHashSet::rbegin const): Deleted. (WTF::ListHashSet::rend const): Deleted. * wtf/Liveness.h: * wtf/LocklessBag.h: (WTF::LocklessBag::LocklessBag): Deleted. (WTF::LocklessBag::add): Deleted. (WTF::LocklessBag::iterate): Deleted. (WTF::LocklessBag::consumeAll): Deleted. (WTF::LocklessBag::consumeAllWithNode): Deleted. (WTF::LocklessBag::~LocklessBag): Deleted. * wtf/LoggingHashID.h: * wtf/MD5.h: * wtf/MachSendRight.h: * wtf/MainThreadData.h: * wtf/Markable.h: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.h: * wtf/MessageQueue.h: (WTF::MessageQueue::MessageQueue): Deleted. * wtf/MetaAllocator.h: * wtf/MonotonicTime.h: (WTF::MonotonicTime::MonotonicTime): Deleted. (WTF::MonotonicTime::fromRawSeconds): Deleted. (WTF::MonotonicTime::infinity): Deleted. (WTF::MonotonicTime::nan): Deleted. (WTF::MonotonicTime::secondsSinceEpoch const): Deleted. (WTF::MonotonicTime::approximateMonotonicTime const): Deleted. (WTF::MonotonicTime::operator bool const): Deleted. (WTF::MonotonicTime::operator+ const): Deleted. (WTF::MonotonicTime::operator- const): Deleted. (WTF::MonotonicTime::operator% const): Deleted. (WTF::MonotonicTime::operator+=): Deleted. (WTF::MonotonicTime::operator-=): Deleted. (WTF::MonotonicTime::operator== const): Deleted. (WTF::MonotonicTime::operator!= const): Deleted. (WTF::MonotonicTime::operator< const): Deleted. (WTF::MonotonicTime::operator> const): Deleted. (WTF::MonotonicTime::operator<= const): Deleted. (WTF::MonotonicTime::operator>= const): Deleted. (WTF::MonotonicTime::isolatedCopy const): Deleted. (WTF::MonotonicTime::encode const): Deleted. (WTF::MonotonicTime::decode): Deleted. * wtf/NaturalLoops.h: * wtf/NoLock.h: * wtf/OSAllocator.h: * wtf/OptionSet.h: * wtf/Optional.h: * wtf/OrderMaker.h: * wtf/Packed.h: (WTF::alignof): * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): Deleted. (WTF::PackedIntVector::operator=): Deleted. (WTF::PackedIntVector::size const): Deleted. (WTF::PackedIntVector::ensureSize): Deleted. (WTF::PackedIntVector::resize): Deleted. (WTF::PackedIntVector::clearAll): Deleted. (WTF::PackedIntVector::get const): Deleted. (WTF::PackedIntVector::set): Deleted. (WTF::PackedIntVector::mask): Deleted. * wtf/PageBlock.h: * wtf/ParallelJobsOpenMP.h: * wtf/ParkingLot.h: * wtf/PriorityQueue.h: (WTF::PriorityQueue::size const): Deleted. (WTF::PriorityQueue::isEmpty const): Deleted. (WTF::PriorityQueue::enqueue): Deleted. (WTF::PriorityQueue::peek const): Deleted. (WTF::PriorityQueue::dequeue): Deleted. (WTF::PriorityQueue::decreaseKey): Deleted. (WTF::PriorityQueue::increaseKey): Deleted. (WTF::PriorityQueue::begin const): Deleted. (WTF::PriorityQueue::end const): Deleted. (WTF::PriorityQueue::isValidHeap const): Deleted. (WTF::PriorityQueue::parentOf): Deleted. (WTF::PriorityQueue::leftChildOf): Deleted. (WTF::PriorityQueue::rightChildOf): Deleted. (WTF::PriorityQueue::siftUp): Deleted. (WTF::PriorityQueue::siftDown): Deleted. * wtf/RandomDevice.h: * wtf/Range.h: * wtf/RangeSet.h: (WTF::RangeSet::RangeSet): Deleted. (WTF::RangeSet::~RangeSet): Deleted. (WTF::RangeSet::add): Deleted. (WTF::RangeSet::contains const): Deleted. (WTF::RangeSet::overlaps const): Deleted. (WTF::RangeSet::clear): Deleted. (WTF::RangeSet::dump const): Deleted. (WTF::RangeSet::dumpRaw const): Deleted. (WTF::RangeSet::begin const): Deleted. (WTF::RangeSet::end const): Deleted. (WTF::RangeSet::addAll): Deleted. (WTF::RangeSet::compact): Deleted. (WTF::RangeSet::overlapsNonEmpty): Deleted. (WTF::RangeSet::subsumesNonEmpty): Deleted. (WTF::RangeSet::findRange const): Deleted. * wtf/RecursableLambda.h: * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor const): Deleted. (WTF::RedBlackTree::Node::predecessor const): Deleted. (WTF::RedBlackTree::Node::successor): Deleted. (WTF::RedBlackTree::Node::predecessor): Deleted. (WTF::RedBlackTree::Node::reset): Deleted. (WTF::RedBlackTree::Node::parent const): Deleted. (WTF::RedBlackTree::Node::setParent): Deleted. (WTF::RedBlackTree::Node::left const): Deleted. (WTF::RedBlackTree::Node::setLeft): Deleted. (WTF::RedBlackTree::Node::right const): Deleted. (WTF::RedBlackTree::Node::setRight): Deleted. (WTF::RedBlackTree::Node::color const): Deleted. (WTF::RedBlackTree::Node::setColor): Deleted. (WTF::RedBlackTree::RedBlackTree): Deleted. (WTF::RedBlackTree::insert): Deleted. (WTF::RedBlackTree::remove): Deleted. (WTF::RedBlackTree::findExact const): Deleted. (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted. (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted. (WTF::RedBlackTree::first const): Deleted. (WTF::RedBlackTree::last const): Deleted. (WTF::RedBlackTree::size): Deleted. (WTF::RedBlackTree::isEmpty): Deleted. (WTF::RedBlackTree::treeMinimum): Deleted. (WTF::RedBlackTree::treeMaximum): Deleted. (WTF::RedBlackTree::treeInsert): Deleted. (WTF::RedBlackTree::leftRotate): Deleted. (WTF::RedBlackTree::rightRotate): Deleted. (WTF::RedBlackTree::removeFixup): Deleted. * wtf/ResourceUsage.h: * wtf/RunLoop.cpp: * wtf/RunLoopTimer.h: * wtf/SHA1.h: * wtf/Seconds.h: (WTF::Seconds::Seconds): Deleted. (WTF::Seconds::value const): Deleted. (WTF::Seconds::minutes const): Deleted. (WTF::Seconds::seconds const): Deleted. (WTF::Seconds::milliseconds const): Deleted. (WTF::Seconds::microseconds const): Deleted. (WTF::Seconds::nanoseconds const): Deleted. (WTF::Seconds::minutesAs const): Deleted. (WTF::Seconds::secondsAs const): Deleted. (WTF::Seconds::millisecondsAs const): Deleted. (WTF::Seconds::microsecondsAs const): Deleted. (WTF::Seconds::nanosecondsAs const): Deleted. (WTF::Seconds::fromMinutes): Deleted. (WTF::Seconds::fromHours): Deleted. (WTF::Seconds::fromMilliseconds): Deleted. (WTF::Seconds::fromMicroseconds): Deleted. (WTF::Seconds::fromNanoseconds): Deleted. (WTF::Seconds::infinity): Deleted. (WTF::Seconds::nan): Deleted. (WTF::Seconds::operator bool const): Deleted. (WTF::Seconds::operator+ const): Deleted. (WTF::Seconds::operator- const): Deleted. (WTF::Seconds::operator* const): Deleted. (WTF::Seconds::operator/ const): Deleted. (WTF::Seconds::operator% const): Deleted. (WTF::Seconds::operator+=): Deleted. (WTF::Seconds::operator-=): Deleted. (WTF::Seconds::operator*=): Deleted. (WTF::Seconds::operator/=): Deleted. (WTF::Seconds::operator%=): Deleted. (WTF::Seconds::operator== const): Deleted. (WTF::Seconds::operator!= const): Deleted. (WTF::Seconds::operator< const): Deleted. (WTF::Seconds::operator> const): Deleted. (WTF::Seconds::operator<= const): Deleted. (WTF::Seconds::operator>= const): Deleted. (WTF::Seconds::isolatedCopy const): Deleted. (WTF::Seconds::encode const): Deleted. (WTF::Seconds::decode): Deleted. * wtf/SegmentedVector.h: (WTF::SegmentedVector::~SegmentedVector): Deleted. (WTF::SegmentedVector::size const): Deleted. (WTF::SegmentedVector::isEmpty const): Deleted. (WTF::SegmentedVector::at): Deleted. (WTF::SegmentedVector::at const): Deleted. (WTF::SegmentedVector::operator[]): Deleted. (WTF::SegmentedVector::operator[] const): Deleted. (WTF::SegmentedVector::first): Deleted. (WTF::SegmentedVector::first const): Deleted. (WTF::SegmentedVector::last): Deleted. (WTF::SegmentedVector::last const): Deleted. (WTF::SegmentedVector::takeLast): Deleted. (WTF::SegmentedVector::append): Deleted. (WTF::SegmentedVector::alloc): Deleted. (WTF::SegmentedVector::removeLast): Deleted. (WTF::SegmentedVector::grow): Deleted. (WTF::SegmentedVector::clear): Deleted. (WTF::SegmentedVector::begin): Deleted. (WTF::SegmentedVector::end): Deleted. (WTF::SegmentedVector::shrinkToFit): Deleted. (WTF::SegmentedVector::deleteAllSegments): Deleted. (WTF::SegmentedVector::segmentExistsFor): Deleted. (WTF::SegmentedVector::segmentFor): Deleted. (WTF::SegmentedVector::subscriptFor): Deleted. (WTF::SegmentedVector::ensureSegmentsFor): Deleted. (WTF::SegmentedVector::ensureSegment): Deleted. (WTF::SegmentedVector::allocateSegment): Deleted. * wtf/SetForScope.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SmallPtrSet.h: * wtf/SpanningTree.h: * wtf/Spectrum.h: * wtf/StackBounds.h: * wtf/StackShot.h: * wtf/StackShotProfiler.h: * wtf/StackStats.h: * wtf/StackTrace.h: * wtf/StreamBuffer.h: * wtf/SynchronizedFixedQueue.h: (WTF::SynchronizedFixedQueue::create): Deleted. (WTF::SynchronizedFixedQueue::open): Deleted. (WTF::SynchronizedFixedQueue::close): Deleted. (WTF::SynchronizedFixedQueue::isOpen): Deleted. (WTF::SynchronizedFixedQueue::enqueue): Deleted. (WTF::SynchronizedFixedQueue::dequeue): Deleted. (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted. * wtf/SystemTracing.h: * wtf/ThreadGroup.h: (WTF::ThreadGroup::create): Deleted. (WTF::ThreadGroup::threads const): Deleted. (WTF::ThreadGroup::getLock): Deleted. (WTF::ThreadGroup::weakFromThis): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingPrimitives.h: (WTF::Mutex::impl): Deleted. * wtf/TimeWithDynamicClockType.h: (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted. (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted. (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted. (WTF::TimeWithDynamicClockType::clockType const): Deleted. (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted. (WTF::TimeWithDynamicClockType::operator bool const): Deleted. (WTF::TimeWithDynamicClockType::operator+ const): Deleted. (WTF::TimeWithDynamicClockType::operator- const): Deleted. (WTF::TimeWithDynamicClockType::operator+=): Deleted. (WTF::TimeWithDynamicClockType::operator-=): Deleted. (WTF::TimeWithDynamicClockType::operator== const): Deleted. (WTF::TimeWithDynamicClockType::operator!= const): Deleted. * wtf/TimingScope.h: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/URLParser.cpp: * wtf/URLParser.h: * wtf/Unexpected.h: * wtf/Variant.h: * wtf/WTFSemaphore.h: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::signal): Deleted. (WTF::Semaphore::waitUntil): Deleted. (WTF::Semaphore::waitFor): Deleted. (WTF::Semaphore::wait): Deleted. * wtf/WallTime.h: (WTF::WallTime::WallTime): Deleted. (WTF::WallTime::fromRawSeconds): Deleted. (WTF::WallTime::infinity): Deleted. (WTF::WallTime::nan): Deleted. (WTF::WallTime::secondsSinceEpoch const): Deleted. (WTF::WallTime::approximateWallTime const): Deleted. (WTF::WallTime::operator bool const): Deleted. (WTF::WallTime::operator+ const): Deleted. (WTF::WallTime::operator- const): Deleted. (WTF::WallTime::operator+=): Deleted. (WTF::WallTime::operator-=): Deleted. (WTF::WallTime::operator== const): Deleted. (WTF::WallTime::operator!= const): Deleted. (WTF::WallTime::operator< const): Deleted. (WTF::WallTime::operator> const): Deleted. (WTF::WallTime::operator<= const): Deleted. (WTF::WallTime::operator>= const): Deleted. (WTF::WallTime::isolatedCopy const): Deleted. * wtf/WeakHashSet.h: (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted. (WTF::WeakHashSet::WeakHashSet): Deleted. (WTF::WeakHashSet::begin const): Deleted. (WTF::WeakHashSet::end const): Deleted. (WTF::WeakHashSet::add): Deleted. (WTF::WeakHashSet::remove): Deleted. (WTF::WeakHashSet::contains const): Deleted. (WTF::WeakHashSet::capacity const): Deleted. (WTF::WeakHashSet::computesEmpty const): Deleted. (WTF::WeakHashSet::hasNullReferences const): Deleted. (WTF::WeakHashSet::computeSize const): Deleted. (WTF::WeakHashSet::checkConsistency const): Deleted. * wtf/WeakRandom.h: (WTF::WeakRandom::WeakRandom): Deleted. (WTF::WeakRandom::setSeed): Deleted. (WTF::WeakRandom::seed const): Deleted. (WTF::WeakRandom::get): Deleted. (WTF::WeakRandom::getUint32): Deleted. (WTF::WeakRandom::lowOffset): Deleted. (WTF::WeakRandom::highOffset): Deleted. (WTF::WeakRandom::nextState): Deleted. (WTF::WeakRandom::generate): Deleted. (WTF::WeakRandom::advance): Deleted. * wtf/WordLock.h: (WTF::WordLock::lock): Deleted. (WTF::WordLock::unlock): Deleted. (WTF::WordLock::isHeld const): Deleted. (WTF::WordLock::isLocked const): Deleted. (WTF::WordLock::isFullyReset const): Deleted. * wtf/generic/MainThreadGeneric.cpp: * wtf/glib/GMutexLocker.h: * wtf/linux/CurrentProcessMemoryStatus.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::~Semaphore): Deleted. (WTF::Semaphore::wait): Deleted. (WTF::Semaphore::post): Deleted. * wtf/text/ASCIILiteral.h: (WTF::ASCIILiteral::operator const char* const): Deleted. (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted. (WTF::ASCIILiteral::null): Deleted. (WTF::ASCIILiteral::characters const): Deleted. (WTF::ASCIILiteral::ASCIILiteral): Deleted. * wtf/text/AtomString.h: (WTF::AtomString::operator=): Deleted. (WTF::AtomString::isHashTableDeletedValue const): Deleted. (WTF::AtomString::existingHash const): Deleted. (WTF::AtomString::operator const String& const): Deleted. (WTF::AtomString::string const): Deleted. (WTF::AtomString::impl const): Deleted. (WTF::AtomString::is8Bit const): Deleted. (WTF::AtomString::characters8 const): Deleted. (WTF::AtomString::characters16 const): Deleted. (WTF::AtomString::length const): Deleted. (WTF::AtomString::operator[] const): Deleted. (WTF::AtomString::contains const): Deleted. (WTF::AtomString::containsIgnoringASCIICase const): Deleted. (WTF::AtomString::find const): Deleted. (WTF::AtomString::findIgnoringASCIICase const): Deleted. (WTF::AtomString::startsWith const): Deleted. (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::endsWith const): Deleted. (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::toInt const): Deleted. (WTF::AtomString::toDouble const): Deleted. (WTF::AtomString::toFloat const): Deleted. (WTF::AtomString::percentage const): Deleted. (WTF::AtomString::isNull const): Deleted. (WTF::AtomString::isEmpty const): Deleted. (WTF::AtomString::operator NSString * const): Deleted. * wtf/text/AtomStringImpl.h: (WTF::AtomStringImpl::lookUp): Deleted. (WTF::AtomStringImpl::add): Deleted. (WTF::AtomStringImpl::addWithStringTableProvider): Deleted. * wtf/text/CString.h: (WTF::CStringBuffer::data): Deleted. (WTF::CStringBuffer::length const): Deleted. (WTF::CStringBuffer::CStringBuffer): Deleted. (WTF::CStringBuffer::mutableData): Deleted. (WTF::CString::CString): Deleted. (WTF::CString::data const): Deleted. (WTF::CString::length const): Deleted. (WTF::CString::isNull const): Deleted. (WTF::CString::buffer const): Deleted. (WTF::CString::isHashTableDeletedValue const): Deleted. * wtf/text/ExternalStringImpl.h: (WTF::ExternalStringImpl::freeExternalBuffer): Deleted. * wtf/text/LineBreakIteratorPoolICU.h: * wtf/text/NullTextBreakIterator.h: * wtf/text/OrdinalNumber.h: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.h: * wtf/text/StringConcatenateNumbers.h: * wtf/text/StringHasher.h: * wtf/text/StringImpl.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: (WTF::StringView::left const): Deleted. (WTF::StringView::right const): Deleted. (WTF::StringView::underlyingStringIsValid const): Deleted. (WTF::StringView::setUnderlyingString): Deleted. * wtf/text/SymbolImpl.h: (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted. (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted. (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted. (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted. (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted. (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted. * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.h: * wtf/text/WTFString.h: (WTF::String::swap): Deleted. (WTF::String::adopt): Deleted. (WTF::String::isNull const): Deleted. (WTF::String::isEmpty const): Deleted. (WTF::String::impl const): Deleted. (WTF::String::releaseImpl): Deleted. (WTF::String::length const): Deleted. (WTF::String::characters8 const): Deleted. (WTF::String::characters16 const): Deleted. (WTF::String::is8Bit const): Deleted. (WTF::String::sizeInBytes const): Deleted. (WTF::String::operator[] const): Deleted. (WTF::String::find const): Deleted. (WTF::String::findIgnoringASCIICase const): Deleted. (WTF::String::reverseFind const): Deleted. (WTF::String::contains const): Deleted. (WTF::String::containsIgnoringASCIICase const): Deleted. (WTF::String::startsWith const): Deleted. (WTF::String::startsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixStartingAt const): Deleted. (WTF::String::endsWith const): Deleted. (WTF::String::endsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixEndingAt const): Deleted. (WTF::String::append): Deleted. (WTF::String::left const): Deleted. (WTF::String::right const): Deleted. (WTF::String::createUninitialized): Deleted. (WTF::String::fromUTF8WithLatin1Fallback): Deleted. (WTF::String::isAllASCII const): Deleted. (WTF::String::isAllLatin1 const): Deleted. (WTF::String::isSpecialCharacter const): Deleted. (WTF::String::isHashTableDeletedValue const): Deleted. (WTF::String::hash const): Deleted. (WTF::String::existingHash const): Deleted. * wtf/text/cf/TextBreakIteratorCF.h: * wtf/text/icu/TextBreakIteratorICU.h: * wtf/text/icu/UTextProviderLatin1.h: * wtf/threads/BinarySemaphore.h: (WTF::BinarySemaphore::waitFor): Deleted. (WTF::BinarySemaphore::wait): Deleted. * wtf/unicode/Collator.h: * wtf/win/GDIObject.h: * wtf/win/PathWalker.h: * wtf/win/Win32Handle.h: Canonical link: https://commits.webkit.org/214396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-12 20:57:15 +00:00
WTF_MAKE_FAST_ALLOCATED;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant()=delete;
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
constexpr bool valueless_by_exception() const __NOEXCEPT{
return true;
}
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
constexpr ptrdiff_t index() const __NOEXCEPT{
return -1;
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
void swap(Variant&){}
};
template <typename... _Types>
typename std::enable_if<__all_swappable<_Types...>::value &&
__all_move_constructible<_Types...>::value,
void>::type
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
swap(Variant<_Types...> &__lhs, Variant<_Types...> &__rhs) __NOEXCEPT_(
__noexcept_variant_swap<_Types...>::value) {
__lhs.swap(__rhs);
}
template<ptrdiff_t _Index,typename ... _Types>
struct __variant_accessor{
typedef typename __indexed_type<_Index,_Types...>::__type __type;
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
static constexpr __type& get(Variant<_Types...>& __v){
return __v.__storage.__get(in_place<_Index>);
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
static constexpr __type const& get(Variant<_Types...> const& __v){
return __v.__storage.__get(in_place<_Index>);
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
static constexpr __type&& get(Variant<_Types...>&& __v){
return __v.__storage.__get_rref(in_place<_Index>);
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
static constexpr const __type&& get(Variant<_Types...> const&& __v){
return __v.__storage.__get_rref(in_place<_Index>);
}
};
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type& get(Variant<_Types...>& __v){
return get<__type_index<_Type,_Types...>::__value>(__v);
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type&& get(Variant<_Types...>&& __v){
return get<__type_index<_Type,_Types...>::__value>(std::move(__v));
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr _Type const& get(Variant<_Types...> const& __v){
return get<__type_index<_Type,_Types...>::__value>(__v);
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr const _Type&& get(Variant<_Types...> const&& __v){
return get<__type_index<_Type,_Types...>::__value>(std::move(__v));
}
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr typename __indexed_type<_Index,_Types...>::__type const& get(Variant<_Types...> const& __v){
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
return *(
(_Index!=__v.index())
? std::addressof(__throw_bad_variant_access<typename __indexed_type<_Index,_Types...>::__type const&>("Bad Variant index in get"))
: std::addressof(__variant_accessor<_Index,_Types...>::get(__v))
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
);
}
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr typename __indexed_type<_Index,_Types...>::__type& get(Variant<_Types...>& __v){
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
return *(
(_Index!=__v.index())
? std::addressof(__throw_bad_variant_access<typename __indexed_type<_Index,_Types...>::__type&>("Bad Variant index in get"))
: std::addressof(__variant_accessor<_Index,_Types...>::get(__v))
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
);
}
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr typename __indexed_type<_Index,_Types...>::__type&& get(Variant<_Types...>&& __v){
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
return __variant_accessor<_Index,_Types...>::get(
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
(((_Index!=__v.index()) ? __throw_bad_variant_access<int>("Bad Variant index in get") : 0), std::move(__v))
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
);
}
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr const typename __indexed_type<_Index,_Types...>::__type&& get(Variant<_Types...> const&& __v){
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
return __variant_accessor<_Index,_Types...>::get(
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
(((_Index!=__v.index()) ? __throw_bad_variant_access<int>("Bad Variant index in get") : 0), std::move(__v))
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
);
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<_Type> get_if(Variant<_Types...>& __v){
return (__type_index<_Type,_Types...>::__value!=__v.index())?nullptr:std::addressof(get<_Type>(__v));
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<_Type const> get_if(Variant<_Types...> const& __v){
return (__type_index<_Type,_Types...>::__value!=__v.index())?nullptr:std::addressof(get<_Type>(__v));
}
template<ptrdiff_t _Index,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type> get_if(Variant<_Types...>& __v){
return ((_Index!=__v.index())?nullptr:
std::addressof(__variant_accessor<_Index,_Types...>::get(__v)));
}
template<ptrdiff_t _Index,typename ... _Types>
constexpr std::add_pointer_t<typename __indexed_type<_Index,_Types...>::__type const> get_if(
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
Variant<_Types...> const& __v){
return ((_Index!=__v.index())?nullptr:
std::addressof(__variant_accessor<_Index,_Types...>::get(__v)));
}
template<typename _Type,typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool holds_alternative(Variant<_Types...> const& __v) __NOEXCEPT{
return __v.index()==__type_index<_Type,_Types...>::__value;
}
template<typename _Visitor,typename ... _Types>
struct __visitor_return_type;
template<typename _Visitor>
struct __visitor_return_type<_Visitor>{
typedef decltype(std::declval<_Visitor&>()()) __type;
};
template<typename _Visitor,typename _Head,typename ... _Rest>
struct __visitor_return_type<_Visitor,_Head,_Rest...>{
typedef decltype(std::declval<_Visitor&>()(std::declval<_Head&>())) __type;
};
template<typename _Visitor,typename ... _Types>
struct __visitor_table{
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
typedef Variant<_Types...> __variant_type;
typedef typename __visitor_return_type<_Visitor,_Types...>::__type __return_type;
typedef __return_type (*__func_type)(_Visitor&,__variant_type&);
template<typename _Type>
static __return_type __trampoline_func(_Visitor& __visitor,__variant_type& __v){
return __visitor(get<_Type>(__v));
}
static const __func_type __trampoline[sizeof...(_Types)];
};
template<typename _Visitor,typename ... _Types>
const typename __visitor_table<_Visitor,_Types...>::__func_type __visitor_table<_Visitor,_Types...>::__trampoline[sizeof...(_Types)]={
&__trampoline_func<_Types>...
};
template<typename _Visitor,typename ... _Types>
constexpr typename __visitor_return_type<_Visitor,_Types...>::__type
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
visit(_Visitor&& __visitor,Variant<_Types...>& __v){
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
return (__v.valueless_by_exception())
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
? __throw_bad_variant_access<typename __visitor_return_type<_Visitor,_Types...>::__type>("Visiting of empty Variant")
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
: __visitor_table<_Visitor,_Types...>::__trampoline[__v.index()](__visitor,__v);
}
template<typename _Visitor,typename ... _Variants>
struct __multi_visitor_return_type{
typedef decltype(std::declval<_Visitor&>()(get<0>(std::declval<_Variants>())...))
__type;
};
template<size_t _VariantIndex,typename _Indices>
struct __visit_helper;
template<ptrdiff_t ... _Indices>
struct __visit_helper<0,__index_sequence<_Indices...>>{
template<typename _Visitor,typename ... _Variants>
static constexpr typename __multi_visitor_return_type<_Visitor,_Variants...>::__type
__visit(_Visitor& __visitor,_Variants& ... __v){
return __visitor(get<_Indices>(__v)...);
}
};
template<size_t _Index,typename ... _Args>
struct __arg_selector_t;
template<typename _Head,typename ... _Rest>
struct __arg_selector_t<0,_Head,_Rest...>{
typedef _Head __type;
static constexpr __type& __select(_Head& __head,_Rest& ...){
return __head;
}
};
template<size_t _Index,typename _Head,typename ... _Rest>
struct __arg_selector_t<_Index,_Head,_Rest...>{
typedef typename __arg_selector_t<_Index-1,_Rest...>::__type __type;
static constexpr __type& __select(_Head&,_Rest& ... __rest){
return __arg_selector_t<_Index-1,_Rest...>::__select(__rest...);
}
};
template<size_t _Index,typename ... _Args>
constexpr typename __arg_selector_t<_Index,_Args...>::__type&& __arg_selector(_Args&& ... __args){
return std::forward<typename __arg_selector_t<_Index,_Args...>::__type>(
__arg_selector_t<_Index,_Args...>::__select(__args...));
}
template<ptrdiff_t _Index,size_t _VariantIndex,ptrdiff_t ... _Indices>
struct __visit_helper2{
template<typename _Visitor,typename ... _Variants>
static constexpr typename __multi_visitor_return_type<_Visitor,_Variants...>::__type
__visit(_Visitor& __visitor,_Variants&& ... __v){
return (__arg_selector<_VariantIndex-1>(__v...).index()==_Index)
? __visit_helper<_VariantIndex-1,__index_sequence<_Index,_Indices...>>::__visit(__visitor,std::forward<_Variants>(__v)...)
: __visit_helper2<_Index-1,_VariantIndex,_Indices...>::__visit(__visitor,std::forward<_Variants>(__v)...);
}
};
template<size_t _VariantIndex,ptrdiff_t ... _Indices>
struct __visit_helper2<-1,_VariantIndex,_Indices...>{
template<typename _Visitor,typename ... _Variants>
static constexpr typename __multi_visitor_return_type<_Visitor,_Variants...>::__type
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
__visit(_Visitor&,_Variants&& ...){
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
return __throw_bad_variant_access<typename __multi_visitor_return_type<_Visitor,_Variants...>::__type>("Visiting of empty Variant");
}
};
template<typename _Variant>
struct __variant_type_count;
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct __variant_type_count<Variant<_Types...>>{
static constexpr size_t __value=sizeof...(_Types);
};
template<typename _Variant>
struct __variant_type_count<_Variant&>{
static constexpr size_t __value=__variant_type_count<_Variant>::__value;
};
template<typename _Variant>
struct __variant_type_count<_Variant const&>{
static constexpr size_t __value=__variant_type_count<_Variant>::__value;
};
template<size_t _VariantIndex,ptrdiff_t ... _Indices>
struct __visit_helper<_VariantIndex,__index_sequence<_Indices...>>{
template<typename _Visitor,typename ... _Variants>
static constexpr typename __multi_visitor_return_type<_Visitor,_Variants...>::__type
__visit(_Visitor& __visitor,_Variants&& ... __v){
return __visit_helper2<
__variant_type_count<
typename __arg_selector_t<
_VariantIndex-1,_Variants...>::__type>::__value-1,
_VariantIndex,_Indices...>::__visit(
__visitor,std::forward<_Variants&&>(__v)...);
}
};
template<typename _Visitor,typename ... _Variants>
constexpr typename __multi_visitor_return_type<_Visitor,_Variants...>::__type
visit(_Visitor&& __visitor,_Variants&& ... __v){
return __visit_helper<sizeof...(_Variants),__index_sequence<>>::__visit(
__visitor,std::forward<_Variants>(__v)...);
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator==(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return (__lhs.index()==__rhs.index()) &&
((__lhs.index()==-1) ||
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__equality_op_table<Variant<_Types...>>::__equality_compare[__lhs.index()](
__lhs,__rhs));
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator!=(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return !(__lhs==__rhs);
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator<(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return (__lhs.index()<__rhs.index()) ||
((__lhs.index()==__rhs.index()) &&
((__lhs.index()!=-1) &&
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
__less_than_op_table<Variant<_Types...>>::
__less_than_compare[__lhs.index()](__lhs,__rhs)));
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator>(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return __rhs<__lhs;
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator>=(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return !(__lhs<__rhs);
}
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
constexpr bool operator<=(Variant<_Types...> const& __lhs,Variant<_Types...> const& __rhs){
return !(__lhs>__rhs);
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct Monostate{};
Cleanup: inline constexpr is redundant as constexpr implies inline https://bugs.webkit.org/show_bug.cgi?id=190819 Reviewed by Mark Lam. Source/bmalloc: * bmalloc/Algorithm.h: (bmalloc::max): (bmalloc::min): (bmalloc::mask): (bmalloc::test): (bmalloc::isPowerOfTwo): (bmalloc::roundDownToMultipleOf): (bmalloc::sizeOf): (bmalloc::bitCount): (bmalloc::log2): * bmalloc/Bits.h: (bmalloc::bitsArrayLength): * bmalloc/Sizes.h: (bmalloc::Sizes::maskSizeClass): Source/JavaScriptCore: * bytecode/ArrayProfile.h: (JSC::asArrayModes): * runtime/IndexingType.h: (JSC::isCopyOnWrite): * runtime/MathCommon.h: (JSC::maxSafeInteger): (JSC::minSafeInteger): * runtime/StackAlignment.h: (JSC::stackAlignmentBytes): (JSC::stackAlignmentRegisters): Source/WTF: * wtf/Bitmap.h: (WTF::WordType>::Bitmap): * wtf/LEBDecoder.h: (WTF::LEBDecoder::maxByteLength): * wtf/MathExtras.h: (defaultMinimumForClamp): (defaultMaximumForClamp): (clampToAccepting64): (isLessThan): (isLessThanEqual): (isGreaterThan): (isGreaterThanEqual): (WTF::roundUpToPowerOfTwo): (WTF::maskForSize): * wtf/Optional.h: * wtf/PtrTag.h: (WTF::tagCodePtr): (WTF::untagCodePtr): (WTF::retagCodePtr): (WTF::removeCodePtrTag): * wtf/StdLibExtras.h: (WTF::roundUpToMultipleOf): * wtf/Variant.h: (WTF::operator==): (WTF::operator!=): (WTF::operator>=): (WTF::operator<=): (WTF::operator>): (WTF::operator<): * wtf/text/StringImpl.h: (WTF::StringImplShape::StringImplShape): (WTF::StringImpl::StaticStringImpl::StaticStringImpl): Canonical link: https://commits.webkit.org/205768@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-25 22:23:23 +00:00
constexpr bool operator==(Monostate const&, Monostate const&) { return true; }
constexpr bool operator!=(Monostate const&, Monostate const&) { return false; }
constexpr bool operator>=(Monostate const&, Monostate const&) { return true; }
constexpr bool operator<=(Monostate const&, Monostate const&) { return true; }
constexpr bool operator>(Monostate const&, Monostate const&) { return false; }
constexpr bool operator<(Monostate const&, Monostate const&) { return false; }
struct __hash_visitor{
template<typename _Type>
size_t operator()(_Type const& __x){
return std::hash<_Type>()(__x);
}
};
// -- WebKit Additions --
template<class V, class... F>
Start using C++17 https://bugs.webkit.org/show_bug.cgi?id=197131 .: Reviewed by Darin Adler. * Source/cmake/OptionsMSVC.cmake: * Source/cmake/WebKitCompilerFlags.cmake: Source/bmalloc: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/JavaScriptCore: Reviewed by Darin Alder. * Configurations/Base.xcconfig: Source/ThirdParty: Reviewed by Darin Adler. * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/ThirdParty/libwebrtc: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebCore: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * DerivedSources.make: Source/WebCore/PAL: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebInspectorUI: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebKit: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * DerivedSources.make: Source/WebKitLegacy/mac: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WTF: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * wtf/CMakeLists.txt: * wtf/Variant.h: (WTF::switchOn): Tools: Reviewed by Darin Adler. * DumpRenderTree/mac/Configurations/Base.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MobileMiniBrowser/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: Canonical link: https://commits.webkit.org/211493@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-25 17:41:29 +00:00
auto switchOn(V&& v, F&&... f) -> decltype(WTF::visit(makeVisitor(std::forward<F>(f)...), std::forward<V>(v)))
{
Start using C++17 https://bugs.webkit.org/show_bug.cgi?id=197131 .: Reviewed by Darin Adler. * Source/cmake/OptionsMSVC.cmake: * Source/cmake/WebKitCompilerFlags.cmake: Source/bmalloc: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/JavaScriptCore: Reviewed by Darin Alder. * Configurations/Base.xcconfig: Source/ThirdParty: Reviewed by Darin Adler. * gtest/xcode/Config/General.xcconfig: Source/ThirdParty/ANGLE: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/ThirdParty/libwebrtc: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebCore: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * DerivedSources.make: Source/WebCore/PAL: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebInspectorUI: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WebKit: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * DerivedSources.make: Source/WebKitLegacy/mac: Reviewed by Darin Adler. * Configurations/Base.xcconfig: Source/WTF: Reviewed by Darin Adler. * Configurations/Base.xcconfig: * wtf/CMakeLists.txt: * wtf/Variant.h: (WTF::switchOn): Tools: Reviewed by Darin Adler. * DumpRenderTree/mac/Configurations/Base.xcconfig: * MiniBrowser/Configurations/Base.xcconfig: * MobileMiniBrowser/Configurations/Base.xcconfig: * TestWebKitAPI/Configurations/Base.xcconfig: * WebKitTestRunner/Configurations/Base.xcconfig: Canonical link: https://commits.webkit.org/211493@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-04-25 17:41:29 +00:00
return WTF::visit(makeVisitor(std::forward<F>(f)...), std::forward<V>(v));
}
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
} // namespace WTF
namespace std {
template<>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct hash<WTF::Monostate>{
size_t operator()(WTF::Monostate) __NOEXCEPT{
return 42;
}
};
template<typename ... _Types>
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
struct hash<WTF::Variant<_Types...>>{
size_t operator()(WTF::Variant<_Types...> const &v) __NOEXCEPT {
return std::hash<ptrdiff_t>()(v.index()) ^ WTF::visit(WTF::__hash_visitor(), v);
}
};
} // namespace std
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
Replace std::experimental::variant with WTF::Variant (or similar) https://bugs.webkit.org/show_bug.cgi?id=163626 Patch by Sam Weinig <sam@webkit.org> on 2016-10-18 Reviewed by Chris Dumez. Rename std::experimental::variant, Variant. Move helpers get/holds_alternative/etc. into the WTF namespace. Source/JavaScriptCore: * domjit/DOMJITReg.h: (JSC::DOMJIT::Reg::gpr): (JSC::DOMJIT::Reg::fpr): (JSC::DOMJIT::Reg::jsValueRegs): Source/WebCore: * Modules/fetch/FetchBody.h: (WebCore::FetchBody::isBlob): (WebCore::FetchBody::isFormData): (WebCore::FetchBody::isArrayBuffer): (WebCore::FetchBody::isArrayBufferView): (WebCore::FetchBody::isURLSearchParams): (WebCore::FetchBody::isText): (WebCore::FetchBody::blobBody): (WebCore::FetchBody::formDataBody): (WebCore::FetchBody::arrayBufferBody): (WebCore::FetchBody::arrayBufferViewBody): (WebCore::FetchBody::textBody): (WebCore::FetchBody::urlSearchParamsBody): * bindings/generic/IDLTypes.h: * dom/ExceptionOr.h: (WebCore::ExceptionOr<ReturnType>::hasException): (WebCore::ExceptionOr<ReturnType>::releaseException): (WebCore::ExceptionOr<ReturnType>::releaseReturnValue): * dom/MessageEvent.cpp: (WebCore::MessageEvent::source): * dom/MessageEvent.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::Node::convertNodesOrStringsIntoNode): * dom/Node.h: * html/HTMLOptionsCollection.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::add): * html/HTMLSelectElement.h: * html/track/TrackEvent.cpp: (WebCore::TrackEvent::TrackEvent): * html/track/TrackEvent.h: Source/WebKit/mac: * DOM/DOMHTMLSelectElement.mm: (-[DOMHTMLSelectElement add:before:]): Source/WTF: * wtf/Forward.h: * wtf/Variant.h: Tools: * TestWebKitAPI/Tests/WTF/Variant.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/181427@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-10-19 02:43:44 +00:00
using WTF::Monostate;
using WTF::Variant;
#endif // !COMPILER(CLANG) || WTF_CPP_STD_VER >= 14
Source/WebCore: Replace NodeOrString with std::variant<Ref<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * WebCore.xcodeproj/project.pbxproj: Remove NodeOrString.h/cpp * bindings/js/JSNodeOrString.cpp: * bindings/js/JSNodeOrString.h: * dom/ContainerNode.cpp: (WebCore::ContainerNode::append): (WebCore::ContainerNode::prepend): * dom/ContainerNode.h: * dom/Node.cpp: (WebCore::nodeSetPreTransformedFromNodeOrStringVector): (WebCore::firstFollowingSiblingNotInNodeSet): (WebCore::Node::convertNodesOrStringsIntoNode): (WebCore::Node::before): (WebCore::Node::after): (WebCore::Node::replaceWith): * dom/Node.h: Replace NodeOrString with std::variant<Ref<Node>, String> and move convertNodesOrStringsIntoNode into Node. * dom/NodeOrString.cpp: Removed. * dom/NodeOrString.h: Removed. Source/WTF: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * wtf/StdLibExtras.h: (WTF::Visitor::Visitor): (WTF::makeVisitor): Add WTF::makeVisitor() which takes a list of lambdas to use an an overload set for a visitor object. Also, re-export std::experimental::variant (and helpers) in the std namespace using type aliasing. * wtf/Variant.h: Make std::experimental::variant work in WebCore. Tools: Replace NodeOrString with std::variant<RefPtr<Node>, String> https://bugs.webkit.org/show_bug.cgi?id=160638 Reviewed by Anders Carlsson. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/Tests/WTF/Variant.cpp: Add additional tests for the initial state of std::variant and using makeVisitor for visiting. Canonical link: https://commits.webkit.org/178818@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-09 20:31:42 +00:00
#if COMPILER(MSVC)
#pragma warning(pop)
#endif