Add WebKit2 SPI to create a DOM File object
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Feb 2015 00:42:26 +0000 (00:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 Feb 2015 00:42:26 +0000 (00:42 +0000)
commitadc3e0dc5df16188ce2ecf4ae0e17ae0d72b1a1f
treed24fe548ef6b15a8f1e5daf936456a5fb5a1b23f
parentb0587e62b0b1c97f62f5429edd05a362ac86f581
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/APIObject.h
Source/WebKit2/Shared/API/c/WKBase.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleFrame.h
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
Source/WebKit2/WebProcess/WebPage/WebFrame.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/WKBundleFileHandle.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/WKBundleFileHandle_Bundle.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/bundle-file.html [new file with mode: 0644]