Move WebKit::WebsitePolicies to API::WebsitePolicies
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:58:02 +0000 (19:58 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:58:02 +0000 (19:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180873

Reviewed by Joseph Pecoraro.

It's just an API data object now.  I need it to be in the API namespace so we can
give it references to other API namespace objects without weird layering violations.

* CMakeLists.txt:
* Shared/WebsiteAutoplayPolicy.h: Added.
* Shared/WebsiteAutoplayQuirk.h: Added.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::fromWebsitePolicies): Deleted.
* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp: Added.
(API::WebsitePolicies::~WebsitePolicies):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h: Copied from Source/WebKit/UIProcess/WebsitePolicies.h.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKFramePolicyListener.cpp:
(WKFramePolicyListenerUseWithPolicies):
* UIProcess/API/C/WKPage.cpp:
(WKPageUpdateWebsitePolicies):
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesGetTypeID):
(WKWebsitePoliciesCreate):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateWebsitePolicies:]):
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies dealloc]):
(-[_WKWebsitePolicies init]):
* UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
(WebKit::wrapper): Deleted.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/WebFormSubmissionListenerProxy.cpp:
* UIProcess/WebsitePolicies.h: Removed.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225977 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/Shared/WebsiteAutoplayPolicy.h [new file with mode: 0644]
Source/WebKit/Shared/WebsiteAutoplayQuirk.h [new file with mode: 0644]
Source/WebKit/Shared/WebsitePoliciesData.cpp
Source/WebKit/Shared/WebsitePoliciesData.h
Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/APIWebsitePolicies.h [moved from Source/WebKit/UIProcess/WebsitePolicies.h with 64% similarity]
Source/WebKit/UIProcess/API/C/WKAPICast.h
Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKWebsitePolicies.cpp
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.h
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePolicies.mm
Source/WebKit/UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/WebFormSubmissionListenerProxy.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 43cab5b..30d6fe9 100644 (file)
@@ -358,6 +358,7 @@ set(WebKit_SOURCES
     UIProcess/API/APIUserScript.cpp
     UIProcess/API/APIUserStyleSheet.cpp
     UIProcess/API/APIWebsiteDataStore.cpp
+    UIProcess/API/APIWebsitePolicies.cpp
     UIProcess/API/APIWindowFeatures.cpp
 
     UIProcess/API/C/WKApplicationCacheManager.cpp
index 0fdf804..fbdd4c6 100644 (file)
@@ -1,3 +1,46 @@
+2017-12-15  Alex Christensen  <achristensen@webkit.org>
+
+        Move WebKit::WebsitePolicies to API::WebsitePolicies
+        https://bugs.webkit.org/show_bug.cgi?id=180873
+
+        Reviewed by Joseph Pecoraro.
+
+        It's just an API data object now.  I need it to be in the API namespace so we can
+        give it references to other API namespace objects without weird layering violations.
+
+        * CMakeLists.txt:
+        * Shared/WebsiteAutoplayPolicy.h: Added.
+        * Shared/WebsiteAutoplayQuirk.h: Added.
+        * Shared/WebsitePoliciesData.cpp:
+        (WebKit::WebsitePoliciesData::fromWebsitePolicies): Deleted.
+        * Shared/WebsitePoliciesData.h:
+        * UIProcess/API/APIWebsitePolicies.cpp: Added.
+        (API::WebsitePolicies::~WebsitePolicies):
+        (API::WebsitePolicies::data):
+        * UIProcess/API/APIWebsitePolicies.h: Copied from Source/WebKit/UIProcess/WebsitePolicies.h.
+        * UIProcess/API/C/WKAPICast.h:
+        * UIProcess/API/C/WKFramePolicyListener.cpp:
+        (WKFramePolicyListenerUseWithPolicies):
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageUpdateWebsitePolicies):
+        * UIProcess/API/C/WKWebsitePolicies.cpp:
+        (WKWebsitePoliciesGetTypeID):
+        (WKWebsitePoliciesCreate):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _updateWebsitePolicies:]):
+        * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
+        * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
+        (-[_WKWebsitePolicies dealloc]):
+        (-[_WKWebsitePolicies init]):
+        * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h:
+        (WebKit::wrapper): Deleted.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
+        * UIProcess/WebFormSubmissionListenerProxy.cpp:
+        * UIProcess/WebsitePolicies.h: Removed.
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/WebPage.cpp:
+
 2017-12-14  Zan Dobersek  <zdobersek@igalia.com>
 
         Unreviewed GTK+ build fix after r225954.
diff --git a/Source/WebKit/Shared/WebsiteAutoplayPolicy.h b/Source/WebKit/Shared/WebsiteAutoplayPolicy.h
new file mode 100644 (file)
index 0000000..d0759c1
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <wtf/EnumTraits.h>
+
+namespace WebKit {
+    
+enum class WebsiteAutoplayPolicy {
+    Default,
+    Allow,
+    AllowWithoutSound,
+    Deny
+};
+
+}
+
+namespace WTF {
+
+template<> struct EnumTraits<WebKit::WebsiteAutoplayPolicy> {
+    using values = EnumValues<
+        WebKit::WebsiteAutoplayPolicy,
+        WebKit::WebsiteAutoplayPolicy::Default,
+        WebKit::WebsiteAutoplayPolicy::Allow,
+        WebKit::WebsiteAutoplayPolicy::AllowWithoutSound,
+        WebKit::WebsiteAutoplayPolicy::Deny
+    >;
+};
+
+} // namespace WTF
diff --git a/Source/WebKit/Shared/WebsiteAutoplayQuirk.h b/Source/WebKit/Shared/WebsiteAutoplayQuirk.h
new file mode 100644 (file)
index 0000000..cd473e5
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 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.
+ */
+
+#pragma once
+
+namespace WebKit {
+
+enum class WebsiteAutoplayQuirk {
+    SynthesizedPauseEvents = 1 << 0,
+    InheritedUserGestures = 1 << 1,
+    ArbitraryUserGestures = 1 << 2,
+};
+
+}
index f007115..6750e69 100644 (file)
 
 namespace WebKit {
 
-WebsitePoliciesData WebsitePoliciesData::fromWebsitePolicies(const WebsitePolicies& policies)
-{
-    return { policies.contentBlockersEnabled(), policies.allowedAutoplayQuirks(), policies.autoplayPolicy(), policies.customHeaderFields() };
-}
-
 void WebsitePoliciesData::encode(IPC::Encoder& encoder) const
 {
     encoder << contentBlockersEnabled;
index 9759704..2e826a0 100644 (file)
 
 #pragma once
 
-#include "WebsitePolicies.h"
+#include "WebsiteAutoplayPolicy.h"
+#include "WebsiteAutoplayQuirk.h"
+#include <WebCore/HTTPHeaderField.h>
+#include <wtf/OptionSet.h>
+
+namespace IPC {
+class Decoder;
+class Encoder;
+}
+
+namespace WebCore {
+class DocumentLoader;
+}
 
 namespace WebKit {
 
 struct WebsitePoliciesData {
-    static WebsitePoliciesData fromWebsitePolicies(const WebsitePolicies&);
     static void applyToDocumentLoader(WebsitePoliciesData&&, WebCore::DocumentLoader&);
 
     bool contentBlockersEnabled { true };
diff --git a/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp b/Source/WebKit/UIProcess/API/APIWebsitePolicies.cpp
new file mode 100644 (file)
index 0000000..a28ba26
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * 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.
+ */
+
+#include "config.h"
+#include "APIWebsitePolicies.h"
+
+#include "WebsitePoliciesData.h"
+
+namespace API {
+
+WebsitePolicies::~WebsitePolicies()
+{
+}
+
+WebKit::WebsitePoliciesData WebsitePolicies::data()
+{
+    return { contentBlockersEnabled(), allowedAutoplayQuirks(), autoplayPolicy(), customHeaderFields() };
+}
+
+}
+
similarity index 64%
rename from Source/WebKit/UIProcess/WebsitePolicies.h
rename to Source/WebKit/UIProcess/API/APIWebsitePolicies.h
index d700fe0..d5c605f 100644 (file)
 #pragma once
 
 #include "APIObject.h"
+#include "WebsiteAutoplayPolicy.h"
+#include "WebsiteAutoplayQuirk.h"
 #include <WebCore/HTTPHeaderField.h>
 #include <wtf/EnumTraits.h>
 #include <wtf/OptionSet.h>
 #include <wtf/Optional.h>
 #include <wtf/Vector.h>
 
-namespace IPC {
-class Decoder;
-class Encoder;
-}
-
-namespace WebCore {
-class DocumentLoader;
-}
-
 namespace WebKit {
+struct WebsitePoliciesData;
+}
 
-enum class WebsiteAutoplayPolicy {
-    Default,
-    Allow,
-    AllowWithoutSound,
-    Deny
-};
-
-enum class WebsiteAutoplayQuirk {
-    SynthesizedPauseEvents = 1 << 0,
-    InheritedUserGestures = 1 << 1,
-    ArbitraryUserGestures = 1 << 2,
-};
+namespace API {
 
 class WebsitePolicies final : public API::ObjectImpl<API::Object::Type::WebsitePolicies> {
 public:
     static Ref<WebsitePolicies> create() { return adoptRef(*new WebsitePolicies); }
     WebsitePolicies() = default;
+    ~WebsitePolicies();
 
     bool contentBlockersEnabled() const { return m_contentBlockersEnabled; }
     void setContentBlockersEnabled(bool enabled) { m_contentBlockersEnabled = enabled; }
     
-    OptionSet<WebsiteAutoplayQuirk> allowedAutoplayQuirks() const { return m_allowedAutoplayQuirks; }
-    void setAllowedAutoplayQuirks(OptionSet<WebsiteAutoplayQuirk> quirks) { m_allowedAutoplayQuirks = quirks; }
+    OptionSet<WebKit::WebsiteAutoplayQuirk> allowedAutoplayQuirks() const { return m_allowedAutoplayQuirks; }
+    void setAllowedAutoplayQuirks(OptionSet<WebKit::WebsiteAutoplayQuirk> quirks) { m_allowedAutoplayQuirks = quirks; }
     
-    WebsiteAutoplayPolicy autoplayPolicy() const { return m_autoplayPolicy; }
-    void setAutoplayPolicy(WebsiteAutoplayPolicy policy) { m_autoplayPolicy = policy; }
+    WebKit::WebsiteAutoplayPolicy autoplayPolicy() const { return m_autoplayPolicy; }
+    void setAutoplayPolicy(WebKit::WebsiteAutoplayPolicy policy) { m_autoplayPolicy = policy; }
     
     const Vector<WebCore::HTTPHeaderField>& customHeaderFields() const { return m_customHeaderFields; }
     Vector<WebCore::HTTPHeaderField>&& takeCustomHeaderFields() { return WTFMove(m_customHeaderFields); }
     void setCustomHeaderFields(Vector<WebCore::HTTPHeaderField>&& fields) { m_customHeaderFields = WTFMove(fields); }
 
+    WebKit::WebsitePoliciesData data();
+
 private:
-    WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebsiteAutoplayQuirk> allowedAutoplayQuirks, WebsiteAutoplayPolicy autoplayPolicy, Vector<WebCore::HTTPHeaderField>&& customHeaderFields)
+    WebsitePolicies(bool contentBlockersEnabled, OptionSet<WebKit::WebsiteAutoplayQuirk> allowedAutoplayQuirks, WebKit::WebsiteAutoplayPolicy autoplayPolicy, Vector<WebCore::HTTPHeaderField>&& customHeaderFields)
         : m_contentBlockersEnabled(contentBlockersEnabled)
         , m_allowedAutoplayQuirks(allowedAutoplayQuirks)
         , m_autoplayPolicy(autoplayPolicy)
@@ -83,23 +70,9 @@ private:
     { }
 
     bool m_contentBlockersEnabled { true };
-    OptionSet<WebsiteAutoplayQuirk> m_allowedAutoplayQuirks;
-    WebsiteAutoplayPolicy m_autoplayPolicy { WebsiteAutoplayPolicy::Default };
+    OptionSet<WebKit::WebsiteAutoplayQuirk> m_allowedAutoplayQuirks;
+    WebKit::WebsiteAutoplayPolicy m_autoplayPolicy { WebKit::WebsiteAutoplayPolicy::Default };
     Vector<WebCore::HTTPHeaderField> m_customHeaderFields;
 };
 
-} // namespace WebKit
-
-namespace WTF {
-
-template<> struct EnumTraits<WebKit::WebsiteAutoplayPolicy> {
-    using values = EnumValues<
-        WebKit::WebsiteAutoplayPolicy,
-        WebKit::WebsiteAutoplayPolicy::Default,
-        WebKit::WebsiteAutoplayPolicy::Allow,
-        WebKit::WebsiteAutoplayPolicy::AllowWithoutSound,
-        WebKit::WebsiteAutoplayPolicy::Deny
-    >;
-};
-
-} // namespace WTF
+} // namespace API
index 19cac5f..3b6bc30 100644 (file)
@@ -68,6 +68,7 @@ class ProcessPoolConfiguration;
 class SessionState;
 class UserScript;
 class WebsiteDataStore;
+class WebsitePolicies;
 class WindowFeatures;
 }
 
@@ -110,7 +111,6 @@ class WebResourceLoadStatisticsManager;
 class WebTextChecker;
 class WebUserContentControllerProxy;
 class WebViewportAttributes;
-class WebsitePolicies;
 
 WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
 WK_ADD_API_MAPPING(WKAuthenticationDecisionListenerRef, AuthenticationDecisionListener)
@@ -165,7 +165,7 @@ WK_ADD_API_MAPPING(WKUserMediaPermissionRequestRef, UserMediaPermissionRequestPr
 WK_ADD_API_MAPPING(WKUserScriptRef, API::UserScript)
 WK_ADD_API_MAPPING(WKViewportAttributesRef, WebViewportAttributes)
 WK_ADD_API_MAPPING(WKWebsiteDataStoreRef, API::WebsiteDataStore)
-WK_ADD_API_MAPPING(WKWebsitePoliciesRef, WebsitePolicies)
+WK_ADD_API_MAPPING(WKWebsitePoliciesRef, API::WebsitePolicies)
 WK_ADD_API_MAPPING(WKWindowFeaturesRef, API::WindowFeatures)
 
 /* Enum conversions */
index 37c8d4f..cd842d2 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WKFramePolicyListener.h"
 
+#include "APIWebsitePolicies.h"
 #include "WKAPICast.h"
 #include "WebFramePolicyListenerProxy.h"
 #include "WebFrameProxy.h"
@@ -45,7 +46,7 @@ void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListenerRef)
 
 void WKFramePolicyListenerUseWithPolicies(WKFramePolicyListenerRef policyListenerRef, WKWebsitePoliciesRef websitePolicies)
 {
-    toImpl(policyListenerRef)->use(WebsitePoliciesData::fromWebsitePolicies(*toImpl(websitePolicies)));
+    toImpl(policyListenerRef)->use(toImpl(websitePolicies)->data());
 }
 
 void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListenerRef)
index 7c121b1..d5cd531 100644 (file)
@@ -46,6 +46,7 @@
 #include "APIPolicyClient.h"
 #include "APISessionState.h"
 #include "APIUIClient.h"
+#include "APIWebsitePolicies.h"
 #include "APIWindowFeatures.h"
 #include "AuthenticationChallengeProxy.h"
 #include "LegacySessionStateCoding.h"
@@ -70,7 +71,6 @@
 #include "WebProcessPool.h"
 #include "WebProcessProxy.h"
 #include "WebProtectionSpace.h"
-#include "WebsitePolicies.h"
 #include <WebCore/Page.h>
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/SerializedCryptoKeyWrap.h>
@@ -325,7 +325,7 @@ bool WKPageWillHandleHorizontalScrollEvents(WKPageRef pageRef)
 
 void WKPageUpdateWebsitePolicies(WKPageRef pageRef, WKWebsitePoliciesRef websitePoliciesRef)
 {
-    toImpl(pageRef)->updateWebsitePolicies(WebsitePoliciesData::fromWebsitePolicies(*toImpl(websitePoliciesRef)));
+    toImpl(pageRef)->updateWebsitePolicies(toImpl(websitePoliciesRef)->data());
 }
 
 WKStringRef WKPageCopyTitle(WKPageRef pageRef)
index 1361a73..a8f2ae3 100644 (file)
 #include "WKWebsitePolicies.h"
 
 #include "APIDictionary.h"
+#include "APIWebsitePolicies.h"
 #include "WKAPICast.h"
 #include "WKArray.h"
 #include "WKDictionary.h"
 #include "WKRetainPtr.h"
-#include "WebsitePolicies.h"
 
 using namespace WebKit;
 
 WKTypeID WKWebsitePoliciesGetTypeID()
 {
-    return toAPI(WebsitePolicies::APIType);
+    return toAPI(API::WebsitePolicies::APIType);
 }
 
 WKWebsitePoliciesRef WKWebsitePoliciesCreate()
 {
-    return toAPI(&WebsitePolicies::create().leakRef());
+    return toAPI(&API::WebsitePolicies::create().leakRef());
 }
 
 void WKWebsitePoliciesSetContentBlockersEnabled(WKWebsitePoliciesRef websitePolicies, bool enabled)
index 1c8317e..19f13d6 100644 (file)
@@ -4233,7 +4233,7 @@ static int32_t activeOrientation(WKWebView *webView)
 
 - (void)_updateWebsitePolicies:(_WKWebsitePolicies *)websitePolicies
 {
-    _page->updateWebsitePolicies(WebKit::WebsitePoliciesData::fromWebsitePolicies(*websitePolicies->_websitePolicies));
+    _page->updateWebsitePolicies(websitePolicies->_websitePolicies->data());
 }
 
 - (BOOL)_allowsRemoteInspection
index a11f84c..fb75b73 100644 (file)
@@ -46,7 +46,7 @@ WK_CLASS_AVAILABLE(macosx(10.12.3), ios(10.3))
 @property (nonatomic) BOOL contentBlockersEnabled;
 @property (nonatomic) _WKWebsiteAutoplayQuirk allowedAutoplayQuirks WK_API_AVAILABLE(macosx(10.13), ios(11.0));
 @property (nonatomic) _WKWebsiteAutoplayPolicy autoplayPolicy WK_API_AVAILABLE(macosx(10.13), ios(11.0));
-@property (nonatomic, copy, setter=setCustomHeaderFields:) NSDictionary<NSString *, NSString *> *customHeaderFields WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *customHeaderFields WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @end
 
index fcdcd1d..c6d6967 100644 (file)
 
 #if WK_API_ENABLED
 
+#import "WKWebsiteDataStoreInternal.h"
+
 @implementation _WKWebsitePolicies
 
 - (void)dealloc
 {
-    _websitePolicies->WebKit::WebsitePolicies::~WebsitePolicies();
+    _websitePolicies->API::WebsitePolicies::~WebsitePolicies();
     
     [super dealloc];
 }
@@ -42,7 +44,7 @@
     if (!(self = [super init]))
         return nil;
     
-    API::Object::constructInWrapper<WebKit::WebsitePolicies>(self);
+    API::Object::constructInWrapper<API::WebsitePolicies>(self);
     
     return self;
 }
index d295487..7540626 100644 (file)
 
 #if WK_API_ENABLED
 
+#import "APIWebsitePolicies.h"
 #import "WKObject.h"
-#import "WebsitePolicies.h"
 
-namespace WebKit {
+namespace API {
 
 inline _WKWebsitePolicies *wrapper(WebsitePolicies& websitePolicies)
 {
@@ -42,7 +42,7 @@ inline _WKWebsitePolicies *wrapper(WebsitePolicies& websitePolicies)
 
 @interface _WKWebsitePolicies () <WKObject> {
 @package
-    API::ObjectStorage<WebKit::WebsitePolicies> _websitePolicies;
+    API::ObjectStorage<API::WebsitePolicies> _websitePolicies;
 }
 @end
 
index 30e576d..e6df598 100644 (file)
@@ -467,7 +467,7 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP
 
         std::optional<WebsitePoliciesData> data;
         if (websitePolicies)
-            data = WebsitePoliciesData::fromWebsitePolicies(*websitePolicies->_websitePolicies);
+            data = websitePolicies->_websitePolicies->data();
 
         switch (actionPolicy) {
         case WKNavigationActionPolicyAllow:
index 9d96882..c17441a 100644 (file)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "WebFormSubmissionListenerProxy.h"
 
-#include "WebsitePolicies.h"
-
 namespace WebKit {
 
 void WebFormSubmissionListenerProxy::continueSubmission()
index 6758bc1..1f5df33 100644 (file)
                5C0B17791E7C882100E9123C /* WebSocketStreamMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C0B17761E7C879C00E9123C /* WebSocketStreamMessageReceiver.cpp */; };
                5C0B177C1E7C885400E9123C /* WebSocketStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C0B177A1E7C884F00E9123C /* WebSocketStream.cpp */; };
                5C0B17811E7C8C2600E9123C /* NetworkSocketStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C0B177D1E7C886700E9123C /* NetworkSocketStream.cpp */; };
-               5C13024C1FE35154000D9B31 /* WebsitePolicies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C13024B1FE35142000D9B31 /* WebsitePolicies.h */; };
                5C1426EC1C23F80900D41183 /* NetworkProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */; };
                5C1426ED1C23F80900D41183 /* NetworkProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */; };
                5C1426EE1C23F80900D41183 /* NetworkProcessSupplement.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426E41C23F80500D41183 /* NetworkProcessSupplement.h */; };
                5C6CE6D11F59BC7A0007C6CB /* PageClientImplCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C6CE6D01F59BC460007C6CB /* PageClientImplCocoa.mm */; };
                5C7706741D1138380012700F /* WebSocketProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C7706731D111D8B0012700F /* WebSocketProvider.cpp */; };
                5C85C7881C3F23CE0061A4FA /* PendingDownload.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */; };
+               5C8DD37E1FE4502000F2A556 /* APIWebsitePolicies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C8DD37D1FE4501100F2A556 /* APIWebsitePolicies.cpp */; };
+               5C8DD3801FE4521600F2A556 /* WebsiteAutoplayPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C8DD37F1FE4519200F2A556 /* WebsiteAutoplayPolicy.h */; };
                5C9E56821DF7F1AB00C9EE33 /* WKWebsitePolicies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C9E56801DF7F05500C9EE33 /* WKWebsitePolicies.cpp */; };
                5C9E56831DF7F1B300C9EE33 /* WKWebsitePolicies.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5CB2378B1DF0DE5300117AA3 /* _WKWebsitePolicies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB2378A1DF0DD4300117AA3 /* _WKWebsitePolicies.mm */; };
                5C0B177F1E7C886700E9123C /* NetworkSocketStream.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NetworkSocketStream.messages.in; path = NetworkProcess/NetworkSocketStream.messages.in; sourceTree = "<group>"; };
                5C0B17801E7C888000E9123C /* WebSocketStream.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebSocketStream.messages.in; path = Network/WebSocketStream.messages.in; sourceTree = "<group>"; };
                5C13024A1FE341A7000D9B31 /* WebsitePoliciesData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsitePoliciesData.h; sourceTree = "<group>"; };
-               5C13024B1FE35142000D9B31 /* WebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsitePolicies.h; sourceTree = "<group>"; };
                5C1426E21C23F80500D41183 /* NetworkProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessCreationParameters.cpp; path = NetworkProcess/NetworkProcessCreationParameters.cpp; sourceTree = "<group>"; };
                5C1426E31C23F80500D41183 /* NetworkProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessCreationParameters.h; path = NetworkProcess/NetworkProcessCreationParameters.h; sourceTree = "<group>"; };
                5C1426E41C23F80500D41183 /* NetworkProcessSupplement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessSupplement.h; path = NetworkProcess/NetworkProcessSupplement.h; sourceTree = "<group>"; };
                5C7C88DC1D0F41A0009D2F6D /* WebSocketProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebSocketProvider.h; path = Network/WebSocketProvider.h; sourceTree = "<group>"; };
                5C84CF901F96AC4E00B6705A /* NetworkSessionCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkSessionCreationParameters.h; path = NetworkProcess/NetworkSessionCreationParameters.h; sourceTree = "<group>"; };
                5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PendingDownload.cpp; path = NetworkProcess/Downloads/PendingDownload.cpp; sourceTree = "<group>"; };
+               5C8DD37C1FE4501100F2A556 /* APIWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIWebsitePolicies.h; sourceTree = "<group>"; };
+               5C8DD37D1FE4501100F2A556 /* APIWebsitePolicies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIWebsitePolicies.cpp; sourceTree = "<group>"; };
+               5C8DD37F1FE4519200F2A556 /* WebsiteAutoplayPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteAutoplayPolicy.h; sourceTree = "<group>"; };
+               5C8DD3811FE455CA00F2A556 /* WebsiteAutoplayQuirk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteAutoplayQuirk.h; sourceTree = "<group>"; };
                5C9E56801DF7F05500C9EE33 /* WKWebsitePolicies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebsitePolicies.cpp; sourceTree = "<group>"; };
                5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsitePolicies.h; sourceTree = "<group>"; };
                5CB237891DF0DD4300117AA3 /* _WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebsitePolicies.h; sourceTree = "<group>"; };
                                37948402150C350600E52CE9 /* WebRenderLayer.h */,
                                3760881C150413E900FC82C7 /* WebRenderObject.cpp */,
                                3760881D150413E900FC82C7 /* WebRenderObject.h */,
+                               5C8DD37F1FE4519200F2A556 /* WebsiteAutoplayPolicy.h */,
+                               5C8DD3811FE455CA00F2A556 /* WebsiteAutoplayQuirk.h */,
                                511F7D3F1EB1BCEE00E47B83 /* WebsiteDataStoreParameters.cpp */,
                                511F7D401EB1BCEE00E47B83 /* WebsiteDataStoreParameters.h */,
                                5C3AEA8E1FE1F1DF002318D3 /* WebsitePoliciesData.cpp */,
                                7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */,
                                6B821DDB1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.cpp */,
                                6B821DDA1EEF05DD00D7AF4A /* WebResourceLoadStatisticsTelemetry.h */,
-                               5C13024B1FE35142000D9B31 /* WebsitePolicies.h */,
                                51D124241E6D3CC3002B2820 /* WebURLSchemeHandler.cpp */,
                                51D124251E6D3CC3002B2820 /* WebURLSchemeHandler.h */,
                                51E8B68D1E712873001B7132 /* WebURLSchemeTask.cpp */,
                                1AE286821C7F93860069AC4F /* APIWebsiteDataRecord.h */,
                                1A3635A71A3144A300ED6197 /* APIWebsiteDataStore.cpp */,
                                1A3635A81A3144A300ED6197 /* APIWebsiteDataStore.h */,
+                               5C8DD37D1FE4501100F2A556 /* APIWebsitePolicies.cpp */,
+                               5C8DD37C1FE4501100F2A556 /* APIWebsitePolicies.h */,
                                1A6563E21B7A8C50009CF787 /* APIWindowFeatures.cpp */,
                                1A6563E31B7A8C50009CF787 /* APIWindowFeatures.h */,
                        );
                                7C361D731927FA360036A59D /* WebScriptMessageHandler.h in Headers */,
                                D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
                                51BEB62C1F3A5AD7005029B9 /* WebServiceWorkerProvider.h in Headers */,
+                               5C8DD3801FE4521600F2A556 /* WebsiteAutoplayPolicy.h in Headers */,
                                1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */,
                                1A4832D11A9BDC2F008B4DFE /* WebsiteDataRecord.h in Headers */,
                                1A53C2AA1A325730004E8C70 /* WebsiteDataStore.h in Headers */,
                                511F7D411EB1BCF500E47B83 /* WebsiteDataStoreParameters.h in Headers */,
-                               5C13024C1FE35154000D9B31 /* WebsitePolicies.h in Headers */,
                                836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */,
                                1A52C0F81A38CDC70016160A /* WebStorageNamespaceProvider.h in Headers */,
                                517A53051F4793C600DCDC0A /* WebSWClientConnection.h in Headers */,
                                1AE286831C7F93860069AC4F /* APIWebsiteDataRecord.cpp in Sources */,
                                1A3635A91A3144A300ED6197 /* APIWebsiteDataStore.cpp in Sources */,
                                1A3635AD1A3145E500ED6197 /* APIWebsiteDataStoreCocoa.mm in Sources */,
+                               5C8DD37E1FE4502000F2A556 /* APIWebsitePolicies.cpp in Sources */,
                                1A6563E41B7A8C50009CF787 /* APIWindowFeatures.cpp in Sources */,
                                1AD4C1921B39F33200ABC28E /* ApplicationStateTracker.mm in Sources */,
                                1A3D610513A7F03A00F95D4E /* ArgumentCoders.cpp in Sources */,
index eef4420..6375fef 100644 (file)
 #include "WebUserMediaClient.h"
 #include "WebValidationMessageClient.h"
 #include "WebsiteDataStoreParameters.h"
-#include "WebsitePolicies.h"
 #include <JavaScriptCore/APICast.h>
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/ArchiveResource.h>