Diff
Modified: trunk/Source/WTF/ChangeLog (237073 => 237074)
--- trunk/Source/WTF/ChangeLog 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WTF/ChangeLog 2018-10-12 20:20:15 UTC (rev 237074)
@@ -1,3 +1,12 @@
+2018-10-12 Alex Christensen <achristen...@webkit.org>
+
+ Allow encoding of small enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=190531
+
+ Reviewed by Tim Horton.
+
+ * wtf/Forward.h:
+
2018-10-11 Alexey Proskuryakov <a...@apple.com>
Add PLATFORM(IOS_FAMILY) and OS(IOS_FAMILY)
Modified: trunk/Source/WTF/wtf/Forward.h (237073 => 237074)
--- trunk/Source/WTF/wtf/Forward.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WTF/wtf/Forward.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -62,6 +62,9 @@
template<typename> struct DefaultHash { using Hash = void; };
template<typename> struct HashTraits;
+template<typename> struct EnumTraits;
+template<typename E, E...> struct EnumValues;
+
template<typename...> class Variant;
template<typename, size_t = 0, typename = CrashOnOverflow, size_t = 16> class Vector;
template<typename Value, typename = typename DefaultHash<Value>::Hash, typename = HashTraits<Value>> class HashCountedSet;
Modified: trunk/Source/WebCore/ChangeLog (237073 => 237074)
--- trunk/Source/WebCore/ChangeLog 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/ChangeLog 2018-10-12 20:20:15 UTC (rev 237074)
@@ -1,3 +1,19 @@
+2018-10-12 Alex Christensen <achristen...@webkit.org>
+
+ Allow encoding of small enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=190531
+
+ Reviewed by Tim Horton.
+
+ * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
+ * dom/Document.h:
+ * editing/FontAttributeChanges.h:
+ * history/CachedFrame.h:
+ * loader/FrameLoaderTypes.h:
+ * platform/CookiesStrategy.h:
+ * platform/PasteboardItemInfo.h:
+ * platform/ReferrerPolicy.h:
+
2018-10-12 Rob Buis <rb...@igalia.com>
Solve the confusion around blankURL() and isBlankURL() in URL
Modified: trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h (237073 => 237074)
--- trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -31,7 +31,6 @@
#include "PublicKeyCredentialDescriptor.h"
#include "PublicKeyCredentialType.h"
#include <wtf/CrossThreadCopier.h>
-#include <wtf/EnumTraits.h>
#include <wtf/Forward.h>
namespace WebCore {
Modified: trunk/Source/WebCore/dom/Document.h (237073 => 237074)
--- trunk/Source/WebCore/dom/Document.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/dom/Document.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -200,7 +200,7 @@
template<typename> class ExceptionOr;
enum CollectionType;
-enum class ShouldOpenExternalURLsPolicy;
+enum class ShouldOpenExternalURLsPolicy : uint8_t;
enum class RouteSharingPolicy;
Modified: trunk/Source/WebCore/editing/FontAttributeChanges.h (237073 => 237074)
--- trunk/Source/WebCore/editing/FontAttributeChanges.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/editing/FontAttributeChanges.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -27,7 +27,6 @@
#include "Color.h"
#include "FontShadow.h"
-#include <wtf/EnumTraits.h>
#include <wtf/Forward.h>
#include <wtf/Optional.h>
Modified: trunk/Source/WebCore/history/CachedFrame.h (237073 => 237074)
--- trunk/Source/WebCore/history/CachedFrame.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/history/CachedFrame.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -38,7 +38,7 @@
class DocumentLoader;
class FrameView;
class Node;
-enum class HasInsecureContent;
+enum class HasInsecureContent : uint8_t;
class CachedFrameBase {
public:
Modified: trunk/Source/WebCore/loader/FrameLoaderTypes.h (237073 => 237074)
--- trunk/Source/WebCore/loader/FrameLoaderTypes.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/loader/FrameLoaderTypes.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -40,7 +40,7 @@
FrameStateComplete
};
-enum class PolicyAction {
+enum class PolicyAction : uint8_t {
Use,
Download,
Ignore,
@@ -47,13 +47,13 @@
Suspend,
};
-enum class ReloadOption {
+enum class ReloadOption : uint8_t {
ExpiredOnly = 1 << 0,
FromOrigin = 1 << 1,
DisableContentBlockers = 1 << 2,
};
-enum class FrameLoadType {
+enum class FrameLoadType : uint8_t {
Standard,
Back,
Forward,
@@ -66,12 +66,12 @@
ReloadExpiredOnly
};
-enum class NewFrameOpenerPolicy {
+enum class NewFrameOpenerPolicy : uint8_t {
Suppress,
Allow
};
-enum class NavigationType {
+enum class NavigationType : uint8_t {
LinkClicked,
FormSubmitted,
BackForward,
@@ -80,13 +80,13 @@
Other
};
-enum class ShouldOpenExternalURLsPolicy {
+enum class ShouldOpenExternalURLsPolicy : uint8_t {
ShouldNotAllow,
ShouldAllowExternalSchemes,
ShouldAllow,
};
-enum class InitiatedByMainFrame {
+enum class InitiatedByMainFrame : uint8_t {
Yes,
Unknown,
};
@@ -96,7 +96,7 @@
ShouldNotClearProvisionalItem
};
-enum class ObjectContentType {
+enum class ObjectContentType : uint8_t {
None,
Image,
Frame,
@@ -129,22 +129,22 @@
WebGLPendingCreation
};
-enum class LockHistory {
+enum class LockHistory : uint8_t {
Yes,
No
};
-enum class LockBackForwardList {
+enum class LockBackForwardList : uint8_t {
Yes,
No
};
-enum class AllowNavigationToInvalidURL {
+enum class AllowNavigationToInvalidURL : uint8_t {
Yes,
No
};
-enum class HasInsecureContent {
+enum class HasInsecureContent : uint8_t {
Yes,
No,
};
@@ -155,7 +155,7 @@
bool isSystemPreview { false };
};
-enum class LoadCompletionType {
+enum class LoadCompletionType : uint8_t {
Finish,
Cancel
};
@@ -164,9 +164,6 @@
namespace WTF {
-template<typename> struct EnumTraits;
-template<typename E, E...> struct EnumValues;
-
template<> struct EnumTraits<WebCore::PolicyAction> {
using values = EnumValues<
WebCore::PolicyAction,
Modified: trunk/Source/WebCore/platform/CookiesStrategy.h (237073 => 237074)
--- trunk/Source/WebCore/platform/CookiesStrategy.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/platform/CookiesStrategy.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -26,7 +26,6 @@
#pragma once
#include <pal/SessionID.h>
-#include <wtf/EnumTraits.h>
#include <wtf/Forward.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebCore/platform/PasteboardItemInfo.h (237073 => 237074)
--- trunk/Source/WebCore/platform/PasteboardItemInfo.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/platform/PasteboardItemInfo.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -80,9 +80,6 @@
namespace WTF {
-template<typename> struct EnumTraits;
-template<typename E, E...> struct EnumValues;
-
template<> struct EnumTraits<WebCore::PasteboardItemPresentationStyle> {
using values = EnumValues<
WebCore::PasteboardItemPresentationStyle,
Modified: trunk/Source/WebCore/platform/ReferrerPolicy.h (237073 => 237074)
--- trunk/Source/WebCore/platform/ReferrerPolicy.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebCore/platform/ReferrerPolicy.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -32,7 +32,6 @@
#pragma once
-#include <wtf/EnumTraits.h>
#include <wtf/Forward.h>
#include <wtf/Optional.h>
Modified: trunk/Source/WebKit/ChangeLog (237073 => 237074)
--- trunk/Source/WebKit/ChangeLog 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/ChangeLog 2018-10-12 20:20:15 UTC (rev 237074)
@@ -1,3 +1,21 @@
+2018-10-12 Alex Christensen <achristen...@webkit.org>
+
+ Allow encoding of small enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=190531
+
+ Reviewed by Tim Horton.
+
+ * NetworkProcess/NetworkLoadClient.h:
+ * Scripts/webkit/messages.py:
+ * Scripts/webkit/parser.py:
+ (parse_parameters_string):
+ * UIProcess/API/APINavigation.h:
+ * UIProcess/WebFramePolicyListenerProxy.h:
+ * UIProcess/WebNavigationState.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/WebPage/WebPage.messages.in:
+
2018-10-12 Rob Buis <rb...@igalia.com>
Solve the confusion around blankURL() and isBlankURL() in URL
Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h (237073 => 237074)
--- trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -34,7 +34,7 @@
class NetworkLoadMetrics;
class ProtectionSpace;
class SharedBuffer;
-enum class PolicyAction;
+enum class PolicyAction : uint8_t;
}
namespace WebKit {
Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (237073 => 237074)
--- trunk/Source/WebKit/Scripts/webkit/messages.py 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py 2018-10-12 20:20:15 UTC (rev 237074)
@@ -86,7 +86,7 @@
if type in builtin_types:
return type
- if kind == 'enum':
+ if kind.startswith('enum'):
return type
return 'const %s&' % type
@@ -151,8 +151,8 @@
qualified_name = '%s::%s' % (namespace, type)
if kind == 'struct':
return 'struct %s' % type
- elif kind == 'enum':
- return 'enum class %s' % type
+ elif kind.startswith('enum'):
+ return 'enum class %s %s' % (type, kind[4:])
else:
return 'class %s' % type
Modified: trunk/Source/WebKit/Scripts/webkit/parser.py (237073 => 237074)
--- trunk/Source/WebKit/Scripts/webkit/parser.py 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/Scripts/webkit/parser.py 2018-10-12 20:20:15 UTC (rev 237074)
@@ -134,9 +134,9 @@
if split[0].startswith('struct '):
parameter_kind = 'struct'
split[0] = split[0][7:]
- elif split[0].startswith('enum '):
- parameter_kind = 'enum'
- split[0] = split[0][5:]
+ elif split[0].startswith('enum'):
+ parameter_kind = split[0][:split[0].find(' ')]
+ split[0] = split[0][split[0].find(' ') + 1:]
parameter_type = split[0]
parameter_name = split[1]
Modified: trunk/Source/WebKit/UIProcess/API/APINavigation.h (237073 => 237074)
--- trunk/Source/WebKit/UIProcess/API/APINavigation.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/UIProcess/API/APINavigation.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -33,7 +33,7 @@
#include <wtf/Ref.h>
namespace WebCore {
-enum class FrameLoadType;
+enum class FrameLoadType : uint8_t;
}
namespace WebKit {
Modified: trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h (237073 => 237074)
--- trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -34,7 +34,7 @@
}
namespace WebCore {
-enum class PolicyAction;
+enum class PolicyAction : uint8_t;
}
namespace WebKit {
Modified: trunk/Source/WebKit/UIProcess/WebNavigationState.h (237073 => 237074)
--- trunk/Source/WebKit/UIProcess/WebNavigationState.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/UIProcess/WebNavigationState.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -35,7 +35,7 @@
namespace WebCore {
class ResourceRequest;
-enum class FrameLoadType;
+enum class FrameLoadType : uint8_t;
}
namespace WebKit {
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (237073 => 237074)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2018-10-12 20:20:15 UTC (rev 237074)
@@ -177,7 +177,7 @@
enum SelectionDirection : uint8_t;
enum class AutoplayEvent;
-enum class HasInsecureContent;
+enum class HasInsecureContent : uint8_t;
enum class NotificationDirection;
enum class ShouldSample;
enum class ShouldTreatAsContinuingLoad;
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (237073 => 237074)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2018-10-12 20:20:15 UTC (rev 237074)
@@ -108,7 +108,7 @@
# Policy messages
DecidePolicyForResponse(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, uint64_t listenerID, WebKit::UserData userData)
DecidePolicyForNavigationActionAsync(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, enum WebCore::ShouldSkipSafeBrowsingCheck shouldSkipSafeBrowsingCheck, uint64_t listenerID)
- DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, enum WebCore::ShouldSkipSafeBrowsingCheck shouldSkipSafeBrowsingCheck) -> (enum WebCore::PolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed
+ DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, enum WebCore::ShouldSkipSafeBrowsingCheck shouldSkipSafeBrowsingCheck) -> (enum:uint8_t WebCore::PolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed
DecidePolicyForNewWindowAction(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, struct WebKit::NavigationActionData navigationActionData, WebCore::ResourceRequest request, String frameName, uint64_t listenerID, WebKit::UserData userData)
UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::UserData userData)
@@ -149,7 +149,7 @@
DidChangeMainDocument(uint64_t frameID);
DidDestroyNavigation(uint64_t navigationID)
- HasInsecureContent() -> (enum WebCore::HasInsecureContent hasInsecureContent)
+ HasInsecureContent() -> (enum:uint8_t WebCore::HasInsecureContent hasInsecureContent)
MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture)
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (237073 => 237074)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in 2018-10-12 20:20:15 UTC (rev 237074)
@@ -140,7 +140,7 @@
ScrollBy(uint32_t scrollDirection, uint32_t scrollGranularity)
CenterSelectionInVisibleArea()
- GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum WebCore::FrameLoadType backForwardType, enum WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
+ GoToBackForwardItem(uint64_t navigationID, struct WebCore::BackForwardItemIdentifier backForwardItemID, enum:uint8_t WebCore::FrameLoadType backForwardType, enum WebCore::ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad)
TryRestoreScrollPosition()
LoadURLInFrame(WebCore::URL url, uint64_t frameID)
@@ -161,7 +161,7 @@
DidRemoveBackForwardItem(struct WebCore::BackForwardItemIdentifier backForwardItemID)
UpdateWebsitePolicies(struct WebKit::WebsitePoliciesData websitePolicies)
- DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum WebCore::PolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies)
+ DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebCore::PolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies)
ContinueWillSubmitForm(uint64_t frameID, uint64_t listenerID)
ClearSelection()
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (237073 => 237074)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-10-12 20:20:15 UTC (rev 237074)
@@ -1,3 +1,13 @@
+2018-10-12 Alex Christensen <achristen...@webkit.org>
+
+ Allow encoding of small enum classes
+ https://bugs.webkit.org/show_bug.cgi?id=190531
+
+ Reviewed by Tim Horton.
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (-[WebFramePolicyListener dealloc]):
+
2018-10-11 Keith Rollin <krol...@apple.com>
CURRENT_ARCH should not be used in Run Script phase.
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (237073 => 237074)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2018-10-12 19:20:10 UTC (rev 237073)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2018-10-12 20:20:15 UTC (rev 237074)
@@ -2436,7 +2436,7 @@
// response policy decision, "Ignore" for other policy decisions).
_frame = nullptr;
if (auto policyFunction = std::exchange(_policyFunction, nullptr)) {
- RELEASE_LOG_ERROR(Loading, "Client application failed to make a policy decision via WebPolicyDecisionListener, using defaultPolicy %u", _defaultPolicy);
+ RELEASE_LOG_ERROR(Loading, "Client application failed to make a policy decision via WebPolicyDecisionListener, using defaultPolicy %hhu", _defaultPolicy);
policyFunction(_defaultPolicy);
}