Title: [236930] trunk
Revision
236930
Author
[email protected]
Date
2018-10-08 12:58:09 -0700 (Mon, 08 Oct 2018)

Log Message

Remove WKBundleFileHandleRef
https://bugs.webkit.org/show_bug.cgi?id=190360

Reviewed by Tim Horton.

Source/WebKit:

WKBundleFrameGetJavaScriptWrapperForFileForWorld and WKBundleFileHandleCreateWithPath were only used in Mail
and were removed in rdar://problem/44955158
I need to remove them for rdar://problem/24576194

* Shared/API/APIObject.h:
* Shared/API/c/WKDeprecated.h:
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKBundleFrameGetJavaScriptWrapperForFileForWorld):
(WKBundleFileHandleCreateWithPath):
* Sources.txt:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Removed.
* WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetJavaScriptWrapperForFileForWorld): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
* WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Removed.
* WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Removed.
* WebProcess/WebPage/WebFrame.cpp:
* WebProcess/WebPage/WebFrame.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp: Removed.
* TestWebKitAPI/Tests/WebKit/WKBundleFileHandle_Bundle.cpp: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236929 => 236930)


--- trunk/Source/WebKit/ChangeLog	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/ChangeLog	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,3 +1,33 @@
+2018-10-08  Alex Christensen  <[email protected]>
+
+        Remove WKBundleFileHandleRef
+        https://bugs.webkit.org/show_bug.cgi?id=190360
+
+        Reviewed by Tim Horton.
+
+        WKBundleFrameGetJavaScriptWrapperForFileForWorld and WKBundleFileHandleCreateWithPath were only used in Mail
+        and were removed in rdar://problem/44955158
+        I need to remove them for rdar://problem/24576194
+
+        * Shared/API/APIObject.h:
+        * Shared/API/c/WKDeprecated.h:
+        * Shared/API/c/WKDeprecatedFunctions.cpp:
+        (WKBundleFrameGetJavaScriptWrapperForFileForWorld):
+        (WKBundleFileHandleCreateWithPath):
+        * Sources.txt:
+        * SourcesCocoa.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Removed.
+        * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h:
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
+        (WKBundleFrameGetJavaScriptWrapperForFileForWorld): Deleted.
+        * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
+        * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Removed.
+        * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Removed.
+        * WebProcess/WebPage/WebFrame.cpp:
+        * WebProcess/WebPage/WebFrame.h:
+
 2018-10-08  Konstantin Tokarev  <[email protected]>
 
         Validation in Connection::readBytesFromSocket() is too aggressive

Modified: trunk/Source/WebKit/Shared/API/APIObject.h (236929 => 236930)


--- trunk/Source/WebKit/Shared/API/APIObject.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/Shared/API/APIObject.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -177,7 +177,6 @@
         BundleBackForwardListItem,
         BundleCSSStyleDeclarationHandle,
         BundleDOMWindowExtension,
-        BundleFileHandle,
         BundleFrame,
         BundleHitTestResult,
         BundleInspector,

Modified: trunk/Source/WebKit/Shared/API/c/WKDeprecated.h (236929 => 236930)


--- trunk/Source/WebKit/Shared/API/c/WKDeprecated.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/Shared/API/c/WKDeprecated.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -26,7 +26,9 @@
 #pragma once
 
 #ifdef _MSC_VER
+#define WK_C_API_DEPRECATED(...)
 #define WK_C_API_DEPRECATED_WITH_REPLACEMENT(...)
 #else
+#define WK_C_API_DEPRECATED(_message, ...) __attribute__((deprecated(_message)))
 #define WK_C_API_DEPRECATED_WITH_REPLACEMENT(_replacement, ...) __attribute__((deprecated("use " #_replacement)))
 #endif

Modified: trunk/Source/WebKit/Shared/API/c/WKDeprecatedFunctions.cpp (236929 => 236930)


--- trunk/Source/WebKit/Shared/API/c/WKDeprecatedFunctions.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/Shared/API/c/WKDeprecatedFunctions.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -29,6 +29,8 @@
 #include "APIDictionary.h"
 #include "WKAPICast.h"
 #include "WKArray.h"
+#include "WKBundleFileHandleRef.h"
+#include "WKBundleFrame.h"
 #include "WKContextPrivate.h"
 #include "WKMutableDictionary.h"
 #include "WKPageGroup.h"
@@ -36,14 +38,8 @@
 #include "WebPageGroup.h"
 #include "WebUserContentControllerProxy.h"
 
-#if PLATFORM(MAC)
-#include "WKContextPrivateMac.h"
-#endif
-
 // Deprecated functions that should be removed from the framework once nobody uses them.
 
-using namespace WebKit;
-
 void WKContextSetUsesNetworkProcess(WKContextRef, bool)
 {
 }
@@ -60,3 +56,13 @@
 {
     return false;
 }
+
+JSValueRef WKBundleFrameGetJavaScriptWrapperForFileForWorld(WKBundleFrameRef, WKBundleFileHandleRef, WKBundleScriptWorldRef)
+{
+    return nullptr;
+}
+
+WKBundleFileHandleRef WKBundleFileHandleCreateWithPath(WKStringRef)
+{
+    return nullptr;
+}

Modified: trunk/Source/WebKit/Sources.txt (236929 => 236930)


--- trunk/Source/WebKit/Sources.txt	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/Sources.txt	2018-10-08 19:58:09 UTC (rev 236930)
@@ -444,7 +444,6 @@
 WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp
 
 WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp
-WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp
 WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp @no-unify
 WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp @no-unify
 

Modified: trunk/Source/WebKit/SourcesCocoa.txt (236929 => 236930)


--- trunk/Source/WebKit/SourcesCocoa.txt	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/SourcesCocoa.txt	2018-10-08 19:58:09 UTC (rev 236930)
@@ -480,7 +480,6 @@
 
 WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm
 
-WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp
 WebProcess/InjectedBundle/API/c/WKBundlePageBanner.cpp
 
 WebProcess/InjectedBundle/API/c/mac/WKBundleMac.mm

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (236929 => 236930)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1141,7 +1141,6 @@
 		7CB365AA1D31DB70007158CA /* _WKUserInitiatedAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CB365A81D31DB70007158CA /* _WKUserInitiatedAction.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7CB365AD1D31DC10007158CA /* _WKUserInitiatedActionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CB365AC1D31DC10007158CA /* _WKUserInitiatedActionInternal.h */; };
 		7CB365B11D31DD1E007158CA /* APIUserInitiatedAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CB365AF1D31DD1E007158CA /* APIUserInitiatedAction.h */; };
-		7CBB811D1AA0F8B1006B1942 /* InjectedBundleFileHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CBB811B1AA0F8B1006B1942 /* InjectedBundleFileHandle.h */; };
 		7CBB81211AA0F970006B1942 /* WKBundleFileHandleRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CBB811F1AA0F970006B1942 /* WKBundleFileHandleRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		7CC99A3618EF7CBC0048C8B4 /* WKScriptMessageInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CC99A3518EF7CBC0048C8B4 /* WKScriptMessageInternal.h */; };
 		7CCCC8FB1A5F50FD008FB0DA /* WebNavigationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CCCC8F91A5F50FD008FB0DA /* WebNavigationState.h */; };
@@ -3572,9 +3571,6 @@
 		7CB365A91D31DB70007158CA /* _WKUserInitiatedAction.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKUserInitiatedAction.mm; sourceTree = "<group>"; };
 		7CB365AC1D31DC10007158CA /* _WKUserInitiatedActionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKUserInitiatedActionInternal.h; sourceTree = "<group>"; };
 		7CB365AF1D31DD1E007158CA /* APIUserInitiatedAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIUserInitiatedAction.h; sourceTree = "<group>"; };
-		7CBB811A1AA0F8B1006B1942 /* InjectedBundleFileHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleFileHandle.cpp; sourceTree = "<group>"; };
-		7CBB811B1AA0F8B1006B1942 /* InjectedBundleFileHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleFileHandle.h; sourceTree = "<group>"; };
-		7CBB811E1AA0F970006B1942 /* WKBundleFileHandleRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleFileHandleRef.cpp; sourceTree = "<group>"; };
 		7CBB811F1AA0F970006B1942 /* WKBundleFileHandleRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleFileHandleRef.h; sourceTree = "<group>"; };
 		7CC99A3518EF7CBC0048C8B4 /* WKScriptMessageInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKScriptMessageInternal.h; sourceTree = "<group>"; };
 		7CCCC8F81A5F50FD008FB0DA /* WebNavigationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNavigationState.cpp; sourceTree = "<group>"; };
@@ -7752,7 +7748,6 @@
 				935EEB981277616D003322B8 /* WKBundleBackForwardListItem.h */,
 				51FA2D7515212E1E00C1BA0B /* WKBundleDOMWindowExtension.cpp */,
 				51FA2D541521118600C1BA0B /* WKBundleDOMWindowExtension.h */,
-				7CBB811E1AA0F970006B1942 /* WKBundleFileHandleRef.cpp */,
 				7CBB811F1AA0F970006B1942 /* WKBundleFileHandleRef.h */,
 				BCD25F1611D6BDE100169B0E /* WKBundleFrame.cpp */,
 				BCD25F1511D6BDE100169B0E /* WKBundleFrame.h */,
@@ -7860,8 +7855,6 @@
 			children = (
 				7C4ED3261A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.cpp */,
 				7C4ED3271A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.h */,
-				7CBB811A1AA0F8B1006B1942 /* InjectedBundleFileHandle.cpp */,
-				7CBB811B1AA0F8B1006B1942 /* InjectedBundleFileHandle.h */,
 				BC4BEEAA120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp */,
 				BC4BEEA9120A0A5E00FBA0C7 /* InjectedBundleNodeHandle.h */,
 				BC33E0D012408E8600360F3F /* InjectedBundleRangeHandle.cpp */,
@@ -8915,7 +8908,6 @@
 				935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */,
 				935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */,
 				BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */,
-				7CBB811D1AA0F8B1006B1942 /* InjectedBundleFileHandle.h in Headers */,
 				BC498618124D10E200D834E1 /* InjectedBundleHitTestResult.h in Headers */,
 				84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */,
 				BC8147D512F66D31007B2C32 /* InjectedBundleNavigationAction.h in Headers */,

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -39,7 +39,6 @@
 class InjectedBundleBackForwardListItem;
 class InjectedBundleCSSStyleDeclarationHandle;
 class InjectedBundleDOMWindowExtension;
-class InjectedBundleFileHandle;
 class InjectedBundleHitTestResult;
 class InjectedBundleNavigationAction;
 class InjectedBundleNodeHandle;
@@ -56,7 +55,6 @@
 WK_ADD_API_MAPPING(WKBundleBackForwardListRef, InjectedBundleBackForwardList)
 WK_ADD_API_MAPPING(WKBundleCSSStyleDeclarationRef, InjectedBundleCSSStyleDeclarationHandle)
 WK_ADD_API_MAPPING(WKBundleDOMWindowExtensionRef, InjectedBundleDOMWindowExtension)
-WK_ADD_API_MAPPING(WKBundleFileHandleRef, InjectedBundleFileHandle)
 WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
 WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
 WK_ADD_API_MAPPING(WKBundleInspectorRef, WebInspector)

Deleted: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2015 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 "WKBundleFileHandleRef.h"
-
-#include "InjectedBundleFileHandle.h"
-#include "WKAPICast.h"
-#include "WKBundleAPICast.h"
-
-using namespace WebKit;
-
-WKTypeID WKBundleFileHandleGetTypeID()
-{
-    return toAPI(InjectedBundleFileHandle::APIType);
-}
-
-WKBundleFileHandleRef WKBundleFileHandleCreateWithPath(WKStringRef pathRef)
-{
-    return toAPI(InjectedBundleFileHandle::create(toWTFString(pathRef)).leakRef());
-}
-
-WKBundleFileHandleRef WKBundleFileHandleCreateWithPathForPage(WKStringRef pathRef, WKBundlePageRef)
-{
-    return toAPI(InjectedBundleFileHandle::create(toWTFString(pathRef)).leakRef());
-}

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -33,11 +33,8 @@
 extern "C" {
 #endif
 
-WK_EXPORT WKTypeID WKBundleFileHandleGetTypeID();
+WK_EXPORT WKBundleFileHandleRef WKBundleFileHandleCreateWithPath(WKStringRef path) WK_C_API_DEPRECATED("No longer supported");
 
-WK_EXPORT WKBundleFileHandleRef WKBundleFileHandleCreateWithPath(WKStringRef path) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKBundleFileHandleCreateWithPathForPage);
-WK_EXPORT WKBundleFileHandleRef WKBundleFileHandleCreateWithPathForPage(WKStringRef path, WKBundlePageRef page);
-
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -29,7 +29,6 @@
 
 #include "APIArray.h"
 #include "APISecurityOrigin.h"
-#include "InjectedBundleFileHandle.h"
 #include "InjectedBundleHitTestResult.h"
 #include "InjectedBundleNodeHandle.h"
 #include "InjectedBundleRangeHandle.h"
@@ -123,11 +122,6 @@
     return toImpl(frameRef)->jsWrapperForWorld(toImpl(rangeHandleRef), toImpl(worldRef));
 }
 
-JSValueRef WKBundleFrameGetJavaScriptWrapperForFileForWorld(WKBundleFrameRef frameRef, WKBundleFileHandleRef fileHandleRef, WKBundleScriptWorldRef worldRef)
-{
-    return toImpl(frameRef)->jsWrapperForWorld(toImpl(fileHandleRef), toImpl(worldRef));
-}
-
 WKStringRef WKBundleFrameCopyName(WKBundleFrameRef frameRef)
 {
     return toCopiedAPI(toImpl(frameRef)->name());

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.h (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleFrame.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -28,6 +28,7 @@
 
 #include <_javascript_Core/_javascript_.h>
 #include <WebKit/WKBase.h>
+#include <WebKit/WKDeprecated.h>
 #include <WebKit/WKFrame.h>
 #include <WebKit/WKGeometry.h>
 
@@ -55,7 +56,7 @@
 
 WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForNodeForWorld(WKBundleFrameRef frame, WKBundleNodeHandleRef nodeHandle, WKBundleScriptWorldRef world);
 WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForRangeForWorld(WKBundleFrameRef frame, WKBundleRangeHandleRef rangeHandle, WKBundleScriptWorldRef world);
-WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForFileForWorld(WKBundleFrameRef frame, WKBundleFileHandleRef fileHandle, WKBundleScriptWorldRef world);
+WK_EXPORT JSValueRef WKBundleFrameGetJavaScriptWrapperForFileForWorld(WKBundleFrameRef frame, WKBundleFileHandleRef fileHandle, WKBundleScriptWorldRef world) WK_C_API_DEPRECATED("No longer supported");
 
 WK_EXPORT WKBundlePageRef WKBundleFrameGetPage(WKBundleFrameRef frame);
 

Deleted: trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2015 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 "InjectedBundleFileHandle.h"
-
-#include <WebCore/File.h>
-#include <wtf/HashMap.h>
-#include <wtf/NeverDestroyed.h>
-
-namespace WebKit {
-using namespace WebCore;
-
-typedef HashMap<File*, InjectedBundleFileHandle*> DOMFileHandleCache;
-
-static DOMFileHandleCache& domFileHandleCache()
-{
-    static NeverDestroyed<DOMFileHandleCache> cache;
-    return cache;
-}
-
-RefPtr<InjectedBundleFileHandle> InjectedBundleFileHandle::create(const String& path)
-{
-    auto file = File::create(path);
-    return adoptRef(new InjectedBundleFileHandle(file.get()));
-}
-
-RefPtr<InjectedBundleFileHandle> InjectedBundleFileHandle::getOrCreate(File* file)
-{
-    if (!file)
-        return nullptr;
-
-    DOMFileHandleCache::AddResult result = domFileHandleCache().add(file, nullptr);
-    if (!result.isNewEntry)
-        return RefPtr<InjectedBundleFileHandle>(result.iterator->value);
-
-    RefPtr<InjectedBundleFileHandle> fileHandle = adoptRef(new InjectedBundleFileHandle(*file));
-    result.iterator->value = fileHandle.get();
-    return fileHandle;
-}
-
-InjectedBundleFileHandle::InjectedBundleFileHandle(File& file)
-    : m_file(file)
-{
-}
-
-InjectedBundleFileHandle::~InjectedBundleFileHandle()
-{
-    domFileHandleCache().remove(m_file.ptr());
-}
-
-File* InjectedBundleFileHandle::coreFile()
-{
-    return m_file.ptr();
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2015 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.
- */
-
-#ifndef InjectedBundleFileHandle_h
-#define InjectedBundleFileHandle_h
-
-#include "APIObject.h"
-#include <wtf/Forward.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-class File;
-}
-
-namespace WebKit {
-
-class InjectedBundleFileHandle : public API::ObjectImpl<API::Object::Type::BundleFileHandle> {
-public:
-    static RefPtr<InjectedBundleFileHandle> create(const WTF::String&);
-    static RefPtr<InjectedBundleFileHandle> getOrCreate(WebCore::File*);
-
-    virtual ~InjectedBundleFileHandle();
-
-    WebCore::File* coreFile();
-
-private:
-    InjectedBundleFileHandle(WebCore::File&);
-
-    Ref<WebCore::File> m_file;
-};
-
-} // namespace WebKit
-
-#endif // InjectedBundleFileHandle_h

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -29,7 +29,6 @@
 #include "APIArray.h"
 #include "DownloadManager.h"
 #include "FrameInfoData.h"
-#include "InjectedBundleFileHandle.h"
 #include "InjectedBundleHitTestResult.h"
 #include "InjectedBundleNodeHandle.h"
 #include "InjectedBundleRangeHandle.h"
@@ -735,18 +734,6 @@
     return toRef(exec, toJS(exec, globalObject, rangeHandle->coreRange()));
 }
 
-JSValueRef WebFrame::jsWrapperForWorld(InjectedBundleFileHandle* fileHandle, InjectedBundleScriptWorld* world)
-{
-    if (!m_coreFrame)
-        return nullptr;
-
-    JSDOMWindow* globalObject = m_coreFrame->script().globalObject(world->coreWorld());
-    ExecState* exec = globalObject->globalExec();
-
-    JSLockHolder lock(exec);
-    return toRef(exec, toJS(exec, globalObject, fileHandle->coreFile()));
-}
-
 String WebFrame::counterValue(JSObjectRef element)
 {
     if (!toJS(element)->inherits<JSElement>(*toJS(element)->vm()))

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.h (236929 => 236930)


--- trunk/Source/WebKit/WebProcess/WebPage/WebFrame.h	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebFrame.h	2018-10-08 19:58:09 UTC (rev 236930)
@@ -58,7 +58,6 @@
 
 namespace WebKit {
 
-class InjectedBundleFileHandle;
 class InjectedBundleHitTestResult;
 class InjectedBundleNodeHandle;
 class InjectedBundleRangeHandle;
@@ -133,7 +132,6 @@
 
     JSValueRef jsWrapperForWorld(InjectedBundleNodeHandle*, InjectedBundleScriptWorld*);
     JSValueRef jsWrapperForWorld(InjectedBundleRangeHandle*, InjectedBundleScriptWorld*);
-    JSValueRef jsWrapperForWorld(InjectedBundleFileHandle*, InjectedBundleScriptWorld*);
 
     static String counterValue(JSObjectRef element);
 

Modified: trunk/Tools/ChangeLog (236929 => 236930)


--- trunk/Tools/ChangeLog	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Tools/ChangeLog	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,3 +1,14 @@
+2018-10-08  Alex Christensen  <[email protected]>
+
+        Remove WKBundleFileHandleRef
+        https://bugs.webkit.org/show_bug.cgi?id=190360
+
+        Reviewed by Tim Horton.
+
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp: Removed.
+        * TestWebKitAPI/Tests/WebKit/WKBundleFileHandle_Bundle.cpp: Removed.
+
 2018-10-08  Dan Bernstein  <[email protected]>
 
         Tools part of [Xcode] Update some build settings as recommended by Xcode 10

Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (236929 => 236930)


--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2018-10-08 19:58:09 UTC (rev 236930)
@@ -345,8 +345,6 @@
 		7C3DB8E41D12129B00AE8CC3 /* CommandBackForward.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */; };
 		7C417F331D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C417F311D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm */; };
 		7C486BA11AA12567003F6F9B /* bundle-file.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 7C486BA01AA1254B003F6F9B /* bundle-file.html */; };
-		7C54A4BE1AA11CCA00380F78 /* WKBundleFileHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C54A4BC1AA11CCA00380F78 /* WKBundleFileHandle.cpp */; };
-		7C54A4C11AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C54A4BF1AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp */; };
 		7C83DE991D0A590C00FEBCF3 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F1B44215CA434F00D1E4BF /* AtomicString.cpp */; };
 		7C83DE9C1D0A590C00FEBCF3 /* BloomFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E40019301ACE9B5C001B0A2A /* BloomFilter.cpp */; };
 		7C83DEA01D0A590C00FEBCF3 /* CheckedArithmeticOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */; };
@@ -1656,8 +1654,6 @@
 		7C3DB8E21D12129B00AE8CC3 /* CommandBackForward.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CommandBackForward.mm; sourceTree = "<group>"; };
 		7C417F311D19E14800B8EF53 /* WKWebViewDefaultNavigationDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewDefaultNavigationDelegate.mm; sourceTree = "<group>"; };
 		7C486BA01AA1254B003F6F9B /* bundle-file.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "bundle-file.html"; sourceTree = "<group>"; };
-		7C54A4BC1AA11CCA00380F78 /* WKBundleFileHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleFileHandle.cpp; sourceTree = "<group>"; };
-		7C54A4BF1AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleFileHandle_Bundle.cpp; sourceTree = "<group>"; };
 		7C6BBD8A19CEA54300C1F5E0 /* Counters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Counters.h; sourceTree = "<group>"; };
 		7C6BBD8B19CEA63000C1F5E0 /* Counters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Counters.cpp; sourceTree = "<group>"; };
 		7C74D42D188228F300E5ED57 /* StringView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringView.cpp; sourceTree = "<group>"; };
@@ -2989,8 +2985,6 @@
 				7CFBCAE31743238E00B2BFCF /* WillLoad_Bundle.cpp */,
 				76E182D91547550100F1FADD /* WillSendSubmitEvent.cpp */,
 				76E182DC1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp */,
-				7C54A4BC1AA11CCA00380F78 /* WKBundleFileHandle.cpp */,
-				7C54A4BF1AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp */,
 				A1FDFD2E19C288BB005148A4 /* WKImageCreateCGImageCrash.cpp */,
 				7C89D2AA1A69B80D003A5FDE /* WKPageConfiguration.cpp */,
 				52D673EC1AFB126800FA19FE /* WKPageCopySessionStateWithFiltering.cpp */,
@@ -4077,7 +4071,6 @@
 				1F83571B1D3FFB2300E3967B /* WKBackForwardList.mm in Sources */,
 				7CCE7F2E1A411B1000447C4C /* WKBrowsingContextGroupTest.mm in Sources */,
 				7CCE7F2F1A411B1000447C4C /* WKBrowsingContextLoadDelegateTest.mm in Sources */,
-				7C54A4BE1AA11CCA00380F78 /* WKBundleFileHandle.cpp in Sources */,
 				5CE354D91E70DA5C00BEFE3B /* WKContentExtensionStore.mm in Sources */,
 				2D838B1F1EEF3A5C009B980E /* WKContentViewEditingActions.mm in Sources */,
 				370CE22A1F57343400E7410B /* WKContentViewTargetForAction.mm in Sources */,
@@ -4208,7 +4201,6 @@
 				520BCF4C141EB09E00937EA8 /* WebArchive_Bundle.cpp in Sources */,
 				7CFBCAE51743238F00B2BFCF /* WillLoad_Bundle.cpp in Sources */,
 				76E182DD1547569100F1FADD /* WillSendSubmitEvent_Bundle.cpp in Sources */,
-				7C54A4C11AA11CE400380F78 /* WKBundleFileHandle_Bundle.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp (236929 => 236930)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2015 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"
-
-#if WK_HAVE_C_SPI
-
-#include "PlatformUtilities.h"
-#include "PlatformWebView.h"
-#include "Test.h"
-
-namespace TestWebKitAPI {
-
-static bool done;
-static bool loadDone;
-
-static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef body, const void*)
-{
-    if (!WKStringIsEqualToUTF8CString(messageName, "SUCCESS"))
-        FAIL();
-    else
-        SUCCEED();
-
-    done = true;
-}
-
-static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void*)
-{
-    loadDone = true;
-}
-
-TEST(WebKit, WKBundleFileHandle)
-{
-    WKRetainPtr<WKContextRef> context = adoptWK(Util::createContextForInjectedBundleTest("WKBundleFileHandleTest"));
-
-    WKContextInjectedBundleClientV0 injectedBundleClient;
-    memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
-    injectedBundleClient.base.version = 0;
-    injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
-    WKContextSetInjectedBundleClient(context.get(), &injectedBundleClient.base);
-
-    PlatformWebView webView(context.get());
-
-    WKPageNavigationClientV0 loaderClient;
-    memset(&loaderClient, 0, sizeof(loaderClient));
-    loaderClient.base.version = 0;
-    loaderClient.didFinishNavigation = didFinishNavigation;
-    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
-
-    WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("bundle-file", "html")).get());
-    Util::run(&loadDone);
-    
-    // Get path to a file.
-    auto urlToFile = adoptWK(Util::createURLForResource("simple", "html"));
-    auto pathToFile = adoptWK(WKURLCopyPath(urlToFile.get()));
-
-    WKContextPostMessageToInjectedBundle(context.get(), Util::toWK("TestFile").get(), pathToFile.get());
-
-    Util::run(&done);
-}
-
-} // namespace TestWebKitAPI
-
-#endif

Deleted: trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle_Bundle.cpp (236929 => 236930)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle_Bundle.cpp	2018-10-08 19:53:29 UTC (rev 236929)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/WKBundleFileHandle_Bundle.cpp	2018-10-08 19:58:09 UTC (rev 236930)
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2015 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"
-
-#if WK_HAVE_C_SPI
-
-#include "InjectedBundleTest.h"
-
-#include "PlatformUtilities.h"
-#include <WebKit/WKBundlePage.h>
-#include <WebKit/WKBundleFileHandleRef.h>
-#include <WebKit/WKBundleFrame.h>
-#include <WebKit/WKBundleScriptWorld.h>
-
-namespace TestWebKitAPI {
-
-static WKBundlePageRef loadedPage;
-
-class WKBundleFileHandleTest : public InjectedBundleTest {
-public:
-    WKBundleFileHandleTest(const std::string& identifier)
-        : InjectedBundleTest(identifier)
-    {
-    }
-
-private:
-    void didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody) override
-    {
-        if (!WKStringIsEqualToUTF8CString(messageName, "TestFile")) {
-            WKBundlePostMessage(bundle, Util::toWK("FAIL").get(), Util::toWK("Recieved invalid message").get());
-            return;
-        }
-
-        if (!loadedPage) {
-            WKBundlePostMessage(bundle, Util::toWK("FAIL").get(), Util::toWK("No loaded page").get());
-            return;
-        }
-
-        if (WKGetTypeID(messageBody) != WKStringGetTypeID()) {
-            WKBundlePostMessage(bundle, Util::toWK("FAIL").get(), Util::toWK("Message body has invalid type").get());
-            return;
-        }
-
-        WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(loadedPage);
-        WKBundleScriptWorldRef world = WKBundleScriptWorldNormalWorld();
-        
-        JSGlobalContextRef globalContext = WKBundleFrameGetJavaScriptContextForWorld(mainFrame, world);
-
-        auto fileHandle = adoptWK(WKBundleFileHandleCreateWithPathForPage((WKStringRef)messageBody, loadedPage));
-        JSValueRef jsFileHandle = WKBundleFrameGetJavaScriptWrapperForFileForWorld(mainFrame, fileHandle.get(), world);
-
-        JSObjectRef globalObject = JSContextGetGlobalObject(globalContext);
-
-        JSStringRef jsString = JSStringCreateWithUTF8CString("testFile");
-        JSValueRef function = JSObjectGetProperty(globalContext, globalObject, jsString, nullptr);
-        JSStringRelease(jsString);
-        
-        JSValueRef result = JSObjectCallAsFunction(globalContext, (JSObjectRef)function, globalObject, 1, &jsFileHandle, nullptr);
-
-        if (JSValueToBoolean(globalContext, result))
-            WKBundlePostMessage(bundle, Util::toWK("SUCCESS").get(), nullptr);
-        else
-            WKBundlePostMessage(bundle, Util::toWK("FAIL").get(), Util::toWK("Script failed").get());
-    }
-
-    void didCreatePage(WKBundleRef bundle, WKBundlePageRef page) override
-    {
-        loadedPage = page;
-    }
-};
-
-static InjectedBundleTest::Register<WKBundleFileHandleTest> registrar("WKBundleFileHandleTest");
-
-} // namespace TestWebKitAPI
-
-#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to