Implement NPAPI redirect handling
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 20:48:47 +0000 (20:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 20:48:47 +0000 (20:48 +0000)
commit203e65e7778832ea92ae55f363175eea8b8bc187
tree54e544ebffa39beb7a75b0b85f7cb132dae5b588
parent72bfc49fe3c4dd2546c7abd06bc15659989462ce
Implement NPAPI redirect handling
https://bugs.webkit.org/show_bug.cgi?id=138675
rdar://problem/15779101

Patch by Jeffrey Pfau, updated and tweaked by me.

Patch by Alexey Proskuryakov <ap@apple.com> on 2015-08-04
Reviewed by Anders Carlsson.

Source/WebCore:

Test: http/tests/plugins/get-url-redirect-notify.html

* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::init):
(WebCore::NetscapePlugInStreamLoader::willSendRequest):
(WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
* loader/NetscapePlugInStreamLoader.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::isSubresourceLoader):
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::willSendRequest):
(WebCore::ResourceLoader::didSendData):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::isSubresourceLoader):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::willSendRequest): Deleted.
* loader/SubresourceLoader.h:
* plugins/npapi.h:
* plugins/npfunctions.h:

Source/WebKit/mac:

* Plugins/Hosted/HostedNetscapePluginStream.h:
(WebKit::HostedNetscapePluginStream::streamID):
* Plugins/Hosted/HostedNetscapePluginStream.mm:
(WebKit::HostedNetscapePluginStream::didFinishLoading):
(WebKit::HostedNetscapePluginStream::willSendRequest):
(WebKit::HostedNetscapePluginStream::didReceiveResponse):
* Plugins/WebNetscapePluginStream.h:
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::stop):
(WebNetscapePluginStream::willSendRequest):
(WebNetscapePluginStream::didReceiveResponse):

Source/WebKit/win:

* Plugins/PluginStream.cpp:
(WebCore::PluginStream::sendJavaScriptStream):
(WebCore::PluginStream::willSendRequest):
(WebCore::PluginStream::didReceiveResponse):
* Plugins/PluginStream.h:

Source/WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::loadURL):
(WebKit::PluginControllerProxy::continueStreamLoad):
(WebKit::PluginControllerProxy::cancelStreamLoad):
(WebKit::PluginControllerProxy::didEvaluateJavaScript):
(WebKit::PluginControllerProxy::streamWillSendRequest):
(WebKit::PluginControllerProxy::streamDidReceiveResponse):
* PluginProcess/PluginControllerProxy.h:
* PluginProcess/PluginControllerProxy.messages.in:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::willSendRequest):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_ConvertPoint):
(WebKit::NPN_URLRedirectResponse):
(WebKit::initializeBrowserFuncs):
(WebKit::netscapeBrowserFuncs):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::getAuthenticationInfo):
(WebKit::NetscapePlugin::registerRedirect):
(WebKit::NetscapePlugin::urlRedirectResponse):
(WebKit::NetscapePlugin::setIsPlayingAudio):
(WebKit::NetscapePlugin::NPP_URLNotify):
(WebKit::NetscapePlugin::NPP_URLRedirectNotify):
(WebKit::NetscapePlugin::NPP_GetValue):
(WebKit::NetscapePlugin::didEvaluateJavaScript):
(WebKit::NetscapePlugin::streamWillSendRequest):
(WebKit::NetscapePlugin::streamDidReceiveResponse):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::~NetscapePluginStream):
(WebKit::NetscapePluginStream::willSendRequest):
(WebKit::NetscapePluginStream::didReceiveResponse):
(WebKit::NetscapePluginStream::stop):
(WebKit::NetscapePluginStream::setURL):
(WebKit::NetscapePluginStream::cancel):
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
(WebKit::NetscapePluginStream::streamID):
(WebKit::NetscapePluginStream::npStream):
* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/Plugin.h:
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginProxy.cpp:
(WebKit::PluginProxy::didEvaluateJavaScript):
(WebKit::PluginProxy::streamWillSendRequest):
(WebKit::PluginProxy::streamDidReceiveResponse):
(WebKit::PluginProxy::setPluginIsPlayingAudio):
(WebKit::PluginProxy::continueStreamLoad):
(WebKit::PluginProxy::cancelStreamLoad):
* WebProcess/Plugins/PluginProxy.h:
* WebProcess/Plugins/PluginProxy.messages.in:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::streamID):
(WebKit::PluginView::Stream::Stream):
(WebKit::PluginView::Stream::cancel):
(WebKit::PluginView::Stream::continueLoad):
(WebKit::buildHTTPHeaders):
(WebKit::lastModifiedDateMS):
(WebKit::PluginView::Stream::willSendRequest):
(WebKit::PluginView::Stream::didReceiveResponse):
(WebKit::PluginView::cancelStreamLoad):
(WebKit::PluginView::continueStreamLoad):
(WebKit::PluginView::cancelManualStreamLoad):
* WebProcess/Plugins/PluginView.h:

Tools:

* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj.filters:
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
(PluginTest::NPP_URLNotify):
(PluginTest::NPP_URLRedirectNotify):
(PluginTest::NPP_GetValue):
(PluginTest::NPN_GetURLNotify):
(PluginTest::NPN_PostURLNotify):
(PluginTest::NPN_GetValue):
(PluginTest::NPN_ReleaseVariantValue):
(PluginTest::NPN_URLRedirectResponse):
(PluginTest::NPN_ConvertPoint):
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
* DumpRenderTree/TestNetscapePlugIn/Tests/URLRedirect.cpp: Added.
(URLRedirect::URLRedirect):
(URLRedirect::ScriptableObject::hasMethod):
(URLRedirect::ScriptableObject::get):
(URLRedirect::ScriptableObject::serviceAsync):
(URLRedirect::ScriptableObject::invoke):
(URLRedirect::NPP_GetValue):
(URLRedirect::NPP_URLNotify):
(URLRedirect::NPP_URLRedirectNotify):
* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(NP_GetEntryPoints):
(NPP_URLNotify):
(NPP_URLRedirectNotify):
(NPP_GetValue):

LayoutTests:

* http/tests/plugins/get-url-redirect-notify-expected.txt: Added.
* http/tests/plugins/get-url-redirect-notify.html: Added.
* platform/wk2/http/tests/plugins: Added.
* platform/wk2/http/tests/plugins/get-url-redirect-notify-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
48 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/plugins/get-url-redirect-notify-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/plugins/get-url-redirect-notify.html [new file with mode: 0644]
LayoutTests/platform/wk2/http/tests/plugins/get-url-redirect-notify-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/NetscapePlugInStreamLoader.cpp
Source/WebCore/loader/NetscapePlugInStreamLoader.h
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/SubresourceLoader.h
Source/WebCore/plugins/npapi.h
Source/WebCore/plugins/npfunctions.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.h
Source/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
Source/WebKit/mac/Plugins/WebNetscapePluginStream.h
Source/WebKit/mac/Plugins/WebNetscapePluginStream.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/Plugins/PluginStream.cpp
Source/WebKit/win/Plugins/PluginStream.h
Source/WebKit2/ChangeLog
Source/WebKit2/PluginProcess/PluginControllerProxy.cpp
Source/WebKit2/PluginProcess/PluginControllerProxy.h
Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in
Source/WebKit2/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h
Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.h
Source/WebKit2/WebProcess/Plugins/Plugin.h
Source/WebKit2/WebProcess/Plugins/PluginController.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp
Source/WebKit2/WebProcess/Plugins/PluginProxy.h
Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h
Tools/ChangeLog
Tools/DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj
Tools/DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj.filters
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/TestNetscapePlugIn/CMakeLists.txt
Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
Tools/DumpRenderTree/TestNetscapePlugIn/Tests/URLRedirect.cpp [new file with mode: 0644]
Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp