Injected bundle messages should be at the page level.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 23:22:19 +0000 (23:22 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Apr 2015 23:22:19 +0000 (23:22 +0000)
commit9b4be516540682105f65c51a95ef0758c82abf93
treedd64e82cbb17d341cc0998720f9aae433b032bd6
parentf576d5f260ff2f881976d01e3eb23b4159eea27d
Injected bundle messages should be at the page level.
https://bugs.webkit.org/show_bug.cgi?id=143283

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

All the messages between the injected bundle and the UI
process should be page level messages instead of context.
The author of this patch is Tim Horton, I just finished it.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageInjectedBundleClient):
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKPageInjectedBundleClient.h: Added.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _pageForTesting]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/WebPageInjectedBundleClient.cpp: Added.
(WebKit::WebPageInjectedBundleClient::didReceiveMessageFromInjectedBundle):
(WebKit::WebPageInjectedBundleClient::didReceiveSynchronousMessageFromInjectedBundle):
* UIProcess/WebPageInjectedBundleClient.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setInjectedBundleClient):
(WebKit::WebPageProxy::handleMessage):
(WebKit::WebPageProxy::handleSynchronousMessage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::injectedBundleClient):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::handleMessage):
* WebKit2.xcodeproj/project.pbxproj:
* CMakeLists.txt:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostMessage):
(WKBundlePagePostSynchronousMessage):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::postMessage):
(WebKit::WebPage::postSynchronousMessage):
* WebProcess/WebPage/WebPage.h:

Tools:

Updating WebKitTestRunner to use the new page level messaging.
The author of this patch is Tim Horton, I just finished it.

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseDown):
(WTR::EventSendingController::mouseUp):
(WTR::EventSendingController::mouseMoveTo):
(WTR::EventSendingController::leapForward):
(WTR::EventSendingController::scheduleAsynchronousClick):
(WTR::EventSendingController::keyDown):
(WTR::EventSendingController::scheduleAsynchronousKeyDown):
(WTR::EventSendingController::mouseScrollBy):
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases):
(WTR::EventSendingController::continuousMouseScrollBy):
(WTR::EventSendingController::addTouchPoint):
(WTR::EventSendingController::updateTouchPoint):
(WTR::EventSendingController::setTouchModifier):
(WTR::EventSendingController::setTouchPointRadius):
(WTR::EventSendingController::touchStart):
(WTR::EventSendingController::touchMove):
(WTR::EventSendingController::touchEnd):
(WTR::EventSendingController::touchCancel):
(WTR::EventSendingController::clearTouchPoints):
(WTR::EventSendingController::releaseTouchPoint):
(WTR::EventSendingController::cancelTouchPoint):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessage):
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::done):
(WTR::InjectedBundle::outputText):
(WTR::InjectedBundle::postNewBeforeUnloadReturnValue):
(WTR::InjectedBundle::postAddChromeInputField):
(WTR::InjectedBundle::postRemoveChromeInputField):
(WTR::InjectedBundle::postFocusWebView):
(WTR::InjectedBundle::postSetBackingScaleFactor):
(WTR::InjectedBundle::postSetWindowIsKey):
(WTR::InjectedBundle::postSimulateWebNotificationClick):
(WTR::InjectedBundle::postSetAddsVisitedLinks):
(WTR::InjectedBundle::setGeolocationPermission):
(WTR::InjectedBundle::setMockGeolocationPosition):
(WTR::InjectedBundle::setMockGeolocationPositionUnavailableError):
(WTR::InjectedBundle::setUserMediaPermission):
(WTR::InjectedBundle::setCustomPolicyDelegate):
(WTR::InjectedBundle::setHidden):
(WTR::InjectedBundle::setCacheModel):
(WTR::InjectedBundle::shouldProcessWorkQueue):
(WTR::InjectedBundle::processWorkQueue):
(WTR::InjectedBundle::queueBackNavigation):
(WTR::InjectedBundle::queueForwardNavigation):
(WTR::InjectedBundle::queueLoad):
(WTR::InjectedBundle::queueLoadHTMLString):
(WTR::InjectedBundle::queueReload):
(WTR::InjectedBundle::queueLoadingScript):
(WTR::InjectedBundle::queueNonLoadingScript):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setHandlesAuthenticationChallenges):
(WTR::TestRunner::setAuthenticationUsername):
(WTR::TestRunner::setAuthenticationPassword):
(WTR::TestRunner::secureEventInputIsEnabled):
(WTR::TestRunner::setBlockAllPlugins):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::didReceivePageMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousPageMessageFromInjectedBundle):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::invoke):
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/API/C/WKPageInjectedBundleClient.h [new file with mode: 0644]
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
Source/WebKit2/UIProcess/WebPageInjectedBundleClient.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageInjectedBundleClient.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/WebProcessPool.cpp
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp