[WebIDL] Remove custom bindings for MockContentFilterSettings
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2017 20:14:31 +0000 (20:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jul 2017 20:14:31 +0000 (20:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174606

Patch by Sam Weinig <sam@webkit.org> on 2017-07-18
Reviewed by Andy Estes.

Source/WebCore:

* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMockContentFilterSettingsCustom.cpp: Removed.
Remove JSMockContentFilterSettingsCustom.

* testing/MockContentFilterSettings.h:
* testing/MockContentFilterSettings.idl:
Switch from constants to IDL enums to make the bindings and tests simpler.

LayoutTests:

* contentfiltering/allow-after-add-data.html:
* contentfiltering/allow-after-finished-adding-data.html:
* contentfiltering/allow-after-response.html:
* contentfiltering/allow-after-will-send-request.html:
* contentfiltering/allow-empty-document.html:
* contentfiltering/allow-media-document.html:
* contentfiltering/allow-never.html:
* contentfiltering/block-after-add-data-then-allow-unblock.html:
* contentfiltering/block-after-add-data-then-deny-unblock.html:
* contentfiltering/block-after-add-data.html:
* contentfiltering/block-after-finished-adding-data-then-allow-unblock.html:
* contentfiltering/block-after-finished-adding-data-then-deny-unblock.html:
* contentfiltering/block-after-finished-adding-data.html:
* contentfiltering/block-after-response-then-allow-unblock.html:
* contentfiltering/block-after-response-then-deny-unblock.html:
* contentfiltering/block-after-response.html:
* contentfiltering/block-after-will-send-request-then-allow-unblock.html:
* contentfiltering/block-after-will-send-request-then-deny-unblock.html:
* contentfiltering/block-after-will-send-request.html:
* contentfiltering/block-never.html:
* contentfiltering/modify-request-url.html:
* contentfiltering/resources/contentfiltering.js:
* http/tests/contentfiltering/allow-after-redirect.html:
* http/tests/contentfiltering/block-after-redirect.html:
* http/tests/contentfiltering/load-substitute-data-from-appcache.html:
* http/tests/contentfiltering/modify-redirect-request-url.html:
Update tests to use new MockContentFilterSettings enums rather than constants.

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

33 files changed:
LayoutTests/ChangeLog
LayoutTests/contentfiltering/allow-after-add-data.html
LayoutTests/contentfiltering/allow-after-finished-adding-data.html
LayoutTests/contentfiltering/allow-after-response.html
LayoutTests/contentfiltering/allow-after-will-send-request.html
LayoutTests/contentfiltering/allow-empty-document.html
LayoutTests/contentfiltering/allow-media-document.html
LayoutTests/contentfiltering/allow-never.html
LayoutTests/contentfiltering/block-after-add-data-then-allow-unblock.html
LayoutTests/contentfiltering/block-after-add-data-then-deny-unblock.html
LayoutTests/contentfiltering/block-after-add-data.html
LayoutTests/contentfiltering/block-after-finished-adding-data-then-allow-unblock.html
LayoutTests/contentfiltering/block-after-finished-adding-data-then-deny-unblock.html
LayoutTests/contentfiltering/block-after-finished-adding-data.html
LayoutTests/contentfiltering/block-after-response-then-allow-unblock.html
LayoutTests/contentfiltering/block-after-response-then-deny-unblock.html
LayoutTests/contentfiltering/block-after-response.html
LayoutTests/contentfiltering/block-after-will-send-request-then-allow-unblock.html
LayoutTests/contentfiltering/block-after-will-send-request-then-deny-unblock.html
LayoutTests/contentfiltering/block-after-will-send-request.html
LayoutTests/contentfiltering/block-never.html
LayoutTests/contentfiltering/modify-request-url.html
LayoutTests/contentfiltering/resources/contentfiltering.js
LayoutTests/http/tests/contentfiltering/allow-after-redirect.html
LayoutTests/http/tests/contentfiltering/block-after-redirect.html
LayoutTests/http/tests/contentfiltering/load-substitute-data-from-appcache.html
LayoutTests/http/tests/contentfiltering/modify-redirect-request-url.html
Source/WebCore/ChangeLog
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp [deleted file]
Source/WebCore/testing/MockContentFilterSettings.h
Source/WebCore/testing/MockContentFilterSettings.idl

index c4466f6..b37bb67 100644 (file)
@@ -1,5 +1,40 @@
 2017-07-18  Sam Weinig  <sam@webkit.org>
 
+        [WebIDL] Remove custom bindings for MockContentFilterSettings
+        https://bugs.webkit.org/show_bug.cgi?id=174606
+
+        Reviewed by Andy Estes.
+
+        * contentfiltering/allow-after-add-data.html:
+        * contentfiltering/allow-after-finished-adding-data.html:
+        * contentfiltering/allow-after-response.html:
+        * contentfiltering/allow-after-will-send-request.html:
+        * contentfiltering/allow-empty-document.html:
+        * contentfiltering/allow-media-document.html:
+        * contentfiltering/allow-never.html:
+        * contentfiltering/block-after-add-data-then-allow-unblock.html:
+        * contentfiltering/block-after-add-data-then-deny-unblock.html:
+        * contentfiltering/block-after-add-data.html:
+        * contentfiltering/block-after-finished-adding-data-then-allow-unblock.html:
+        * contentfiltering/block-after-finished-adding-data-then-deny-unblock.html:
+        * contentfiltering/block-after-finished-adding-data.html:
+        * contentfiltering/block-after-response-then-allow-unblock.html:
+        * contentfiltering/block-after-response-then-deny-unblock.html:
+        * contentfiltering/block-after-response.html:
+        * contentfiltering/block-after-will-send-request-then-allow-unblock.html:
+        * contentfiltering/block-after-will-send-request-then-deny-unblock.html:
+        * contentfiltering/block-after-will-send-request.html:
+        * contentfiltering/block-never.html:
+        * contentfiltering/modify-request-url.html:
+        * contentfiltering/resources/contentfiltering.js:
+        * http/tests/contentfiltering/allow-after-redirect.html:
+        * http/tests/contentfiltering/block-after-redirect.html:
+        * http/tests/contentfiltering/load-substitute-data-from-appcache.html:
+        * http/tests/contentfiltering/modify-redirect-request-url.html:
+        Update tests to use new MockContentFilterSettings enums rather than constants.
+
+2017-07-18  Sam Weinig  <sam@webkit.org>
+
         [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
         https://bugs.webkit.org/show_bug.cgi?id=174529
 
index 3964729..70d9988 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_ALLOW);
+    testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"allow");
 }
 </script>
index 6ba1ab1..d837e02 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_ALLOW);
+    testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"allow");
 }
 </script>
index 3e9a92d..03514a1 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_ALLOW);
+    testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"allow");
 }
 </script>
index 115ae59..5a9e498 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_ALLOW);
+    testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"allow");
 }
 </script>
index 4f1c050..2d722fd 100644 (file)
@@ -3,8 +3,8 @@
     if (window.internals) {
         var settings = window.internals.mockContentFilterSettings;
         settings.enabled = true;
-        settings.decisionPoint = settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA;
-        settings.decision = settings.DECISION_ALLOW;
+        settings.decisionPoint = "afterFinishedAddingData";
+        settings.decision = "allow";
     }
 </script>
 <iframe src="resources/empty.html"></iframe>
index 888a324..2b6201f 100644 (file)
@@ -3,8 +3,8 @@
     if (window.internals) {
         var settings = window.internals.mockContentFilterSettings;
         settings.enabled = true;
-        settings.decisionPoint = settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA;
-        settings.decision = settings.DECISION_ALLOW;
+        settings.decisionPoint = "afterFinishedAddingData";
+        settings.decision = "allow";
     }
 
     if (window.testRunner)
index ae881b7..ecd1551 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_ALLOW);
+    testContentFiltering(/* decisionPoint */"never", /* decision */"allow");
 }
 </script>
index 0bf6be3..40105df 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"allow", /* decideAfterUnblockRequest */true);
 }
 </script>
index c8ee59e..32565a6 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"block", /* decideAfterUnblockRequest */true);
 }
 </script>
index 885b84a..323eac7 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_ADD_DATA, /* decision */settings.DECISION_BLOCK);
+    testContentFiltering(/* decisionPoint */"afterAddData", /* decision */"block");
 }
 </script>
index 74ef542..cc73b9f 100644 (file)
@@ -4,6 +4,6 @@
 var internals = window.internals;
 if (internals) {
     var settings = internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"allow", /* decideAfterUnblockRequest */true);
 }
 </script>
index 1f55881..27dd975 100644 (file)
@@ -4,6 +4,6 @@
 var internals = window.internals;
 if (internals) {
     var settings = internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"block", /* decideAfterUnblockRequest */true);
 }
 </script>
index 13d55c4..42751dc 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_FINISHED_ADDING_DATA, /* decision */settings.DECISION_BLOCK);
+    testContentFiltering(/* decisionPoint */"afterFinishedAddingData", /* decision */"block");
 }
 </script>
index 06cff59..c0502bc 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"allow", /* decideAfterUnblockRequest */true);
 }
 </script>
index 5c3479c..93283e3 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"block", /* decideAfterUnblockRequest */true);
 }
 </script>
index e7428d6..00f237d 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_RESPONSE, /* decision */settings.DECISION_BLOCK);
+    testContentFiltering(/* decisionPoint */"afterResponse", /* decision */"block");
 }
 </script>
index 3daa31b..fd492a8 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_ALLOW, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"allow", /* decideAfterUnblockRequest */true);
 }
 </script>
index 227b7c4..ef7c8f1 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_BLOCK, /* decideAfterUnblockRequest */true);
+    testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"block", /* decideAfterUnblockRequest */true);
 }
 </script>
index 3c9f66e..dacc1f9 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST, /* decision */settings.DECISION_BLOCK);
+    testContentFiltering(/* decisionPoint */"afterWillSendRequest", /* decision */"block");
 }
 </script>
index d865e1a..6d31c9e 100644 (file)
@@ -3,6 +3,6 @@
 <script>
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
-    testContentFiltering(/* decisionPoint */settings.DECISION_POINT_NEVER, /* decision */settings.DECISION_BLOCK);
+    testContentFiltering(/* decisionPoint */"never", /* decision */"block");
 }
 </script>
index 714d0bb..e7dec22 100644 (file)
@@ -3,8 +3,8 @@
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
-    settings.decisionPoint = settings.DECISION_POINT_AFTER_WILL_SEND_REQUEST;
-    settings.decision = settings.DECISION_ALLOW;
+    settings.decisionPoint = "afterWillSendRequest";
+    settings.decision = "allow";
     settings.modifiedRequestURL = "pass.html";
 }
 </script>
index 61bf457..77f5c2f 100644 (file)
@@ -3,10 +3,10 @@ function _doTest(decisionPoint, decision, decideAfterUnblockRequest)
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
     settings.decisionPoint = decisionPoint;
-    settings.decision = (decideAfterUnblockRequest ? settings.DECISION_BLOCK : decision);
+    settings.decision = (decideAfterUnblockRequest ? "block" : decision);
     
     var blockedStringText;
-    if (decisionPoint === settings.DECISION_POINT_NEVER || decision === settings.DECISION_ALLOW)
+    if (decisionPoint === "never" || decision === "allow")
         blockedStringText = "FAIL";
     else
         blockedStringText =  "PASS";
index 08bc208..ac16734 100644 (file)
@@ -3,8 +3,8 @@
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
-    settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
-    settings.decision = settings.DECISION_ALLOW;
+    settings.decisionPoint = "afterRedirect";
+    settings.decision = "allow";
     settings.blockedString = "<!DOCTYPE html><body>FAIL";
 }
 </script>
index 6a65b32..4c7b8c6 100644 (file)
@@ -4,8 +4,8 @@
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
-    settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
-    settings.decision = settings.DECISION_BLOCK;
+    settings.decisionPoint = "afterRedirect";
+    settings.decision = "block";
     settings.blockedString = "<!DOCTYPE html><body>PASS";
 }
 
index a28d9c8..2abb92b 100644 (file)
@@ -3,8 +3,8 @@
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
-    settings.decisionPoint = settings.DECISION_POINT_AFTER_ADD_DATA;
-    settings.decision = settings.DECISION_ALLOW;
+    settings.decisionPoint = "afterAddData";
+    settings.decision = "allow";
 }
 
 if (window.testRunner) {
index f562972..7627db8 100644 (file)
@@ -3,8 +3,8 @@
 if (window.internals) {
     var settings = window.internals.mockContentFilterSettings;
     settings.enabled = true;
-    settings.decisionPoint = settings.DECISION_POINT_AFTER_REDIRECT;
-    settings.decision = settings.DECISION_ALLOW;
+    settings.decisionPoint = "afterRedirect";
+    settings.decision = "allow";
     settings.modifiedRequestURL = "pass.html";
 }
 </script>
index 31840e8..5a915d6 100644 (file)
@@ -1,5 +1,21 @@
 2017-07-18  Sam Weinig  <sam@webkit.org>
 
+        [WebIDL] Remove custom bindings for MockContentFilterSettings
+        https://bugs.webkit.org/show_bug.cgi?id=174606
+
+        Reviewed by Andy Estes.
+
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSMockContentFilterSettingsCustom.cpp: Removed.
+        Remove JSMockContentFilterSettingsCustom.
+
+        * testing/MockContentFilterSettings.h:
+        * testing/MockContentFilterSettings.idl:
+        Switch from constants to IDL enums to make the bindings and tests simpler.
+
+2017-07-18  Sam Weinig  <sam@webkit.org>
+
         [WebIDL] Replace some custom bindings code in JSCSSStyleDeclarationCustom.cpp with named getters/setters
         https://bugs.webkit.org/show_bug.cgi?id=174529
 
index d5d9b22..3a68254 100644 (file)
@@ -800,8 +800,6 @@ set(ADDITIONAL_BINDINGS_DEPENDENCIES
 
 list(APPEND WebCoreTestSupport_LIBRARIES PRIVATE WebCore)
 list(APPEND WebCoreTestSupport_SOURCES
-    bindings/js/JSMockContentFilterSettingsCustom.cpp
-
     testing/Internals.mm
     testing/MockContentFilter.cpp
     testing/MockContentFilterSettings.cpp
index b49f103..5c7127c 100644 (file)
                A1E1154413015C3D0054AC8C /* DistantLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */; };
                A1E1154613015C4E0054AC8C /* PointLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154513015C4E0054AC8C /* PointLightSource.cpp */; };
                A1E1154813015C5D0054AC8C /* SpotLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */; };
-               A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */; };
                A1ED778C1BE3294000DC1791 /* Device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1ED778A1BE3293F00DC1791 /* Device.cpp */; };
                A1ED778D1BE3294000DC1791 /* Device.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778B1BE3294000DC1791 /* Device.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1ED778F1BE4291800DC1791 /* UIKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778E1BE4291800DC1791 /* UIKitSPI.h */; };
                A1E1154313015C3D0054AC8C /* DistantLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DistantLightSource.cpp; sourceTree = "<group>"; };
                A1E1154513015C4E0054AC8C /* PointLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointLightSource.cpp; sourceTree = "<group>"; };
                A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpotLightSource.cpp; sourceTree = "<group>"; };
-               A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockContentFilterSettingsCustom.cpp; sourceTree = "<group>"; };
                A1ED778A1BE3293F00DC1791 /* Device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Device.cpp; sourceTree = "<group>"; };
                A1ED778B1BE3294000DC1791 /* Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Device.h; sourceTree = "<group>"; };
                A1ED778E1BE4291800DC1791 /* UIKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSPI.h; sourceTree = "<group>"; };
                                7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */,
                                BCE1C43F0D9830F4003B02F2 /* JSLocationCustom.cpp */,
                                410B7E711045FAB000D8224F /* JSMessageEventCustom.cpp */,
-                               A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */,
                                C6F0917E143A2BB900685849 /* JSMutationObserverCustom.cpp */,
                                A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
                                418C395D1C8F0AAB0051C8A3 /* JSReadableStreamSourceCustom.cpp */,
                                CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
                                CDF4B7321E03D06000E235A2 /* JSMockCDMFactory.cpp in Sources */,
                                A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */,
-                               A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */,
                                2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
                                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
                                CDC26B40160A8CC60026757B /* LegacyMockCDM.cpp in Sources */,
diff --git a/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp b/Source/WebCore/bindings/js/JSMockContentFilterSettingsCustom.cpp
deleted file mode 100644 (file)
index 0fb5e28..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2015-2016 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 "JSMockContentFilterSettings.h"
-
-#if ENABLE(CONTENT_FILTERING)
-
-#include "JSDOMBinding.h"
-#include "JSDOMConvertNumbers.h"
-#include "MockContentFilterSettings.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-using Decision = MockContentFilterSettings::Decision;
-using DecisionPoint = MockContentFilterSettings::DecisionPoint;
-
-JSValue JSMockContentFilterSettings::decisionPoint(ExecState&) const
-{
-    DecisionPoint decisionPoint = wrapped().decisionPoint();
-    switch (decisionPoint) {
-    case DecisionPoint::AfterWillSendRequest:
-    case DecisionPoint::AfterRedirect:
-    case DecisionPoint::AfterResponse:
-    case DecisionPoint::AfterAddData:
-    case DecisionPoint::AfterFinishedAddingData:
-    case DecisionPoint::Never:
-        return jsNumber(static_cast<uint8_t>(decisionPoint));
-    }
-
-    ASSERT_NOT_REACHED();
-    return jsUndefined();
-}
-
-void JSMockContentFilterSettings::setDecisionPoint(ExecState& state, JSValue value)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    uint8_t nativeValue { convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, value) };
-    RETURN_IF_EXCEPTION(scope, void());
-
-    DecisionPoint decisionPoint { static_cast<DecisionPoint>(nativeValue) };
-    switch (decisionPoint) {
-    case DecisionPoint::AfterWillSendRequest:
-    case DecisionPoint::AfterRedirect:
-    case DecisionPoint::AfterResponse:
-    case DecisionPoint::AfterAddData:
-    case DecisionPoint::AfterFinishedAddingData:
-    case DecisionPoint::Never:
-        wrapped().setDecisionPoint(decisionPoint);
-        return;
-    }
-
-    throwTypeError(&state, scope, String::format("%u is not a valid decisionPoint value.", nativeValue));
-}
-
-static inline JSValue toJSValue(Decision decision)
-{
-    switch (decision) {
-    case Decision::Allow:
-    case Decision::Block:
-        return jsNumber(static_cast<uint8_t>(decision));
-    }
-
-    ASSERT_NOT_REACHED();
-    return jsUndefined();
-}
-
-static inline Decision toDecision(ExecState& state, JSValue value)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    uint8_t nativeValue { convert<IDLEnforceRangeAdaptor<IDLOctet>>(state, value) };
-    RETURN_IF_EXCEPTION(scope, Decision::Allow);
-
-    Decision decision { static_cast<Decision>(nativeValue) };
-    switch (decision) {
-    case Decision::Allow:
-    case Decision::Block:
-        return decision;
-    }
-
-    throwTypeError(&state, scope, String::format("%u is not a valid decision value.", nativeValue));
-    return Decision::Allow;
-}
-
-JSValue JSMockContentFilterSettings::decision(ExecState&) const
-{
-    return toJSValue(wrapped().decision());
-}
-
-void JSMockContentFilterSettings::setDecision(ExecState& state, JSValue value)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    Decision decision { toDecision(state, value) };
-    RETURN_IF_EXCEPTION(scope, void());
-
-    wrapped().setDecision(decision);
-}
-
-JSValue JSMockContentFilterSettings::unblockRequestDecision(ExecState&) const
-{
-    return toJSValue(wrapped().unblockRequestDecision());
-}
-
-void JSMockContentFilterSettings::setUnblockRequestDecision(ExecState& state, JSValue value)
-{
-    VM& vm = state.vm();
-    auto scope = DECLARE_THROW_SCOPE(vm);
-
-    Decision unblockRequestDecision { toDecision(state, value) };
-    RETURN_IF_EXCEPTION(scope, void());
-
-    wrapped().setUnblockRequestDecision(unblockRequestDecision);
-}
-
-}; // namespace WebCore
-
-#endif // ENABLE(CONTENT_FILTERING)
index 5cbadca..33d21a0 100644 (file)
@@ -31,7 +31,6 @@ namespace WebCore {
 
 class MockContentFilterSettings {
     friend class NeverDestroyed<MockContentFilterSettings>;
-
 public:
     enum class DecisionPoint {
         AfterWillSendRequest,
index d401ae9..c20d350 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+enum DecisionPoint {
+    "afterWillSendRequest",
+    "afterRedirect",
+    "afterResponse",
+    "afterAddData",
+    "afterFinishedAddingData",
+    "never"
+};
+
+enum Decision {
+    "allow",
+    "block"
+};
+
 [
     Conditional=CONTENT_FILTERING,
     NoInterfaceObject,
     attribute DOMString blockedString;
     attribute DOMString modifiedRequestURL;
 
-    const octet DECISION_POINT_AFTER_WILL_SEND_REQUEST = 0;
-    const octet DECISION_POINT_AFTER_REDIRECT = 1;
-    const octet DECISION_POINT_AFTER_RESPONSE = 2;
-    const octet DECISION_POINT_AFTER_ADD_DATA = 3;
-    const octet DECISION_POINT_AFTER_FINISHED_ADDING_DATA = 4;
-    const octet DECISION_POINT_NEVER = 5;
-    [Custom] attribute octet decisionPoint;
+    attribute DecisionPoint decisionPoint;
 
-    const octet DECISION_ALLOW = 0;
-    const octet DECISION_BLOCK = 1;
-    [Custom] attribute octet decision;
-    [Custom] attribute octet unblockRequestDecision;
+    attribute Decision decision;
+    attribute Decision unblockRequestDecision;
 
     readonly attribute DOMString unblockRequestURL;
 };