haikuwebkit/Source/WTF/wtf/OptionSet.h

263 lines
8.1 KiB
C
Raw Permalink Normal View History

Implement clearing of cookies https://bugs.webkit.org/show_bug.cgi?id=139455 Reviewed by Andreas Kling. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): Handle deleting cookies by finding the right network storage session and deleting the cookies from it. Then, send a DidDeleteWebsiteData message back. * NetworkProcess/NetworkProcess.h: Add new members. * NetworkProcess/NetworkProcess.messages.in: Add new DeleteWebsiteData message. * Shared/WebsiteData/WebsiteDataTypes.h: Move the website data types enum to its own file so it can be shared. * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (toWebsiteDataTypes): Update now that WebsiteDataTypes is its own enum. (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): removeDataModifiedSince was renamed to removeData. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::generateCallbackID): Helper function to create a callback ID. (WebKit::NetworkProcessProxy::~NetworkProcessProxy): Assert that we have no pending callbacks. (WebKit::NetworkProcessProxy::deleteWebsiteData): Put the completion handler in our map and message the network process. (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Call all completion handlers. (WebKit::NetworkProcessProxy::didDeleteWebsiteData): Grab the completion handler and call it. * UIProcess/Network/NetworkProcessProxy.h: Add new members. * UIProcess/Network/NetworkProcessProxy.messages.in: Add DidDeleteWebsiteData callback. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessType): Helper function that computes the type of process access we'd need for the given mask of website data types. (WebKit::WebsiteDataStore::removeData): Gather all the network processes and message them. Use a callback aggregator object to track callbacks so we'll call the completion handler once all callbacks have been invoked. * UIProcess/WebsiteData/WebsiteDataStore.h: Move WebsiteDataTypes to its own file. * WebKit2.xcodeproj/project.pbxproj: Add new files. Canonical link: https://commits.webkit.org/157309@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-09 20:29:59 +00:00
/*
* Copyright (C) 2016-2020 Apple Inc. All rights reserved.
Implement clearing of cookies https://bugs.webkit.org/show_bug.cgi?id=139455 Reviewed by Andreas Kling. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): Handle deleting cookies by finding the right network storage session and deleting the cookies from it. Then, send a DidDeleteWebsiteData message back. * NetworkProcess/NetworkProcess.h: Add new members. * NetworkProcess/NetworkProcess.messages.in: Add new DeleteWebsiteData message. * Shared/WebsiteData/WebsiteDataTypes.h: Move the website data types enum to its own file so it can be shared. * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (toWebsiteDataTypes): Update now that WebsiteDataTypes is its own enum. (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): removeDataModifiedSince was renamed to removeData. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::generateCallbackID): Helper function to create a callback ID. (WebKit::NetworkProcessProxy::~NetworkProcessProxy): Assert that we have no pending callbacks. (WebKit::NetworkProcessProxy::deleteWebsiteData): Put the completion handler in our map and message the network process. (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Call all completion handlers. (WebKit::NetworkProcessProxy::didDeleteWebsiteData): Grab the completion handler and call it. * UIProcess/Network/NetworkProcessProxy.h: Add new members. * UIProcess/Network/NetworkProcessProxy.messages.in: Add DidDeleteWebsiteData callback. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessType): Helper function that computes the type of process access we'd need for the given mask of website data types. (WebKit::WebsiteDataStore::removeData): Gather all the network processes and message them. Use a callback aggregator object to track callbacks so we'll call the completion handler once all callbacks have been invoked. * UIProcess/WebsiteData/WebsiteDataStore.h: Move WebsiteDataTypes to its own file. * WebKit2.xcodeproj/project.pbxproj: Add new files. Canonical link: https://commits.webkit.org/157309@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-09 20:29:59 +00:00
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS 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 APPLE INC. OR ITS 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.
*/
2016-09-27 19:08:34 +00:00
#pragma once
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
#include <initializer_list>
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
#include <iterator>
Remove <wtf/Optional.h> https://bugs.webkit.org/show_bug.cgi?id=226437 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Remove include of <wtf/Optional.h>. * inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py: (CppBackendDispatcherHeaderGenerator._generate_secondary_header_includes): Don't generate an include of wtf/Optional.h; including WTFString.h takes care of this anyway. * inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py: (CppFrontendDispatcherHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_secondary_header_includes): Ditto. * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator.generate_output): Generate an include of <optional> instead of <wtf/Optional.h>. * inspector/scripts/tests/expected/*: Regenerate. Source/WebCore: * <many files>: Removed include of <wtf/Optional.h>. * platform/graphics/Font.h: Tweaked style a bit. * Modules/geolocation/GeolocationClient.h: Added include of <optional>. * Modules/mediastream/DoubleRange.h: Ditto. * Modules/mediastream/LongRange.h: Ditto. * Modules/webauthn/AuthenticationExtensionsClientOutputs.h: Ditto. * css/CSSToLengthConversionData.h: Ditto. * css/DOMMatrix2DInit.h: Ditto. * dom/AddEventListenerOptions.h: Ditto. * dom/DeviceMotionData.h: Ditto. * dom/DeviceOrientationData.h: Ditto. * dom/SuccessOr.h: Ditto. * html/DateTimeFieldsState.h: Ditto. * html/ImageBitmapOptions.h: Ditto. * html/canvas/PredefinedColorSpace.h: Ditto. * layout/LayoutPhase.h: Ditto. * layout/MarginTypes.h: Ditto. * loader/ResourceLoadNotifier.h: Ditto. * page/RuntimeEnabledFeatures.h: Ditto. * page/ScrollOptions.h: Ditto. * platform/MediaCapabilitiesInfo.h: Ditto. * platform/cocoa/SystemBattery.h: Ditto. * platform/graphics/DecodingOptions.h: Ditto. * platform/graphics/DestinationColorSpace.h: Ditto. * platform/graphics/DisplayRefreshMonitorClient.h: Ditto. * platform/graphics/FloatLine.h: Ditto. * platform/graphics/gpu/GPURequestAdapterOptions.h: Ditto. * platform/graphics/x11/PlatformDisplayX11.h: Ditto. * platform/ios/SelectionGeometry.h: Ditto. * platform/mac/NSScrollerImpDetails.h: Ditto. * platform/network/DNS.h: Ditto. * platform/text/EncodingTables.h: Ditto. * platform/text/TextCodecCJK.h: Ditto. * platform/text/TextCodecUTF16.h: Ditto. * platform/text/TextFlags.h: Ditto. Source/WebCore/PAL: * pal/SessionID.h: Include <optional>. * pal/crypto/gcrypt/Utilities.h: Ditto. * pal/crypto/tasn1/Utilities.cpp: Removed include of <wtf/Optional.h>. Source/WebDriver: * SessionHost.h: Removed include of <wtf/Optional.h>. Source/WebKit: * <many files>: Removed include of <wtf/Optional.h>. Source/WebKitLegacy/mac: * DOM/DOMRangeInternal.h: Added import of <optional>. * WebView/WebGeolocationPosition.mm: Removed import of <wtf/Optional.h>. * WebView/WebGeolocationPositionInternal.h: Added import of <optional>. Source/WTF: * <many files>: Removed include of <wtf/Optional.h>. * WTF.xcodeproj/project.pbxproj: Removed Optional.h. * wtf/Markable.h: Added include of <optional>. * wtf/OptionSet.h: Ditto. * wtf/Optional.h: Emptied this file. On the Windows build system, we can't seem to build successfully without an empty file here. The copied forwarding header seems to linger even if we remove the original. Until we fix the Windows build system, if we want to support incremental builds, we need to keep this empty file around. * wtf/PrintStream.h: Added include of <optional>. * wtf/Seconds.h: Ditto. * wtf/StackTrace.h: Ditto. * wtf/StdLibExtras.h: Moved the valueOrCompute function here from Optional.h. Re-sorted the "using" at the bottom of the file. * wtf/URLHelpers.h: Added include of <optional>. * wtf/Vector.h: Ditto. Tools: * <many files>: Removed include of <wtf/Optional.h>. Canonical link: https://commits.webkit.org/238372@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-02 06:45:51 +00:00
#include <optional>
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
#include <type_traits>
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
#include <wtf/Assertions.h>
#include <wtf/EnumTraits.h>
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
#include <wtf/MathExtras.h>
Relanding "Make hasher work with tuple-like classes" https://bugs.webkit.org/show_bug.cgi?id=214224 Reviewed by Darin Adler. Source/WTF: The original patch broke the internal build. And reverting patch (r264274) broke the build too. This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix. * wtf/Hasher.h: (WTF::add): (WTF::addTupleLikeHelper): (WTF::TypeCheckHelper<decltype): Deleted. (WTF::addTupleHelper): Deleted. Add support for tuple-like classes. These are classes that: - Have defined specializations of std::tuple_size<> and std::tuple_element<>. - And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL. To avoid abiguity when hashing std::array, the add() overload enabled for containers with a begin member functions also now checks that the container is not tuple-like. The std::pair overload is no longer needed as it will use the tuple-like one now. * wtf/OptionSet.h: * wtf/StdLibExtras.h: Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to adhere to WebKit style as IsTypeComplete<>. Tools: * TestWebKitAPI/Tests/WTF/Hasher.cpp: (TestWebKitAPI::get): (TestWebKitAPI::HasherAddTupleLikeClass3::get const): (TestWebKitAPI::TEST): Update using new Color constructor for extended colors. Canonical link: https://commits.webkit.org/227042@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-12 09:47:05 +00:00
#include <wtf/StdLibExtras.h>
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
namespace WTF {
template<typename E> class OptionSet;
template<typename T, typename E> struct OptionSetValueChecker;
template<typename T, typename E, E e, E... es>
struct OptionSetValueChecker<T, EnumValues<E, e, es...>> {
static constexpr T allValidBits()
{
return static_cast<T>(e) | OptionSetValueChecker<T, EnumValues<E, es...>>::allValidBits();
}
static constexpr bool isValidOptionSetEnum(T t)
{
return (static_cast<T>(e) == t) ? true : OptionSetValueChecker<T, EnumValues<E, es...>>::isValidOptionSetEnum(t);
}
};
template<typename T, typename E>
struct OptionSetValueChecker<T, EnumValues<E>> {
static constexpr T allValidBits()
{
return 0;
}
static constexpr bool isValidOptionSetEnum(T)
{
return false;
}
};
Relanding "Make hasher work with tuple-like classes" https://bugs.webkit.org/show_bug.cgi?id=214224 Reviewed by Darin Adler. Source/WTF: The original patch broke the internal build. And reverting patch (r264274) broke the build too. This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix. * wtf/Hasher.h: (WTF::add): (WTF::addTupleLikeHelper): (WTF::TypeCheckHelper<decltype): Deleted. (WTF::addTupleHelper): Deleted. Add support for tuple-like classes. These are classes that: - Have defined specializations of std::tuple_size<> and std::tuple_element<>. - And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL. To avoid abiguity when hashing std::array, the add() overload enabled for containers with a begin member functions also now checks that the container is not tuple-like. The std::pair overload is no longer needed as it will use the tuple-like one now. * wtf/OptionSet.h: * wtf/StdLibExtras.h: Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to adhere to WebKit style as IsTypeComplete<>. Tools: * TestWebKitAPI/Tests/WTF/Hasher.cpp: (TestWebKitAPI::get): (TestWebKitAPI::HasherAddTupleLikeClass3::get const): (TestWebKitAPI::TEST): Update using new Color constructor for extended colors. Canonical link: https://commits.webkit.org/227042@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-12 09:47:05 +00:00
template<typename E, std::enable_if_t<std::is_enum<E>::value && IsTypeComplete<EnumTraits<E>>>* = nullptr>
constexpr bool isValidOptionSetEnum(E e)
{
return OptionSetValueChecker<std::underlying_type_t<E>, typename EnumTraits<E>::values>::isValidOptionSetEnum(static_cast<std::underlying_type_t<E>>(e));
}
Relanding "Make hasher work with tuple-like classes" https://bugs.webkit.org/show_bug.cgi?id=214224 Reviewed by Darin Adler. Source/WTF: The original patch broke the internal build. And reverting patch (r264274) broke the build too. This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix. * wtf/Hasher.h: (WTF::add): (WTF::addTupleLikeHelper): (WTF::TypeCheckHelper<decltype): Deleted. (WTF::addTupleHelper): Deleted. Add support for tuple-like classes. These are classes that: - Have defined specializations of std::tuple_size<> and std::tuple_element<>. - And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL. To avoid abiguity when hashing std::array, the add() overload enabled for containers with a begin member functions also now checks that the container is not tuple-like. The std::pair overload is no longer needed as it will use the tuple-like one now. * wtf/OptionSet.h: * wtf/StdLibExtras.h: Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to adhere to WebKit style as IsTypeComplete<>. Tools: * TestWebKitAPI/Tests/WTF/Hasher.cpp: (TestWebKitAPI::get): (TestWebKitAPI::HasherAddTupleLikeClass3::get const): (TestWebKitAPI::TEST): Update using new Color constructor for extended colors. Canonical link: https://commits.webkit.org/227042@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-12 09:47:05 +00:00
template<typename E, std::enable_if_t<std::is_enum<E>::value && !IsTypeComplete<EnumTraits<E>>>* = nullptr>
constexpr bool isValidOptionSetEnum(E e)
{
// FIXME: Remove once all OptionSet<> enums have EnumTraits<> defined.
return hasOneBitSet(static_cast<typename OptionSet<E>::StorageType>(e));
}
Relanding "Make hasher work with tuple-like classes" https://bugs.webkit.org/show_bug.cgi?id=214224 Reviewed by Darin Adler. Source/WTF: The original patch broke the internal build. And reverting patch (r264274) broke the build too. This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix. * wtf/Hasher.h: (WTF::add): (WTF::addTupleLikeHelper): (WTF::TypeCheckHelper<decltype): Deleted. (WTF::addTupleHelper): Deleted. Add support for tuple-like classes. These are classes that: - Have defined specializations of std::tuple_size<> and std::tuple_element<>. - And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL. To avoid abiguity when hashing std::array, the add() overload enabled for containers with a begin member functions also now checks that the container is not tuple-like. The std::pair overload is no longer needed as it will use the tuple-like one now. * wtf/OptionSet.h: * wtf/StdLibExtras.h: Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to adhere to WebKit style as IsTypeComplete<>. Tools: * TestWebKitAPI/Tests/WTF/Hasher.cpp: (TestWebKitAPI::get): (TestWebKitAPI::HasherAddTupleLikeClass3::get const): (TestWebKitAPI::TEST): Update using new Color constructor for extended colors. Canonical link: https://commits.webkit.org/227042@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-12 09:47:05 +00:00
template<typename E, std::enable_if_t<std::is_enum<E>::value && IsTypeComplete<EnumTraits<E>>>* = nullptr>
constexpr typename OptionSet<E>::StorageType maskRawValue(typename OptionSet<E>::StorageType rawValue)
{
auto allValidBitsValue = OptionSetValueChecker<std::underlying_type_t<E>, typename EnumTraits<E>::values>::allValidBits();
return rawValue & allValidBitsValue;
}
Relanding "Make hasher work with tuple-like classes" https://bugs.webkit.org/show_bug.cgi?id=214224 Reviewed by Darin Adler. Source/WTF: The original patch broke the internal build. And reverting patch (r264274) broke the build too. This patch relands r264270 with `constexpr` => `inline constexpr` template variable fix. * wtf/Hasher.h: (WTF::add): (WTF::addTupleLikeHelper): (WTF::TypeCheckHelper<decltype): Deleted. (WTF::addTupleHelper): Deleted. Add support for tuple-like classes. These are classes that: - Have defined specializations of std::tuple_size<> and std::tuple_element<>. - And have either a member function named get<> or there exists a function get<>() that takes the class as argument that can be looked up via ADL. To avoid abiguity when hashing std::array, the add() overload enabled for containers with a begin member functions also now checks that the container is not tuple-like. The std::pair overload is no longer needed as it will use the tuple-like one now. * wtf/OptionSet.h: * wtf/StdLibExtras.h: Move is_type_complete_v<> from OptionSet.h to StdLibExtras.h and rename to adhere to WebKit style as IsTypeComplete<>. Tools: * TestWebKitAPI/Tests/WTF/Hasher.cpp: (TestWebKitAPI::get): (TestWebKitAPI::HasherAddTupleLikeClass3::get const): (TestWebKitAPI::TEST): Update using new Color constructor for extended colors. Canonical link: https://commits.webkit.org/227042@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264277 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-12 09:47:05 +00:00
template<typename E, std::enable_if_t<std::is_enum<E>::value && !IsTypeComplete<EnumTraits<E>>>* = nullptr>
constexpr typename OptionSet<E>::StorageType maskRawValue(typename OptionSet<E>::StorageType rawValue)
{
// FIXME: Remove once all OptionSet<> enums have EnumTraits<> defined.
return rawValue;
}
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
// OptionSet is a class that represents a set of enumerators in a space-efficient manner. The enumerators
// must be powers of two greater than 0. This class is useful as a replacement for passing a bitmask of
// enumerators around.
template<typename E> class OptionSet {
[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;
static_assert(std::is_enum<E>::value, "T is not an enum type");
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
public:
using StorageType = std::make_unsigned_t<std::underlying_type_t<E>>;
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
template<typename StorageType> class Iterator {
[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;
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
public:
// Isolate the rightmost set bit.
E operator*() const { return static_cast<E>(m_value & -m_value); }
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
// Iterates from smallest to largest enum value by turning off the rightmost set bit.
Iterator& operator++()
{
m_value &= m_value - 1;
return *this;
}
Iterator& operator++(int) = delete;
bool operator==(const Iterator& other) const { return m_value == other.m_value; }
bool operator!=(const Iterator& other) const { return m_value != other.m_value; }
private:
Iterator(StorageType value) : m_value(value) { }
friend OptionSet;
StorageType m_value;
};
using iterator = Iterator<StorageType>;
static constexpr OptionSet fromRaw(StorageType rawValue)
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
{
return OptionSet(static_cast<E>(maskRawValue<E>(rawValue)), FromRawValue);
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
}
constexpr OptionSet() = default;
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
constexpr OptionSet(E e)
: m_storage(static_cast<StorageType>(e))
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
{
ASSERT(!m_storage || isValidOptionSetEnum(e));
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
}
constexpr OptionSet(std::initializer_list<E> initializerList)
{
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
for (auto& option : initializerList) {
ASSERT(isValidOptionSetEnum(option));
m_storage |= static_cast<StorageType>(option);
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
}
}
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
constexpr OptionSet(std::optional<E> optional)
Use OptionSet<DragOperation> for mask values <https://webkit.org/b/212605> Reviewed by Darin Adler. Source/WebCore: In broad strokes: - Replace use of DragOperation with OptionSet<DragOperation> or Optional<DragOperation>. - Rename function parameters and local variables to denote use of mask values. - Remove DragOperationNone enum value. - Replace DragOperationEvery enum value with anyDragOperation(). * dom/DataTransfer.cpp: (WebCore::DataTransfer::createForDrop): (WebCore::DataTransfer::createForUpdatingDropTarget): (WebCore::dragOpFromIEOp): (WebCore::IEOpFromDragOp): (WebCore::DataTransfer::sourceOperation const): Rename. (WebCore::DataTransfer::sourceOperationMask const): (WebCore::DataTransfer::destinationOperation const): Rename. (WebCore::DataTransfer::destinationOperationMask const): (WebCore::DataTransfer::setSourceOperation): Rename. (WebCore::DataTransfer::setSourceOperationMask): (WebCore::DataTransfer::setDestinationOperation): Rename. (WebCore::DataTransfer::setDestinationOperationMask): * dom/DataTransfer.h: (WebCore::DataTransfer::createForDrop): (WebCore::DataTransfer::createForUpdatingDropTarget): (WebCore::DataTransfer::sourceOperation const): Rename. (WebCore::DataTransfer::sourceOperationMask const): (WebCore::DataTransfer::destinationOperation const): Rename. (WebCore::DataTransfer::destinationOperationMask const): (WebCore::DataTransfer::setSourceOperation): Rename. (WebCore::DataTransfer::setSourceOperationMask): (WebCore::DataTransfer::setDestinationOperation): Rename. (WebCore::DataTransfer::setDestinationOperationMask): * page/DragActions.h: (WebCore::anyDragOperation): Add. (WTF::EnumTraits<WebCore::DragOperation>): Add. (WTF::OptionSet<WebCore::DragOperation>): Add. * page/DragController.cpp: (WebCore::DragController::dragEntered): (WebCore::DragController::dragUpdated): (WebCore::DragController::performDragOperation): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::operationForLoad): (WebCore::defaultOperationForDrag): (WebCore::DragController::tryDHTMLDrag): - Change logic to call defaultOperationForDrag() to convert targetResponse.operationMask to a single operation when targetResponse.operationMask but doesn't contain with any bit values set in sourceOperationMask. (WebCore::DragController::startDrag): * page/DragController.h: (WebCore::DragController::dragEntered): (WebCore::DragController::dragUpdated): (WebCore::DragController::sourceDragOperation const): Rename. (WebCore::DragController::sourceDragOperationMask const): (WebCore::DragController::startDrag): (WebCore::DragController::dragEnteredOrUpdated): (WebCore::DragController::operationForLoad): (WebCore::DragController::tryDocumentDrag): (WebCore::DragController::tryDHTMLDrag): (WebCore::DragController::dragOperation): * page/EventHandler.cpp: (WebCore::convertDropZoneOperationToDragOperation): (WebCore::convertDragOperationToDropZoneOperation): (WebCore::findDropZone): (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): (WebCore::EventHandler::updateDragAndDrop): (WebCore::EventHandler::cancelDragAndDrop): (WebCore::EventHandler::performDragAndDrop): (WebCore::EventHandler::dragSourceEndedAt): (WebCore::EventHandler::handleDrag): * page/EventHandler.h: (WebCore::EventHandler::updateDragAndDrop): (WebCore::EventHandler::cancelDragAndDrop): (WebCore::EventHandler::performDragAndDrop): (WebCore::EventHandler::dragSourceEndedAt): (WebCore::EventHandler::dispatchDragEnterOrDragOverEvent): * page/gtk/DragControllerGtk.cpp: (WebCore::DragController::dragOperation): * page/mac/DragControllerMac.mm: (WebCore::DragController::dragOperation): * page/win/DragControllerWin.cpp: (WebCore::DragController::dragOperation): - Clean up comment. * platform/DragData.cpp: (WebCore::DragData::DragData): * platform/DragData.h: (WebCore::DragData::DragData): (WebCore::DragData::draggingSourceOperationMask const): * platform/cocoa/DragDataCocoa.mm: (WebCore::DragData::DragData): * platform/gtk/GtkUtilities.cpp: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): * platform/gtk/GtkUtilities.h: (WebCore::gdkDragActionToDragOperation): (WebCore::dragOperationToGdkDragActions): (WebCore::dragOperationToSingleGdkDragAction): * platform/win/DragDataWin.cpp: (WebCore::DragData::DragData): Source/WebKit: In broad strokes: - Replace use of DragOperation with OptionSet<DragOperation> or Optional<DragOperation>. - Rename function parameters and local variables to denote use of mask values. - Remove DragOperationNone enum value. - Replace DragOperationEvery enum value with anyDragOperation(). * Platform/spi/ios/UIKitSPI.h: (UIDragOperation): - Remove unused (and misnamed) UIDragOperation enum typedef. * Scripts/webkit/messages.py: (types_that_cannot_be_forward_declared): (headers_for_type): - Add support for WebCore::DragOperation enum. * Shared/API/Cocoa/_WKDragActionsInternal.h: (WebKit::coreDragOperationMask): Add conversion function. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<DragData>::encode): (IPC::ArgumentCoder<DragData>::decode): - Update to encode/decode OptionSet<DragOperation>. * UIProcess/API/gtk/DragSource.h: (WebKit::DragSource::begin): * UIProcess/API/gtk/DragSourceGtk3.cpp: (WebKit::DragSource::begin): * UIProcess/API/gtk/DragSourceGtk4.cpp: (WebKit::DragSource::begin): * UIProcess/API/gtk/DropTarget.h: * UIProcess/API/gtk/DropTargetGtk3.cpp: (WebKit::DropTarget::didPerformAction): (WebKit::DropTarget::leaveTimerFired): * UIProcess/API/gtk/DropTargetGtk4.cpp: (WebKit::DropTarget::DropTarget): (WebKit::DropTarget::didPerformAction): * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::startDrag): * UIProcess/API/gtk/PageClientImpl.h: (WebKit::PageClientImpl::startDrag): * UIProcess/API/gtk/WebKitWebViewBase.cpp: (webkitWebViewBaseStartDrag): * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: (webkitWebViewBaseStartDrag): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::sendDragEndToPage): (WebKit::WebViewImpl::draggingEntered): (WebKit::kit): Add conversion function. (WebKit::WebViewImpl::draggingUpdated): (WebKit::WebViewImpl::draggingExited): (WebKit::WebViewImpl::performDragOperation): - Make use of coreDragOperationMask() conversion function. * UIProcess/PageClient.h: (WebKit::WebViewImpl::startDrag): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): - Remove MESSAGE_CHECK now that we're using the actual type. (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::dragEnded): (WebKit::WebPageProxy::resetCurrentDragInformation): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::dragEnded): (WebKit::WebPageProxy::startDrag): (WebKit::WebPageProxy::currentDragOperation const): * UIProcess/WebPageProxy.messages.in: (WebPageProxy::DidPerformDragControllerAction): (WebPageProxy::StartDrag): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _didHandleDragStartRequest:]): (dropOperationForWebCoreDragOperation): (coreDragOperationForUIDropOperation): Add conversion function. - Note that this was not being converted from UIDropOperation to WebCore::DragOperation previously, and UIDropOperationMove (0x3) was not being properly converted to DragOperationMove (0x16). (-[WKContentView dragDataForDropSession:dragDestinationAction:]): (-[WKContentView _didPerformDragOperation:]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): (-[WKContentView dragInteraction:session:didEndWithOperation:]): (-[WKContentView dropInteraction:sessionDidEnd:]): * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp: (WebKit::WebDragClient::startDrag): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): (WebKit::WebPage::dragEnded): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::performDragControllerAction): (WebKit::WebPage::dragEnded): * WebProcess/WebPage/WebPage.messages.in: (WebPage::PerformDragControllerAction): (WebPage::DragEnded): * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestAdditionalItemsForDragSession): Source/WebKitLegacy/mac: In broad strokes: - Replace use of DragOperation with OptionSet<DragOperation> or Optional<DragOperation>. - Rename function parameters and local variables to denote use of mask values. - Remove DragOperationNone enum value. - Replace DragOperationEvery enum value with anyDragOperation(). * WebView/WebFrame.mm: (-[WebFrame _dragSourceEndedAt:operation:]): * WebView/WebHTMLView.mm: (kit): Add conversion function. (-[WebHTMLView draggingSourceOperationMaskForLocal:]): (-[WebHTMLView draggingSession:sourceOperationMaskForDraggingContext:]): * WebView/WebView.mm: (coreDragOperationMask): Add conversion function. (kit): Ditto. - Map WebCore::DragOperationGeneric to _UIDragOperationMove based on logic in WebCore. All other WebCore::DragOperation enum values map to _UIDragOperationNone. (-[WebView dragDataForSession:client:global:operation:]): (-[WebView _enteredDataInteraction:client:global:operation:]): (-[WebView _updatedDataInteraction:client:global:operation:]): (-[WebView draggingEntered:]): (-[WebView draggingUpdated:]): (-[WebView draggingExited:]): (-[WebView performDragOperation:]): * WebView/WebViewInternal.h: (CocoaDragOperation): - Add typedef so coreDragOperationMask() may be shared across platforms. (coreDragOperationMask): Add declaration. (coreOptions): - Remove redundant parameter name. Source/WebKitLegacy/win: In broad strokes: - Replace use of DragOperation with OptionSet<DragOperation> or Optional<DragOperation>. - Rename function parameters and local variables to denote use of mask values. - Remove DragOperationNone enum value. - Replace DragOperationEvery enum value with anyDragOperation(). * WebCoreSupport/WebDragClient.cpp: (draggingSourceOperationMaskToDragCursors): (WebDragClient::startDrag): * WebView.cpp: (dragOperationToDragCursor): (WebView::keyStateToDragOperation const): (WebView::DragLeave): * WebView.h: (WebView::keyStateToDragOperation const): Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): - Add constructor for OptionSet(Optional). Canonical link: https://commits.webkit.org/225679@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-06 15:17:30 +00:00
: m_storage(optional ? static_cast<StorageType>(*optional) : 0)
{
}
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
constexpr StorageType toRaw() const { return m_storage; }
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
constexpr bool isEmpty() const { return !m_storage; }
constexpr iterator begin() const { return m_storage; }
constexpr iterator end() const { return 0; }
constexpr explicit operator bool() { return !isEmpty(); }
constexpr bool contains(E option) const
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
{
return containsAny(option);
}
constexpr bool containsAny(OptionSet optionSet) const
{
return !!(*this & optionSet);
}
constexpr bool containsAll(OptionSet optionSet) const
{
return (*this & optionSet) == optionSet;
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
}
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
constexpr void add(OptionSet optionSet)
2016-09-27 19:08:34 +00:00
{
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
m_storage |= optionSet.m_storage;
2016-09-27 19:08:34 +00:00
}
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
constexpr void remove(OptionSet optionSet)
2016-09-27 19:08:34 +00:00
{
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
m_storage &= ~optionSet.m_storage;
2016-09-27 19:08:34 +00:00
}
Node flags should be an OptionSet https://bugs.webkit.org/show_bug.cgi?id=216305 Reviewed by Antti Koivisto. Source/WebCore: This patch renames NodeFlags to NodeFlag and turns into an enum class and changes the type of m_nodeFlags from uint32_t to OptionSet<NodeFlag> as there is no state stored there after r266769. This patch also introduces two new NodeFlag for identifying CharacterData and DocumentFragment to simplify the type check conditions for these nodes now that we have plenty of free bits. No new tests since there should be no behavioral change. * dom/CharacterData.h: (WebCore::CharacterData::CharacterData): Sets NodeFlag::IsContainerNode via CreateCharacterData. (WebCore::CharacterData::virtualIsCharacterData): Deleted. * dom/Comment.cpp: (WebCore::Comment::Comment): Ditto. * dom/Element.cpp: (WebCore::Element::setHasFocusWithin): (WebCore::Element::removedFromAncestor): (WebCore::Element::setContainsFullScreenElement): (WebCore::Element::createElementIdentifier): * dom/Element.h: (WebCore::Element::hasFocusWithin const): (WebCore::Element::hasPendingResources const): (WebCore::Element::setHasPendingResources): (WebCore::Element::clearHasPendingResources): (WebCore::Element::hasCSSAnimation const): (WebCore::Element::setHasCSSAnimation): (WebCore::Element::clearHasCSSAnimation): (WebCore::Element::containsFullScreenElement const): * dom/Node.cpp: (WebCore::Node::insertedIntoAncestor): (WebCore::Node::removedFromAncestor): * dom/Node.h: (WebCore::Node::isElementNode const): (WebCore::Node::isContainerNode const): (WebCore::Node::isTextNode const): (WebCore::Node::isHTMLElement const): (WebCore::Node::isSVGElement const): (WebCore::Node::isMathMLElement const): (WebCore::Node::isStyledElement const): (WebCore::Node::isCharacterDataNode const): Check the newly added NodeFlag::IsContainerNode. (WebCore::Node::isDocumentNode const): (WebCore::Node::isTreeScope const): (WebCore::Node::isDocumentFragment const):: Check the newly added NodeFlag::IsDocumentFragment. (WebCore::Node::isShadowRoot const): (WebCore::Node::hasCustomStyleResolveCallbacks const): (WebCore::Node::hasSyntheticAttrChildNodes const): (WebCore::Node::setHasSyntheticAttrChildNodes): (WebCore::Node::selfOrAncestorHasDirAutoAttribute const): (WebCore::Node::setSelfOrAncestorHasDirAutoAttribute): (WebCore::Node::isUserActionElement const): (WebCore::Node::setUserActionElement): (WebCore::Node::isEditingText const): Removed the check for IsTextFlag since this is no longer needed after r266769 as no longer share the bit for IsEditingText with an unknown custom element. (WebCore::Node::isLink const): (WebCore::Node::setIsLink): (WebCore::Node::hasEventTargetData const): (WebCore::Node::setHasEventTargetData): (WebCore::Node::isConnected const): (WebCore::Node::isInShadowTree const): (WebCore::Node::isInTreeScope const): (WebCore::Node::flagIsText): (WebCore::Node::flagIsContainer): (WebCore::Node::flagIsElement): (WebCore::Node::flagIsShadowRoot): (WebCore::Node::flagIsHTML): (WebCore::Node::flagIsLink): (WebCore::Node::flagHasFocusWithin): (WebCore::Node::flagIsParsingChildrenFinished): (WebCore::Node::NodeFlag): Renamed from NodeFlags and made it an enum class, and introduced IsCharacterData and IsDocumentFragment and removed "Flag" suffix from various flags. (WebCore::Node::hasNodeFlag const): Renamed from getFlag for clarity. (WebCore::Node::setNodeFlag const): Ditto from setFlag. Also merge the two versions of setFlag one of which took a boolean arugment as the first argument by making this a second optional argument. (WebCore::Node::clearNodeFlag const): Ditto. (WebCore::Node::isParsingChildrenFinished const): (WebCore::Node::setIsParsingChildrenFinished): (WebCore::Node::clearIsParsingChildrenFinished): (WebCore::Node::ConstructionType): This is now an alias to OptionSet<NodeFlag> instead of a separate enum. (WebCore::Node::setHasCustomStyleResolveCallbacks): (WebCore::Node::virtualIsCharacterData const): Deleted. * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::ProcessingInstruction): Sets NodeFlag::IsContainerNode via CharacterData's constructor's default argument value. Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::set): Added. Canonical link: https://commits.webkit.org/229140@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-09 09:03:48 +00:00
constexpr void set(OptionSet optionSet, bool value)
{
if (value)
add(optionSet);
else
remove(optionSet);
Node flags should be an OptionSet https://bugs.webkit.org/show_bug.cgi?id=216305 Reviewed by Antti Koivisto. Source/WebCore: This patch renames NodeFlags to NodeFlag and turns into an enum class and changes the type of m_nodeFlags from uint32_t to OptionSet<NodeFlag> as there is no state stored there after r266769. This patch also introduces two new NodeFlag for identifying CharacterData and DocumentFragment to simplify the type check conditions for these nodes now that we have plenty of free bits. No new tests since there should be no behavioral change. * dom/CharacterData.h: (WebCore::CharacterData::CharacterData): Sets NodeFlag::IsContainerNode via CreateCharacterData. (WebCore::CharacterData::virtualIsCharacterData): Deleted. * dom/Comment.cpp: (WebCore::Comment::Comment): Ditto. * dom/Element.cpp: (WebCore::Element::setHasFocusWithin): (WebCore::Element::removedFromAncestor): (WebCore::Element::setContainsFullScreenElement): (WebCore::Element::createElementIdentifier): * dom/Element.h: (WebCore::Element::hasFocusWithin const): (WebCore::Element::hasPendingResources const): (WebCore::Element::setHasPendingResources): (WebCore::Element::clearHasPendingResources): (WebCore::Element::hasCSSAnimation const): (WebCore::Element::setHasCSSAnimation): (WebCore::Element::clearHasCSSAnimation): (WebCore::Element::containsFullScreenElement const): * dom/Node.cpp: (WebCore::Node::insertedIntoAncestor): (WebCore::Node::removedFromAncestor): * dom/Node.h: (WebCore::Node::isElementNode const): (WebCore::Node::isContainerNode const): (WebCore::Node::isTextNode const): (WebCore::Node::isHTMLElement const): (WebCore::Node::isSVGElement const): (WebCore::Node::isMathMLElement const): (WebCore::Node::isStyledElement const): (WebCore::Node::isCharacterDataNode const): Check the newly added NodeFlag::IsContainerNode. (WebCore::Node::isDocumentNode const): (WebCore::Node::isTreeScope const): (WebCore::Node::isDocumentFragment const):: Check the newly added NodeFlag::IsDocumentFragment. (WebCore::Node::isShadowRoot const): (WebCore::Node::hasCustomStyleResolveCallbacks const): (WebCore::Node::hasSyntheticAttrChildNodes const): (WebCore::Node::setHasSyntheticAttrChildNodes): (WebCore::Node::selfOrAncestorHasDirAutoAttribute const): (WebCore::Node::setSelfOrAncestorHasDirAutoAttribute): (WebCore::Node::isUserActionElement const): (WebCore::Node::setUserActionElement): (WebCore::Node::isEditingText const): Removed the check for IsTextFlag since this is no longer needed after r266769 as no longer share the bit for IsEditingText with an unknown custom element. (WebCore::Node::isLink const): (WebCore::Node::setIsLink): (WebCore::Node::hasEventTargetData const): (WebCore::Node::setHasEventTargetData): (WebCore::Node::isConnected const): (WebCore::Node::isInShadowTree const): (WebCore::Node::isInTreeScope const): (WebCore::Node::flagIsText): (WebCore::Node::flagIsContainer): (WebCore::Node::flagIsElement): (WebCore::Node::flagIsShadowRoot): (WebCore::Node::flagIsHTML): (WebCore::Node::flagIsLink): (WebCore::Node::flagHasFocusWithin): (WebCore::Node::flagIsParsingChildrenFinished): (WebCore::Node::NodeFlag): Renamed from NodeFlags and made it an enum class, and introduced IsCharacterData and IsDocumentFragment and removed "Flag" suffix from various flags. (WebCore::Node::hasNodeFlag const): Renamed from getFlag for clarity. (WebCore::Node::setNodeFlag const): Ditto from setFlag. Also merge the two versions of setFlag one of which took a boolean arugment as the first argument by making this a second optional argument. (WebCore::Node::clearNodeFlag const): Ditto. (WebCore::Node::isParsingChildrenFinished const): (WebCore::Node::setIsParsingChildrenFinished): (WebCore::Node::clearIsParsingChildrenFinished): (WebCore::Node::ConstructionType): This is now an alias to OptionSet<NodeFlag> instead of a separate enum. (WebCore::Node::setHasCustomStyleResolveCallbacks): (WebCore::Node::virtualIsCharacterData const): Deleted. * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::ProcessingInstruction): Sets NodeFlag::IsContainerNode via CharacterData's constructor's default argument value. Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::set): Added. Canonical link: https://commits.webkit.org/229140@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266776 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-09 09:03:48 +00:00
}
[IPC] Adopt enum class for DragSourceAction <https://webkit.org/b/212885> <rdar://problem/64094134> Reviewed by Darin Adler. Source/WebCore: Summary: - Convert DragSourceAction to enum class. - Remove DragSourceActionNone by using Optional<> and OptionSet<> (as dictated by how the code used the value). - Remove DragSourceActionAny and replace (as needed) with anyDragSourceAction(). (Some--but not all--uses were removed.) - Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for DragSourceAction since both Optional<> and OptionSet<> are used with IPC. * loader/EmptyClients.cpp: * page/DragActions.h: (WebCore::DragSourceAction): - Convert to enum class. (WebCore::anyDragSourceAction): Add. - Replaces WebCore::DragSourceActionAny. (WTF::EnumTraits<WebCore::DragSourceAction>): Add. (WTF::OptionSetTraits<WebCore::DragSourceAction>): Add. * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::delegateDragSourceAction): (WebCore::DragController::draggableElement const): (WebCore::DragController::prepareForDragStart const): (WebCore::DragController::startDrag): (WebCore::DragController::doSystemDrag): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. * page/DragController.h: (WebCore::DragController::dragSourceAction const): * page/DragState.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateDragSourceActionsAllowed const): (WebCore::EventHandler::dragHysteresisExceeded const): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. - Remove case statements for DragSourceActionNone and DragSourceActionAny, along with ASSERT_NOT_REACHED(). The ASSERT() for toSingleValue() replaces the DragSourceActionNone case. (WebCore::EventHandler::didStartDrag): (WebCore::ExactlyOneBitSet): Delete. - Move to WTF::OptionSet<>::hasExactlyOneBitSet(). (WebCore::EventHandler::handleDrag): - Add code to #ifndef NDEBUG/#endif instead of modifying dragState().type in-place since it seemed weird to modify it just to check an ASSERT(), even though it was overwritten immediately after that. * page/EventHandler.h: * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): - Stop using decodeEnum()/encodeEnum() with Optional<DragSourceAction>. Source/WebKit: Summary: - Convert argument parameters from uint64_t to OptionSet<DragSourceAction>. - Convert DragSourceAction to OptionSet<DragSourceAction>. * Scripts/webkit/messages.py: - Map DragSourceAction enum to DragActions.h header. * UIProcess/WebPageProxy.h: * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::shouldUseDragImageToCreatePreviewForDragSource): (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource): (WebKit::canUpdatePreviewForActiveDragSource): (WebKit::DragDropInteractionState::anyActiveDragSourceIs const): (WebKit::DragDropInteractionState::stageDragItem): (WebKit::DragDropInteractionState::hasStagedDragSource const): (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView _allowedDragSourceActions]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::requestDragStart): (WebKit::WebPageProxy::requestAdditionalItemsForDragSession): * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::dragSourceActionMaskForPoint): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::allowedDragSourceActions const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDragStart): (WebKit::WebPage::requestAdditionalItemsForDragSession): Source/WebKitLegacy/mac: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (coreDragSourceActionMask): Add. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebView/WebView.mm: (kit): Add. - Convert from Optional<WebCore::DragSourceAction> to WebDragSourceAction. (-[WebView _startDrag:]): * WebView/WebViewInternal.h: (kit): Add declaration to reuse function in WebDragClient.mm. Source/WebKitLegacy/win: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.cpp: (coreDragSourceActionMask): Add. (kit): Add. - Convert from WebCore::DragSourceAction to WebDragSourceAction. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebCoreSupport/WebDragClient.h: (WebDragClient::dragSourceActionMaskForPoint): Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::hasExactlyOneBitSet const): Add. - Move here from WebCore::ExactlyOneBitSet() in Source/WebCore/page/EventHandler.cpp. (WTF::OptionSet::toSingleValue const): Add. - Use hasExactlyOneBitSet() to determine whether exactly one enum bitmask value can be returned. Canonical link: https://commits.webkit.org/225870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-11 18:54:13 +00:00
constexpr bool hasExactlyOneBitSet() const
{
return m_storage && !(m_storage & (m_storage - 1));
}
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
constexpr std::optional<E> toSingleValue() const
[IPC] Adopt enum class for DragSourceAction <https://webkit.org/b/212885> <rdar://problem/64094134> Reviewed by Darin Adler. Source/WebCore: Summary: - Convert DragSourceAction to enum class. - Remove DragSourceActionNone by using Optional<> and OptionSet<> (as dictated by how the code used the value). - Remove DragSourceActionAny and replace (as needed) with anyDragSourceAction(). (Some--but not all--uses were removed.) - Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for DragSourceAction since both Optional<> and OptionSet<> are used with IPC. * loader/EmptyClients.cpp: * page/DragActions.h: (WebCore::DragSourceAction): - Convert to enum class. (WebCore::anyDragSourceAction): Add. - Replaces WebCore::DragSourceActionAny. (WTF::EnumTraits<WebCore::DragSourceAction>): Add. (WTF::OptionSetTraits<WebCore::DragSourceAction>): Add. * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::delegateDragSourceAction): (WebCore::DragController::draggableElement const): (WebCore::DragController::prepareForDragStart const): (WebCore::DragController::startDrag): (WebCore::DragController::doSystemDrag): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. * page/DragController.h: (WebCore::DragController::dragSourceAction const): * page/DragState.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateDragSourceActionsAllowed const): (WebCore::EventHandler::dragHysteresisExceeded const): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. - Remove case statements for DragSourceActionNone and DragSourceActionAny, along with ASSERT_NOT_REACHED(). The ASSERT() for toSingleValue() replaces the DragSourceActionNone case. (WebCore::EventHandler::didStartDrag): (WebCore::ExactlyOneBitSet): Delete. - Move to WTF::OptionSet<>::hasExactlyOneBitSet(). (WebCore::EventHandler::handleDrag): - Add code to #ifndef NDEBUG/#endif instead of modifying dragState().type in-place since it seemed weird to modify it just to check an ASSERT(), even though it was overwritten immediately after that. * page/EventHandler.h: * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): - Stop using decodeEnum()/encodeEnum() with Optional<DragSourceAction>. Source/WebKit: Summary: - Convert argument parameters from uint64_t to OptionSet<DragSourceAction>. - Convert DragSourceAction to OptionSet<DragSourceAction>. * Scripts/webkit/messages.py: - Map DragSourceAction enum to DragActions.h header. * UIProcess/WebPageProxy.h: * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::shouldUseDragImageToCreatePreviewForDragSource): (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource): (WebKit::canUpdatePreviewForActiveDragSource): (WebKit::DragDropInteractionState::anyActiveDragSourceIs const): (WebKit::DragDropInteractionState::stageDragItem): (WebKit::DragDropInteractionState::hasStagedDragSource const): (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView _allowedDragSourceActions]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::requestDragStart): (WebKit::WebPageProxy::requestAdditionalItemsForDragSession): * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::dragSourceActionMaskForPoint): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::allowedDragSourceActions const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDragStart): (WebKit::WebPage::requestAdditionalItemsForDragSession): Source/WebKitLegacy/mac: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (coreDragSourceActionMask): Add. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebView/WebView.mm: (kit): Add. - Convert from Optional<WebCore::DragSourceAction> to WebDragSourceAction. (-[WebView _startDrag:]): * WebView/WebViewInternal.h: (kit): Add declaration to reuse function in WebDragClient.mm. Source/WebKitLegacy/win: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.cpp: (coreDragSourceActionMask): Add. (kit): Add. - Convert from WebCore::DragSourceAction to WebDragSourceAction. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebCoreSupport/WebDragClient.h: (WebDragClient::dragSourceActionMaskForPoint): Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::hasExactlyOneBitSet const): Add. - Move here from WebCore::ExactlyOneBitSet() in Source/WebCore/page/EventHandler.cpp. (WTF::OptionSet::toSingleValue const): Add. - Use hasExactlyOneBitSet() to determine whether exactly one enum bitmask value can be returned. Canonical link: https://commits.webkit.org/225870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-11 18:54:13 +00:00
{
Remove WTF::Optional synonym for std::optional, using that class template directly instead https://bugs.webkit.org/show_bug.cgi?id=226433 Reviewed by Chris Dumez. Source/JavaScriptCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): Use auto instead of Optional<>. Also use * instead of value() and nest the definition of the local inside an if statement in the case where it's an optional. * inspector/scripts/tests/expected/*: Regenerated these results. Source/WebCore: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebCore/PAL: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebDriver: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKit: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * Scripts/webkit/tests: Regenerated expected results, by running the command "python Scripts/webkit/messages_unittest.py -r". (How am I supposed to know to do that?) Source/WebKitLegacy/ios: * WebCoreSupport/WebChromeClientIOS.h: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/mac: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WebKitLegacy/win: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Source/WTF: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. * wtf/Optional.h: Remove WTF::Optional. Tools: * <many files>: Let the do-webcore-rename script rename Optional<> to std::optional<>. Canonical link: https://commits.webkit.org/238290@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-30 16:11:40 +00:00
return hasExactlyOneBitSet() ? std::optional<E>(static_cast<E>(m_storage)) : std::nullopt;
[IPC] Adopt enum class for DragSourceAction <https://webkit.org/b/212885> <rdar://problem/64094134> Reviewed by Darin Adler. Source/WebCore: Summary: - Convert DragSourceAction to enum class. - Remove DragSourceActionNone by using Optional<> and OptionSet<> (as dictated by how the code used the value). - Remove DragSourceActionAny and replace (as needed) with anyDragSourceAction(). (Some--but not all--uses were removed.) - Add both WTF::EnumTraits<> and WTF::OptionSetTraits<> for DragSourceAction since both Optional<> and OptionSet<> are used with IPC. * loader/EmptyClients.cpp: * page/DragActions.h: (WebCore::DragSourceAction): - Convert to enum class. (WebCore::anyDragSourceAction): Add. - Replaces WebCore::DragSourceActionAny. (WTF::EnumTraits<WebCore::DragSourceAction>): Add. (WTF::OptionSetTraits<WebCore::DragSourceAction>): Add. * page/DragClient.h: * page/DragController.cpp: (WebCore::DragController::delegateDragSourceAction): (WebCore::DragController::draggableElement const): (WebCore::DragController::prepareForDragStart const): (WebCore::DragController::startDrag): (WebCore::DragController::doSystemDrag): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. * page/DragController.h: (WebCore::DragController::dragSourceAction const): * page/DragState.h: * page/EventHandler.cpp: (WebCore::EventHandler::updateDragSourceActionsAllowed const): (WebCore::EventHandler::dragHysteresisExceeded const): - Use OptionSet<>::toSingleValue() and add ASSERT() that it does not return WTF::nullopt. - Remove case statements for DragSourceActionNone and DragSourceActionAny, along with ASSERT_NOT_REACHED(). The ASSERT() for toSingleValue() replaces the DragSourceActionNone case. (WebCore::EventHandler::didStartDrag): (WebCore::ExactlyOneBitSet): Delete. - Move to WTF::OptionSet<>::hasExactlyOneBitSet(). (WebCore::EventHandler::handleDrag): - Add code to #ifndef NDEBUG/#endif instead of modifying dragState().type in-place since it seemed weird to modify it just to check an ASSERT(), even though it was overwritten immediately after that. * page/EventHandler.h: * platform/DragItem.h: (WebCore::DragItem::encode const): (WebCore::DragItem::decode): - Stop using decodeEnum()/encodeEnum() with Optional<DragSourceAction>. Source/WebKit: Summary: - Convert argument parameters from uint64_t to OptionSet<DragSourceAction>. - Convert DragSourceAction to OptionSet<DragSourceAction>. * Scripts/webkit/messages.py: - Map DragSourceAction enum to DragActions.h header. * UIProcess/WebPageProxy.h: * UIProcess/ios/DragDropInteractionState.h: * UIProcess/ios/DragDropInteractionState.mm: (WebKit::shouldUseDragImageToCreatePreviewForDragSource): (WebKit::shouldUseVisiblePathToCreatePreviewForDragSource): (WebKit::shouldUseTextIndicatorToCreatePreviewForDragSource): (WebKit::canUpdatePreviewForActiveDragSource): (WebKit::DragDropInteractionState::anyActiveDragSourceIs const): (WebKit::DragDropInteractionState::stageDragItem): (WebKit::DragDropInteractionState::hasStagedDragSource const): (WebKit::DragDropInteractionState::updatePreviewsForActiveDragSources): * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView _startDrag:item:]): (-[WKContentView _allowedDragSourceActions]): (-[WKContentView dragInteraction:willAnimateLiftWithAnimator:session:]): * UIProcess/ios/WebPageProxyIOS.mm: (WebKit::WebPageProxy::requestDragStart): (WebKit::WebPageProxy::requestAdditionalItemsForDragSession): * WebProcess/WebCoreSupport/WebDragClient.cpp: (WebKit::WebDragClient::dragSourceActionMaskForPoint): * WebProcess/WebCoreSupport/WebDragClient.h: * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::allowedDragSourceActions const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::requestDragStart): (WebKit::WebPage::requestAdditionalItemsForDragSession): Source/WebKitLegacy/mac: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.h: * WebCoreSupport/WebDragClient.mm: (coreDragSourceActionMask): Add. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebView/WebView.mm: (kit): Add. - Convert from Optional<WebCore::DragSourceAction> to WebDragSourceAction. (-[WebView _startDrag:]): * WebView/WebViewInternal.h: (kit): Add declaration to reuse function in WebDragClient.mm. Source/WebKitLegacy/win: Summary: - Add and use conversion functions between OptionSet<WebCore::DragSourceAction> and WebDragSourceAction. - Update method signatures. * WebCoreSupport/WebDragClient.cpp: (coreDragSourceActionMask): Add. (kit): Add. - Convert from WebCore::DragSourceAction to WebDragSourceAction. (WebDragClient::dragSourceActionMaskForPoint): (WebDragClient::willPerformDragSourceAction): (WebDragClient::startDrag): * WebCoreSupport/WebDragClient.h: (WebDragClient::dragSourceActionMaskForPoint): Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::hasExactlyOneBitSet const): Add. - Move here from WebCore::ExactlyOneBitSet() in Source/WebCore/page/EventHandler.cpp. (WTF::OptionSet::toSingleValue const): Add. - Use hasExactlyOneBitSet() to determine whether exactly one enum bitmask value can be returned. Canonical link: https://commits.webkit.org/225870@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-11 18:54:13 +00:00
}
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
constexpr friend bool operator==(OptionSet lhs, OptionSet rhs)
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
{
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
return lhs.m_storage == rhs.m_storage;
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
}
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
constexpr friend bool operator!=(OptionSet lhs, OptionSet rhs)
[iOS] Throttle requestAnimationFrame to 30fps in low power mode https://bugs.webkit.org/show_bug.cgi?id=168837 <rdar://problem/30700929> Reviewed by Simon Fraser. Source/WebCore: Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery. ScriptedAnimationController now maintains an OptionSet of throttling reasons. Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode. The requestAnimationFrame interval is then determined based on those throttling reasons: - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling) - LowPowerMode: 30fps - No reasons: 60fps The Page now keeps track of low power mode state using a LowPowerModeNotifier. Whenever low power mode changes, it updates the throttling reasons in all the documents' ScriptedAnimationControllers in the frame tree. Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html fast/animation/request-animation-frame-throttling-lowPowerMode.html * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::throttlingReasonToString): (WebCore::throttlingReasonsToString): (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): (WebCore::ScriptedAnimationController::isThrottled): (WebCore::ScriptedAnimationController::interval): (WebCore::ScriptedAnimationController::page): (WebCore::ScriptedAnimationController::scheduleAnimation): * dom/ScriptedAnimationController.h: (WebCore::ScriptedAnimationController::create): * page/FrameView.cpp: (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::isLowPowerModeEnabled): (WebCore::Page::setLowPowerModeEnabledOverrideForTesting): (WebCore::updateScriptedAnimationsThrottlingReason): (WebCore::Page::setIsVisuallyIdleInternal): (WebCore::Page::handleLowModePowerChange): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::requestAnimationFrameInterval): (WebCore::Internals::setLowPowerModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Add support for operator -= on WTF::OptionSet for convenience: set -= Enum::A; looks much better than: set = set - Enum::A; * wtf/OptionSet.h: (WTF::OptionSet::operator-=): Tools: Add unit test for -= operator on WTF::OptionSet. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): LayoutTests: Add layout test coverage. * fast/animation/request-animation-frame-throttling-detached-iframe-expected.txt: Added. * fast/animation/request-animation-frame-throttling-detached-iframe.html: Added. * fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt: Added. * fast/animation/request-animation-frame-throttling-lowPowerMode.html: Added. * fast/animation/resources/frame-with-animation.html: Added. Canonical link: https://commits.webkit.org/185972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 21:26:27 +00:00
{
Replace OptionSet |= and -= operators with add() and remove() functions https://bugs.webkit.org/show_bug.cgi?id=189169 Reviewed by Anders Carlsson. Source/WebCore: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextDecoration): (WebCore::StyleBuilderConverter::convertTextEmphasisPosition): (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextDecorationSkip): (WebCore::StyleBuilderConverter::convertSpeakAs): (WebCore::StyleBuilderConverter::convertHangingPunctuation): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseSystemColor): * dom/Document.cpp: (WebCore::Document::styleColorOptions const): * dom/DocumentMarkerController.cpp: (WebCore::DocumentMarkerController::addMarker): (WebCore::DocumentMarkerController::removeMarkers): * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): * dom/SecurityContext.h: (WebCore::SecurityContext::setFoundMixedContent): * dom/UIEventWithKeyState.cpp: (WebCore::UIEventWithKeyState::modifiersFromInitializer): (WebCore::UIEventWithKeyState::setModifierKeys): * dom/UserActionElementSet.cpp: (WebCore::UserActionElementSet::setFlags): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::appliedEditing): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsAndBadGrammar): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/FrameSelection.cpp: (WebCore::FrameSelection::moveWithoutValidationTo): (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: (WebCore::FrameSelection::defaultSetSelectionOptions): * editing/MoveSelectionCommand.cpp: (WebCore::MoveSelectionCommand::doApply): * editing/SpellChecker.cpp: (WebCore::SpellChecker::didCheckSucceed): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const): * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::reload): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): * page/DragController.cpp: (WebCore::DragController::concludeEditDrag): * page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip): * page/FrameView.cpp: (WebCore::updateLayerPositionFlags): (WebCore::FrameView::willPaintContents): * page/Page.cpp: (WebCore::Page::setIsVisible): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::observe): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): * page/WindowFeatures.cpp: (WebCore::parseDisabledAdaptations): * page/csp/ContentSecurityPolicy.h: (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): * page/csp/ContentSecurityPolicySourceList.cpp: (WebCore::ContentSecurityPolicySourceList::parseHashSource): * platform/PlatformEvent.h: (WebCore::PlatformEvent::PlatformEvent): * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::modifiersForEvent): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateLayerPositionsAfterScroll): (WebCore::RenderLayer::paintLayer): (WebCore::RenderLayer::paintLayerContentsAndReflection): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintForegroundForFragments): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer): (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): * rendering/TextDecorationPainter.cpp: (WebCore::collectStylesForRenderer): * rendering/TextPaintStyle.cpp: (WebCore::computeTextPaintStyle): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::RenderStyle::changeRequiresRepaint const): * testing/Internals.cpp: (WebCore::parseFindOptions): (WebCore::Internals::forceReload): (WebCore::Internals::setPageVisibility): (WebCore::Internals::setPageIsFocusedAndActive): Source/WebKit: * NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged): * Shared/WebEventConversion.cpp: (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): (WebKit::WebKit2PlatformWheelEvent::WebKit2PlatformWheelEvent): (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent): (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent): (WebKit::WebKit2PlatformGestureEvent::WebKit2PlatformGestureEvent): * Shared/WebsitePoliciesData.cpp: (WebKit::WebsitePoliciesData::applyToDocumentLoader): * UIProcess/API/C/WKPage.cpp: (WKPageReload): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): * UIProcess/API/C/WKWebsitePolicies.cpp: (WKWebsitePoliciesSetAllowedAutoplayQuirks): * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView reload]): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]): * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: (-[_WKWebsitePolicies setAllowedAutoplayQuirks:]): * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): (WebKit::WebsiteDataRecord::addHSTSCacheHostname): (WebKit::WebsiteDataRecord::addOriginWithCredential): * UIProcess/mac/WKInspectorViewController.mm: (-[WKInspectorViewController inspectorWKWebViewReload:]): * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp: (WebKit::imageForRect): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::renderedImage): * WebProcess/WebPage/FindController.cpp: (WebKit::core): (WebKit::FindController::findString): Source/WebKitLegacy/mac: * WebView/WebFrame.mm: (-[WebFrame _drawRect:contentsOnly:]): * WebView/WebView.mm: (coreOptions): Source/WTF: Improve code readability. * wtf/OptionSet.h: (WTF::OptionSet::add): (WTF::OptionSet::remove): (WTF::OptionSet::operator==): (WTF::OptionSet::operator!=): (WTF::OptionSet::operator|=): Deleted. (WTF::OptionSet::operator-=): Deleted. * wtf/ProcessPrivilege.cpp: (WTF::addProcessPrivilege): (WTF::removeProcessPrivilege): Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/204209@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-31 17:59:01 +00:00
return lhs.m_storage != rhs.m_storage;
[iOS] Throttle requestAnimationFrame to 30fps in low power mode https://bugs.webkit.org/show_bug.cgi?id=168837 <rdar://problem/30700929> Reviewed by Simon Fraser. Source/WebCore: Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery. ScriptedAnimationController now maintains an OptionSet of throttling reasons. Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode. The requestAnimationFrame interval is then determined based on those throttling reasons: - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling) - LowPowerMode: 30fps - No reasons: 60fps The Page now keeps track of low power mode state using a LowPowerModeNotifier. Whenever low power mode changes, it updates the throttling reasons in all the documents' ScriptedAnimationControllers in the frame tree. Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html fast/animation/request-animation-frame-throttling-lowPowerMode.html * dom/Document.cpp: (WebCore::Document::requestAnimationFrame): * dom/Document.h: * dom/ScriptedAnimationController.cpp: (WebCore::ScriptedAnimationController::ScriptedAnimationController): (WebCore::throttlingReasonToString): (WebCore::throttlingReasonsToString): (WebCore::ScriptedAnimationController::addThrottlingReason): (WebCore::ScriptedAnimationController::removeThrottlingReason): (WebCore::ScriptedAnimationController::isThrottled): (WebCore::ScriptedAnimationController::interval): (WebCore::ScriptedAnimationController::page): (WebCore::ScriptedAnimationController::scheduleAnimation): * dom/ScriptedAnimationController.h: (WebCore::ScriptedAnimationController::create): * page/FrameView.cpp: (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::isLowPowerModeEnabled): (WebCore::Page::setLowPowerModeEnabledOverrideForTesting): (WebCore::updateScriptedAnimationsThrottlingReason): (WebCore::Page::setIsVisuallyIdleInternal): (WebCore::Page::handleLowModePowerChange): * page/Page.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::requestAnimationFrameInterval): (WebCore::Internals::setLowPowerModeEnabled): * testing/Internals.h: * testing/Internals.idl: Source/WTF: Add support for operator -= on WTF::OptionSet for convenience: set -= Enum::A; looks much better than: set = set - Enum::A; * wtf/OptionSet.h: (WTF::OptionSet::operator-=): Tools: Add unit test for -= operator on WTF::OptionSet. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): LayoutTests: Add layout test coverage. * fast/animation/request-animation-frame-throttling-detached-iframe-expected.txt: Added. * fast/animation/request-animation-frame-throttling-detached-iframe.html: Added. * fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt: Added. * fast/animation/request-animation-frame-throttling-lowPowerMode.html: Added. * fast/animation/resources/frame-with-animation.html: Added. Canonical link: https://commits.webkit.org/185972@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-28 21:26:27 +00:00
}
Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. Source/WebCore: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { } instead of | to construct value. * editing/Editor.cpp: (WebCore::Editor::findString): Use contains instead of & to test an option. (WebCore::Editor::rangeOfString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/EditorCommand.cpp: (WebCore::executeFindString): Use { } instead of | to construct value. * editing/FindOptions.h: Use OptionSet for type. * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead of &= coupled with ~ to remove a flag. (WebCore::SearchBuffer::isWordEndMatch const): Ditto. (WebCore::SearchBuffer::isWordStartMatch const): Ditto. (WebCore::SearchBuffer::search): Ditto. (WebCore::findIteratorOptions): Ditto. (WebCore::findClosestPlainText): Ditto. (WebCore::findPlainText): Ditto. * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers did not seem to realize that. * editing/mac/DictionaryLookup.mm: (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options dictionary, and also handles the Objective-C exception possibility cleanly. Also fixed the exception case to return NSNotFound instead of a zero-length range at the location we are searching, which is what the code expects. (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange helper function, and also to do much less work when the options pointer is null. (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper function and also use auto a bunch to tighten up the code a bit. (WebCore::DictionaryLookup::stringForPDFSelection): Ditto. * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): Use |= instead of | to build find options. * page/Page.cpp: (WebCore::Page::findString): Use contains instead of & and also - instead of & combined with ~. (WebCore::Page::findStringMatchingRanges): Ditto. (WebCore::Page::rangeOfString): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Pass nullptr to indicate we don't need the options dictionary. The code before was passing a pointer to a null, which meant we would do the work to get the options dictionary, not use it, and also leak it. * testing/Internals.cpp: (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0. (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to indicate we don't need the options dictionary as above. (WebCore::parseFindOptions): Initialize options without an explicit 0, since an OptionSet starts out empty rather than uninitialized. Source/WebKit: * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. Source/WebKitLegacy/mac: * WebView/WebImmediateActionController.mm: (-[WebImmediateActionController _animationControllerForText]): Use RetainPtr so we don't leak. * WebView/WebView.mm: (coreOptions): Use |= instead of | to build up FindOptions. Source/WebKitLegacy/win: * WebView.cpp: (WebView::searchFor): Use |= instead of | to build FindOptions. (WebView::markAllMatchesForText): Create FindOptions with |= instead of |. (WebView::findString): Create FindOptions with |=; the old code just passed a WebKit FindOptions through without converting to WebCore::FindOptions. Source/WTF: * wtf/OptionSet.h: Added some operators so it's easier to use | and - with individual options from the set. Canonical link: https://commits.webkit.org/196010@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-25 01:09:58 +00:00
constexpr friend OptionSet operator|(OptionSet lhs, OptionSet rhs)
{
return fromRaw(lhs.m_storage | rhs.m_storage);
}
constexpr friend OptionSet operator&(OptionSet lhs, OptionSet rhs)
Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. Source/WebCore: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { } instead of | to construct value. * editing/Editor.cpp: (WebCore::Editor::findString): Use contains instead of & to test an option. (WebCore::Editor::rangeOfString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/EditorCommand.cpp: (WebCore::executeFindString): Use { } instead of | to construct value. * editing/FindOptions.h: Use OptionSet for type. * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead of &= coupled with ~ to remove a flag. (WebCore::SearchBuffer::isWordEndMatch const): Ditto. (WebCore::SearchBuffer::isWordStartMatch const): Ditto. (WebCore::SearchBuffer::search): Ditto. (WebCore::findIteratorOptions): Ditto. (WebCore::findClosestPlainText): Ditto. (WebCore::findPlainText): Ditto. * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers did not seem to realize that. * editing/mac/DictionaryLookup.mm: (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options dictionary, and also handles the Objective-C exception possibility cleanly. Also fixed the exception case to return NSNotFound instead of a zero-length range at the location we are searching, which is what the code expects. (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange helper function, and also to do much less work when the options pointer is null. (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper function and also use auto a bunch to tighten up the code a bit. (WebCore::DictionaryLookup::stringForPDFSelection): Ditto. * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): Use |= instead of | to build find options. * page/Page.cpp: (WebCore::Page::findString): Use contains instead of & and also - instead of & combined with ~. (WebCore::Page::findStringMatchingRanges): Ditto. (WebCore::Page::rangeOfString): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Pass nullptr to indicate we don't need the options dictionary. The code before was passing a pointer to a null, which meant we would do the work to get the options dictionary, not use it, and also leak it. * testing/Internals.cpp: (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0. (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to indicate we don't need the options dictionary as above. (WebCore::parseFindOptions): Initialize options without an explicit 0, since an OptionSet starts out empty rather than uninitialized. Source/WebKit: * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. Source/WebKitLegacy/mac: * WebView/WebImmediateActionController.mm: (-[WebImmediateActionController _animationControllerForText]): Use RetainPtr so we don't leak. * WebView/WebView.mm: (coreOptions): Use |= instead of | to build up FindOptions. Source/WebKitLegacy/win: * WebView.cpp: (WebView::searchFor): Use |= instead of | to build FindOptions. (WebView::markAllMatchesForText): Create FindOptions with |= instead of |. (WebView::findString): Create FindOptions with |=; the old code just passed a WebKit FindOptions through without converting to WebCore::FindOptions. Source/WTF: * wtf/OptionSet.h: Added some operators so it's easier to use | and - with individual options from the set. Canonical link: https://commits.webkit.org/196010@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-25 01:09:58 +00:00
{
return fromRaw(lhs.m_storage & rhs.m_storage);
Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. Source/WebCore: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { } instead of | to construct value. * editing/Editor.cpp: (WebCore::Editor::findString): Use contains instead of & to test an option. (WebCore::Editor::rangeOfString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/EditorCommand.cpp: (WebCore::executeFindString): Use { } instead of | to construct value. * editing/FindOptions.h: Use OptionSet for type. * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead of &= coupled with ~ to remove a flag. (WebCore::SearchBuffer::isWordEndMatch const): Ditto. (WebCore::SearchBuffer::isWordStartMatch const): Ditto. (WebCore::SearchBuffer::search): Ditto. (WebCore::findIteratorOptions): Ditto. (WebCore::findClosestPlainText): Ditto. (WebCore::findPlainText): Ditto. * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers did not seem to realize that. * editing/mac/DictionaryLookup.mm: (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options dictionary, and also handles the Objective-C exception possibility cleanly. Also fixed the exception case to return NSNotFound instead of a zero-length range at the location we are searching, which is what the code expects. (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange helper function, and also to do much less work when the options pointer is null. (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper function and also use auto a bunch to tighten up the code a bit. (WebCore::DictionaryLookup::stringForPDFSelection): Ditto. * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): Use |= instead of | to build find options. * page/Page.cpp: (WebCore::Page::findString): Use contains instead of & and also - instead of & combined with ~. (WebCore::Page::findStringMatchingRanges): Ditto. (WebCore::Page::rangeOfString): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Pass nullptr to indicate we don't need the options dictionary. The code before was passing a pointer to a null, which meant we would do the work to get the options dictionary, not use it, and also leak it. * testing/Internals.cpp: (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0. (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to indicate we don't need the options dictionary as above. (WebCore::parseFindOptions): Initialize options without an explicit 0, since an OptionSet starts out empty rather than uninitialized. Source/WebKit: * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. Source/WebKitLegacy/mac: * WebView/WebImmediateActionController.mm: (-[WebImmediateActionController _animationControllerForText]): Use RetainPtr so we don't leak. * WebView/WebView.mm: (coreOptions): Use |= instead of | to build up FindOptions. Source/WebKitLegacy/win: * WebView.cpp: (WebView::searchFor): Use |= instead of | to build FindOptions. (WebView::markAllMatchesForText): Create FindOptions with |= instead of |. (WebView::findString): Create FindOptions with |=; the old code just passed a WebKit FindOptions through without converting to WebCore::FindOptions. Source/WTF: * wtf/OptionSet.h: Added some operators so it's easier to use | and - with individual options from the set. Canonical link: https://commits.webkit.org/196010@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-25 01:09:58 +00:00
}
2016-09-27 19:08:34 +00:00
constexpr friend OptionSet operator-(OptionSet lhs, OptionSet rhs)
{
Fix dictionary leak in lookup, convert FindOptions to OptionSet, tweak code style nearby https://bugs.webkit.org/show_bug.cgi?id=179981 Reviewed by Sam Weinig. Source/WebCore: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): Pass { } instead of 0. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const): Use { } instead of | to construct value. * editing/Editor.cpp: (WebCore::Editor::findString): Use contains instead of & to test an option. (WebCore::Editor::rangeOfString): Ditto. (WebCore::Editor::countMatchesForText): Ditto. * editing/EditorCommand.cpp: (WebCore::executeFindString): Use { } instead of | to construct value. * editing/FindOptions.h: Use OptionSet for type. * editing/TextIterator.cpp: (WebCore::SearchBuffer::SearchBuffer): Use contains instead of &. Also use -= instead of &= coupled with ~ to remove a flag. (WebCore::SearchBuffer::isWordEndMatch const): Ditto. (WebCore::SearchBuffer::isWordStartMatch const): Ditto. (WebCore::SearchBuffer::search): Ditto. (WebCore::findIteratorOptions): Ditto. (WebCore::findClosestPlainText): Ditto. (WebCore::findPlainText): Ditto. * editing/mac/DictionaryLookup.h: Changed optional dictionary out arguments to RetainPtr<NSDictionary>. Before, they were returning a retained object, but callers did not seem to realize that. * editing/mac/DictionaryLookup.mm: (WebCore::tokenRange): Added helper. Takes care of doing adoptNS on the options dictionary, and also handles the Objective-C exception possibility cleanly. Also fixed the exception case to return NSNotFound instead of a zero-length range at the location we are searching, which is what the code expects. (WebCore::DictionaryLookup::rangeForSelection): Refactored to use the tokenRange helper function, and also to do much less work when the options pointer is null. (WebCore::DictionaryLookup::rangeAtHitTestResult): Use the tokenRange helper function and also use auto a bunch to tighten up the code a bit. (WebCore::DictionaryLookup::stringForPDFSelection): Ditto. * page/DOMWindow.cpp: (WebCore::DOMWindow::find const): Use |= instead of | to build find options. * page/Page.cpp: (WebCore::Page::findString): Use contains instead of & and also - instead of & combined with ~. (WebCore::Page::findStringMatchingRanges): Ditto. (WebCore::Page::rangeOfString): Ditto. * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Pass nullptr to indicate we don't need the options dictionary. The code before was passing a pointer to a null, which meant we would do the work to get the options dictionary, not use it, and also leak it. * testing/Internals.cpp: (WebCore::Internals::rangeOfStringNearLocation): Pass { } instead of 0. (WebCore::Internals::rangeForDictionaryLookupAtLocation): Pass nullptr to indicate we don't need the options dictionary as above. (WebCore::parseFindOptions): Initialize options without an explicit 0, since an OptionSet starts out empty rather than uninitialized. Source/WebKit: * WebProcess/Plugins/PDF/PDFPlugin.h: Use some references instead of pointers. Made more things final and private. Changed functions with multiple return values to use tuples instead of out arguments for clarity, especially because some were using pointers and it was ambiguous whether the pointers could be nullptr. Tweaked formatting. Moved initialization of data members into the class definition. * WebProcess/Plugins/PDF/PDFPlugin.mm: (WebKit::PDFPlugin::create): Take a reference. (WebKit::PDFPlugin::PDFPlugin): Ditto. Also moved some initialization to the class definition. (WebKit::PDFPlugin::countFindMatches): Added comment about ignored maxMatchCount argument. (WebKit::PDFPlugin::findString): Use contains instead of & to check bits in options. Simplified slightly confusing match count code that was doing some unnecessary comparisons with the maximum match count. Use auto a bit. (WebKit::coreCursor): Renamed from pdfLayerControllerCursorTypeToCursor since this is C++ and overloading works based on the argument type. (WebKit::PDFPlugin::notifyCursorChanged): Updated for name change. (WebKit::PDFPlugin::lookupTextAtLocation const): Return a tuple instead of using two out arguments and use a RetainPtr so we don't leak the options dictionary. * WebProcess/Plugins/PluginProxy.h: Removed unneeded include of FindOptions.h. * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm: (WebKit::WebContextMenuClient::lookUpInDictionary): Pass a reference. * WebProcess/WebPage/FindController.cpp: (WebKit::core): Use |= instead of | to build up a FindOptions. (WebKit::FindController::FindController): Initialize data members in the class definition. (WebKit::pluginViewForFrame): Deleted. Callers now use WebPage::pluginViewForFrame. (WebKit::FindController::updateFindUIAfterPageScroll): Added a FIXME about some peculiar code. (WebKit::FindController::findString): Use |= rather than | to add in an option. (WebKit::FindController::hideFindUI): Use { } rather than 0 for no options. * WebProcess/WebPage/FindController.h: Moved initialization to the header. Exported the core function that converts WebKit::FindOptions to WebCore::FindOptions. * WebProcess/WebPage/WebFrame.cpp: (WebKit::WebFrame::handlesPageScaleGesture const): Use WebPage::pluginViewForFrame. (WebKit::WebFrame::requiresUnifiedScaleFactor const): Use WebPage::pluginViewForFrame. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::createPlugin): Removed unneeded local variable and UNUSED_PARAM. (WebKit::WebPage::focusedPluginViewForFrame): Use pluginViewForFrame. (WebKit::WebPage::pluginViewForFrame): Added a null check since this takes a pointer. Use is/downcast insteadof more ad hoc coding style. (WebKit::WebPage::findStringFromInjectedBundle): Call core to convert WebKit::FindOptions to WebCore::FindOptions. Before, this was accidentally relying on the bits from the two enumrations matching! The stricter type checking of OptionSet helps us catch mistakes like this. * WebProcess/WebPage/WebPage.h: Updated for the above. Also flattened out nested #if statements, made forward declarations unconditional, and re-sorted them. Changed the Mac-specific lookupTextAtLocation to return a tuple (see below). * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::performDictionaryLookupForSelection): Take a reference instead of a pointer. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::rangeNearPositionMatchesText): Use { } rather than 0 for no options. * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::performDictionaryLookupAtLocation): Use RetainPtr<NSDictionary> to fix code that used to leak. (WebKit::WebPage::performDictionaryLookupForSelection): Ditto. (WebKit::WebPage::performDictionaryLookupOfCurrentSelection): Use a reference. (WebKit::WebPage::dictionaryPopupInfoForRange): Updated for changed argument types. (WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin): Ditto. (WebKit::WebPage::performDictionaryLookupForRange): Ditto. (WebKit::WebPage::performImmediateActionHitTestAtLocation): Updated to handle the tuple result from the lookupTextAtLocation functions. (WebKit::WebPage::lookupTextAtLocation): Changed to return a tuple and use RetainPtr for the NSDictionary to help fix the leak. Source/WebKitLegacy/mac: * WebView/WebImmediateActionController.mm: (-[WebImmediateActionController _animationControllerForText]): Use RetainPtr so we don't leak. * WebView/WebView.mm: (coreOptions): Use |= instead of | to build up FindOptions. Source/WebKitLegacy/win: * WebView.cpp: (WebView::searchFor): Use |= instead of | to build FindOptions. (WebView::markAllMatchesForText): Create FindOptions with |= instead of |. (WebView::findString): Create FindOptions with |=; the old code just passed a WebKit FindOptions through without converting to WebCore::FindOptions. Source/WTF: * wtf/OptionSet.h: Added some operators so it's easier to use | and - with individual options from the set. Canonical link: https://commits.webkit.org/196010@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-25 01:09:58 +00:00
return fromRaw(lhs.m_storage & ~rhs.m_storage);
}
Use OptionSet for ActivityState::Flags https://bugs.webkit.org/show_bug.cgi?id=188554 Reviewed by Brent Fulgham. Source/WebCore: More typesafe flags. * Modules/geolocation/GeolocationController.cpp: (WebCore::GeolocationController::activityStateDidChange): * Modules/geolocation/GeolocationController.h: * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::activityStateDidChange): * html/canvas/WebGLRenderingContextBase.h: * page/ActivityState.cpp: (WebCore::operator<<): (WebCore::activityStateFlagsToString): Deleted. * page/ActivityState.h: (WebCore::ActivityState::allFlags): * page/ActivityStateChangeObserver.h: * page/FocusController.cpp: (WebCore::FocusController::FocusController): (WebCore::FocusController::setFocused): (WebCore::FocusController::setActivityState): (WebCore::FocusController::setActive): * page/FocusController.h: (WebCore::FocusController::isActive const): (WebCore::FocusController::isFocused const): (WebCore::FocusController::contentIsVisible const): * page/Page.cpp: (WebCore::pageInitialActivityState): (WebCore::Page::Page): (WebCore::Page::setIsInWindow): (WebCore::Page::updateTimerThrottlingState): (WebCore::Page::setActivityState): (WebCore::Page::isVisibleAndActive const): (WebCore::Page::isWindowActive const): (WebCore::Page::setIsVisible): * page/Page.h: (WebCore::Page::activityState const): (WebCore::Page::isVisible const): (WebCore::Page::isInWindow const): * page/PerformanceMonitor.cpp: (WebCore::activityStateForCPUSampling): (WebCore::PerformanceMonitor::activityStateChanged): * page/PerformanceMonitor.h: * platform/text/cocoa: Added. Source/WebKit: * Shared/WebPageCreationParameters.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::windowDidOrderOffScreen): (WebKit::WebViewImpl::windowDidOrderOnScreen): (WebKit::WebViewImpl::viewDidMoveToWindow): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::updateActivityState): (WebKit::WebPageProxy::activityStateDidChange): (WebKit::WebPageProxy::dispatchActivityStateChange): (WebKit::WebPageProxy::setMuted): (WebKit::WebPageProxy::isPlayingMediaDidChange): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::isInWindow const): (WebKit::WebPageProxy::isViewVisible const): (WebKit::WebPageProxy::isViewFocused const): (WebKit::WebPageProxy::isViewWindowActive const): * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::activityStateDidChange): * WebProcess/Plugins/PluginView.h: * WebProcess/WebPage/DrawingArea.h: (WebKit::DrawingArea::activityStateDidChange): * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h: * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm: (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updateThrottleState): (WebKit::WebPage::updateIsInWindow): (WebKit::WebPage::visibilityDidChange): (WebKit::WebPage::setActivityState): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::isVisible const): (WebKit::WebPage::isVisibleOrOccluded const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange): * WebProcess/WebProcess.cpp: (WebKit::WebProcess::pageActivityStateDidChange): * WebProcess/WebProcess.h: Source/WTF: * wtf/OptionSet.h: (WTF::OptionSet::operator^): Add xor operator, useful for finding changes between sets. Tools: * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/203704@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-16 12:49:01 +00:00
constexpr friend OptionSet operator^(OptionSet lhs, OptionSet rhs)
{
return fromRaw(lhs.m_storage ^ rhs.m_storage);
}
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
private:
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
enum InitializationTag { FromRawValue };
constexpr OptionSet(E e, InitializationTag)
: m_storage(static_cast<StorageType>(e))
Support iterating over an OptionSet and checking if it is empty https://bugs.webkit.org/show_bug.cgi?id=154941 <rdar://problem/24964187> Reviewed by Darin Adler. Source/WTF: Implements support for iterating over the enumerators in an OptionSet as well as determining if the set is empty. Iterating over an OptionSet is in Big Theta(N) where N is the number of items in the set. More precisely, it is in Big Theta(log M) where M is the bitmask represented by the bitwise OR-ing of all enumerators in the set. * wtf/OptionSet.h: Added comment to describe the purpose of this class and its invariant - the enumerators must be positive powers of two. (WTF::OptionSet::Iterator::operator*): Returns the enumerator pointed to by the iterator. (WTF::OptionSet::Iterator::operator++): Advance to the next smallest enumerator in the set. (WTF::OptionSet::Iterator::operator==): Returns whether the iterator is equal to the specified iterator. (WTF::OptionSet::Iterator::operator!=): Returns whether the iterator is not equal to the specified iterator. (WTF::OptionSet::Iterator::Iterator): Added. (WTF::OptionSet::fromRaw): Instantiate using specialized private constructor to allow instantiation with a raw value of 0. (WTF::OptionSet::OptionSet): Specialized constructor that asserts that the specified value is a positive power of two. This variant is only compiled when assertions are enabled (i.e. !ASSERT_DISABLED). (WTF::OptionSet::isEmpty): Returns whether the set is empty. (WTF::OptionSet::begin): Returns an iterator to the enumerator with the smallest value in the set. (WTF::OptionSet::end): Returns an iterator that represents the end sentinel of the set. Tools: Add tests to ensure that we do not regression both iteration of an OptionSet and determining whether an OptionSet is empty. * TestWebKitAPI/Test.h: (TestWebKitAPI::Util::assertStrongEnum): Helper function to assert two strong enum type for equality. * TestWebKitAPI/Tests/WTF/OptionSet.cpp: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/173278@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-08 19:33:10 +00:00
{
}
StorageType m_storage { 0 };
Implement clearing of cookies https://bugs.webkit.org/show_bug.cgi?id=139455 Reviewed by Andreas Kling. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::deleteWebsiteData): Handle deleting cookies by finding the right network storage session and deleting the cookies from it. Then, send a DidDeleteWebsiteData message back. * NetworkProcess/NetworkProcess.h: Add new members. * NetworkProcess/NetworkProcess.messages.in: Add new DeleteWebsiteData message. * Shared/WebsiteData/WebsiteDataTypes.h: Move the website data types enum to its own file so it can be shared. * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: (toWebsiteDataTypes): Update now that WebsiteDataTypes is its own enum. (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): removeDataModifiedSince was renamed to removeData. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::generateCallbackID): Helper function to create a callback ID. (WebKit::NetworkProcessProxy::~NetworkProcessProxy): Assert that we have no pending callbacks. (WebKit::NetworkProcessProxy::deleteWebsiteData): Put the completion handler in our map and message the network process. (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch): Call all completion handlers. (WebKit::NetworkProcessProxy::didDeleteWebsiteData): Grab the completion handler and call it. * UIProcess/Network/NetworkProcessProxy.h: Add new members. * UIProcess/Network/NetworkProcessProxy.messages.in: Add DidDeleteWebsiteData callback. * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessType): Helper function that computes the type of process access we'd need for the given mask of website data types. (WebKit::WebsiteDataStore::removeData): Gather all the network processes and message them. Use a callback aggregator object to track callbacks so we'll call the completion handler once all callbacks have been invoked. * UIProcess/WebsiteData/WebsiteDataStore.h: Move WebsiteDataTypes to its own file. * WebKit2.xcodeproj/project.pbxproj: Add new files. Canonical link: https://commits.webkit.org/157309@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-12-09 20:29:59 +00:00
};
[IPC hardening] OptionSet<> values should be validated <https://webkit.org/b/213199> <rdar://problem/64369963> Reviewed by Anders Carlsson. Source/WebCore: Summary: - Add WTF::EnumTraits<> for all OptionSet<> enums. - Specify unsigned backing types for enum classes. * loader/CrossOriginAccessControl.h: * page/ActivityState.h: * page/AutoplayEvent.h: * page/CrossSiteNavigationDataTransfer.h: * page/LayoutMilestone.h: * page/TextIndicator.h: * platform/PlatformEvent.h: * platform/graphics/GraphicsContext.h: Source/WebKit: Summary: - Add WTF::EnumTraits<> for all OptionSet<> enums. - Specify unsigned backing types for enum classes. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkSession.h: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): - Add WTF::isValidOptionSet() checks. * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.h: - Replace <wtf/EnumTraits.h> with <wtf/OptionSet.h> since the latter now includes the former. * Platform/IPC/MessageFlags.h: * Shared/DocumentEditingContext.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/WebEvent.h: * Shared/WebsiteAutoplayQuirk.h: * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataFetchOption.h: * Shared/WebsiteData/WebsiteDataType.h: * Shared/ios/GestureTypes.h: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebProcess.h: Source/WTF: * wtf/OptionSet.h: (WTF::isValidOptionSet): Add. Canonical link: https://commits.webkit.org/226130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-18 15:53:25 +00:00
template<typename E>
WARN_UNUSED_RETURN constexpr bool isValidOptionSet(OptionSet<E> optionSet)
{
auto allValidBitsValue = OptionSetValueChecker<std::make_unsigned_t<std::underlying_type_t<E>>, typename EnumTraits<E>::values>::allValidBits();
[IPC hardening] OptionSet<> values should be validated <https://webkit.org/b/213199> <rdar://problem/64369963> Reviewed by Anders Carlsson. Source/WebCore: Summary: - Add WTF::EnumTraits<> for all OptionSet<> enums. - Specify unsigned backing types for enum classes. * loader/CrossOriginAccessControl.h: * page/ActivityState.h: * page/AutoplayEvent.h: * page/CrossSiteNavigationDataTransfer.h: * page/LayoutMilestone.h: * page/TextIndicator.h: * platform/PlatformEvent.h: * platform/graphics/GraphicsContext.h: Source/WebKit: Summary: - Add WTF::EnumTraits<> for all OptionSet<> enums. - Specify unsigned backing types for enum classes. * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkSession.h: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): - Add WTF::isValidOptionSet() checks. * Platform/IPC/Decoder.h: * Platform/IPC/Encoder.h: - Replace <wtf/EnumTraits.h> with <wtf/OptionSet.h> since the latter now includes the former. * Platform/IPC/MessageFlags.h: * Shared/DocumentEditingContext.h: * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h: * Shared/WebEvent.h: * Shared/WebsiteAutoplayQuirk.h: * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataFetchOption.h: * Shared/WebsiteData/WebsiteDataType.h: * Shared/ios/GestureTypes.h: * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/Plugins/PluginProcessManager.h: * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataStore.h: * WebProcess/WebProcess.h: Source/WTF: * wtf/OptionSet.h: (WTF::isValidOptionSet): Add. Canonical link: https://commits.webkit.org/226130@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-18 15:53:25 +00:00
return (optionSet.toRaw() | allValidBitsValue) == allValidBitsValue;
}
} // namespace WTF
Add WTF::OptionSet and use it for the website data types enum https://bugs.webkit.org/show_bug.cgi?id=154733 Reviewed by Geoffrey Garen. Source/WebKit2: This is a pretty mechanical change: Convert all uses of the WebsiteDataTypes enum to WTF::OptionSet. Rename the WebsiteDataTypes enum to WebsiteDataType (since it only represents a single data type), and rename headers. Encode and decode WTF::OptionSet properly. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/DatabaseProcess.messages.in: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::NetworkProcess::deleteWebsiteData): (WebKit::NetworkProcess::deleteWebsiteDataForOrigins): * NetworkProcess/NetworkProcess.h: * NetworkProcess/NetworkProcess.messages.in: * Platform/IPC/ArgumentCoders.h: (IPC::ArgumentCoder<OptionSet<T>>::encode): (IPC::ArgumentCoder<OptionSet<T>>::decode): * Scripts/webkit/messages.py: (class_template_headers): * Shared/WebsiteData/WebsiteData.h: * Shared/WebsiteData/WebsiteDataType.h: Renamed from Source/WebKit2/Shared/WebsiteData/WebsiteDataTypes.h. * UIProcess/API/C/WKApplicationCacheManager.cpp: (WKApplicationCacheManagerGetApplicationCacheOrigins): (WKApplicationCacheManagerDeleteEntriesForOrigin): (WKApplicationCacheManagerDeleteAllEntries): * UIProcess/API/C/WKResourceCacheManager.cpp: (toWebsiteDataTypes): (WKResourceCacheManagerClearCacheForOrigin): * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: (WebKit::toWebsiteDataTypes): (WebKit::toWKWebsiteDataTypes): * UIProcess/Databases/DatabaseProcessProxy.cpp: (WebKit::DatabaseProcessProxy::fetchWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteData): (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Databases/DatabaseProcessProxy.h: * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::fetchWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteData): (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/Network/NetworkProcessProxy.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::fetchWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteData): (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins): * UIProcess/WebProcessProxy.h: * UIProcess/WebsiteData/WebsiteDataRecord.cpp: (WebKit::WebsiteDataRecord::add): (WebKit::WebsiteDataRecord::addCookieHostName): (WebKit::WebsiteDataRecord::addPluginDataHostName): * UIProcess/WebsiteData/WebsiteDataRecord.h: * UIProcess/WebsiteData/WebsiteDataStore.cpp: (WebKit::computeNetworkProcessAccessTypeForDataFetch): (WebKit::computeWebProcessAccessTypeForDataFetch): (WebKit::WebsiteDataStore::fetchData): (WebKit::computeNetworkProcessAccessTypeForDataRemoval): (WebKit::computeWebProcessAccessTypeForDataRemoval): (WebKit::WebsiteDataStore::removeData): * UIProcess/WebsiteData/WebsiteDataStore.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebProcess.cpp: (WebKit::WebProcess::fetchWebsiteData): (WebKit::WebProcess::deleteWebsiteData): (WebKit::WebProcess::deleteWebsiteDataForOrigins): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: Source/WTF: Add WTF::OptionSet which makes it easier to use strong enums as flags. * WTF.xcodeproj/project.pbxproj: * wtf/Forward.h: * wtf/OptionSet.h: Copied from Source/WebKit2/Shared/WebsiteData/WebsiteData.h. (WTF::OptionSet::fromRaw): (WTF::OptionSet::OptionSet): (WTF::OptionSet::toRaw): (WTF::OptionSet::contains): (WTF::OptionSet::operator|=): Canonical link: https://commits.webkit.org/172834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-26 19:49:36 +00:00
using WTF::OptionSet;