13 edits
7 adds in trunk
Add WebKit2 SPI to create a DOM File object
https://bugs.webkit.org/show_bug.cgi?id=142109
Patch by Sam Weinig <sam@webkit.org> on 2015-02-27
Reviewed by Tim Horton.
Source/WebCore:
WebCore.xcodeproj/project.pbxproj:
Make <WebCore/File.h> (and associated files) available to WebKit2.
Source/WebKit2:
Add a new handle type for exposing a DOM File object to script. Follow
the pattern of WKBundleNodeHandleRef and WKBundleRangeHandleRef with the
new class WKBundleFileHandleRef. It can be created for a specific path,
and then the JS wrapper can be obtained via WKBundleFrameGetJavaScriptWrapperForFileForWorld.
Shared/API/APIObject.h:
Shared/API/c/WKBase.h:
WebKit2.xcodeproj/project.pbxproj:
WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Added.
(WKBundleFileHandleGetTypeID):
(WKBundleFileHandleCreateWithPath):
WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h: Added.
WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameGetJavaScriptWrapperForFileForWorld):
WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Added.
(WebKit::domHandleCache):
(WebKit::InjectedBundleFileHandle::create):
(WebKit::InjectedBundleFileHandle::getOrCreate):
(WebKit::InjectedBundleFileHandle::InjectedBundleFileHandle):
(WebKit::InjectedBundleFileHandle::~InjectedBundleFileHandle):
(WebKit::InjectedBundleFileHandle::coreFile):
WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Added.
WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::jsWrapperForWorld):
WebProcess/WebPage/WebFrame.h:
Tools:
Add a test for WKBundleFileHandleRef.
TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
TestWebKitAPI/Tests/WebKit2/WKBundleFileHandle.cpp: Added.
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):
TestWebKitAPI/Tests/WebKit2/WKBundleFileHandle_Bundle.cpp: Added.
(TestWebKitAPI::WKBundleFileHandleTest::WKBundleFileHandleTest):
TestWebKitAPI/Tests/WebKit2/bundle-file.html: Added.