[GPUP] Implement Modern EME API in the GPU Process
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Feb 2020 00:32:18 +0000 (00:32 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Feb 2020 00:32:18 +0000 (00:32 +0000)
commitb4c9ee034a30ae1f1f0dc8c95e75ab3ee32e72b4
tree995f90fefc05ad9d604e2913ee5264c3ea62a0d5
parent906c011b1ed39b668e33348447928b4395b278b4
[GPUP] Implement Modern EME API in the GPU Process
https://bugs.webkit.org/show_bug.cgi?id=208090

Reviewed by Alex Christensen.

IPC::SharedBufferDataReference is made more efficient by using the same encode/decode path as is used in
WebCoreArgumentCoders: the SharedBuffer is copied into shared memory, and only a handle is passed across
the XPC boundary. This requires existing users to handle receiving a IPC::SharedBufferDataHandle on the
remote side of the XPC boundary, but this is trivial, and many call sites require a SharedBuffer on the
remote side in the first place. This code could be improved by allowing the SharedMemory object be adopted
by the SharedBuffer object at creation time, potentially leading to zero-copy decoding, but is not done in
this patch.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::bufferingTimerFired):
(WebKit::NetworkResourceLoader::sendBuffer):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::didReceiveData):
(WebKit::ServiceWorkerFetchTask::didReceiveSharedBuffer):
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h:
* NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in:
* Platform/IPC/HandleMessage.h:
* Platform/IPC/SharedBufferDataReference.h:
(IPC::SharedBufferDataReference::SharedBufferDataReference):
(IPC::SharedBufferDataReference::buffer):
(IPC::SharedBufferDataReference::buffer const):
(IPC::SharedBufferDataReference::data const):
(IPC::SharedBufferDataReference::size const):
(IPC::SharedBufferDataReference::isEmpty const):
(IPC::SharedBufferDataReference::encode const):
(IPC::SharedBufferDataReference::decode):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<RefPtr<WebCore::SharedBuffer>>::encode):
(IPC::ArgumentCoder<RefPtr<WebCore::SharedBuffer>>::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::platformRegisterAttachment):
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveSharedBuffer):
(WebKit::WebResourceLoader::didReceiveData):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Network/WebResourceLoader.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveData):
(WebKit::WebServiceWorkerFetchTaskClient::didReceiveBlobChunk):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getSelectionAsWebArchiveData):
(WebKit::WebPage::getWebArchiveOfFrame):
(WebKit::WebPage::drawPagesToPDF):
(WebKit::WebPage::urlSchemeTaskDidReceiveData):
(WebKit::WebPage::updateAttachmentAttributes):
* WebProcess/WebPage/WebPage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.h
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.messages.in
Source/WebKit/Platform/IPC/HandleMessage.h
Source/WebKit/Platform/IPC/SharedBufferDataReference.h
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp
Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit/WebProcess/Network/WebResourceLoader.h
Source/WebKit/WebProcess/Network/WebResourceLoader.messages.in
Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h