Take UnboundedNetworking assertion when a file upload is in progress.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 17:57:57 +0000 (17:57 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 17:57:57 +0000 (17:57 +0000)
commit04db29ff56669784e31dcfc6f871f329fc9f4e17
tree76a23713dee21c7511a2aef6609eb415913422b4
parentccdbbab9f774a798ce4fee37696fbd9df845db1f
Take UnboundedNetworking assertion when a file upload is in progress.
https://bugs.webkit.org/show_bug.cgi?id=195497

Reviewed by Geoff Garen.

Source/WebCore:

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::hasUpload const):
* platform/network/ResourceRequestBase.h:

Source/WebKit:

This patch implements whole bunch of bookkeeping in both the Networking and UI processes.

The TLDR of that bookkeeping is:
- Whenever any uploads are in progress, take an assertion for both Networking and UI processes.
- Whenever a particular WebProcess has an upload in progress, take an assertion for it.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
(WebKit::NetworkConnectionToWebProcess::setProcessIdentifier):
(WebKit::NetworkConnectionToWebProcess::setConnectionHasUploads):
(WebKit::NetworkConnectionToWebProcess::clearConnectionHasUploads):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* NetworkProcess/NetworkResourceLoadMap.cpp: Added.
(WebKit::NetworkResourceLoadMap::add):
(WebKit::NetworkResourceLoadMap::remove):
(WebKit::NetworkResourceLoadMap::get const):
* NetworkProcess/NetworkResourceLoadMap.h: Added.
(WebKit::NetworkResourceLoadMap::NetworkResourceLoadMap):
(WebKit::NetworkResourceLoadMap::isEmpty const):
(WebKit::NetworkResourceLoadMap::contains const):
(WebKit::NetworkResourceLoadMap::begin):
(WebKit::NetworkResourceLoadMap::values):

* NetworkProcess/NetworkSession.cpp:

       * Scripts/webkit/messages.py:

* Sources.txt:

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::takeUploadAssertion):
(WebKit::NetworkProcessProxy::clearUploadAssertion):
* UIProcess/Network/NetworkProcessProxy.h:

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setWebProcessHasUploads):
(WebKit::WebProcessPool::clearWebProcessHasUploads):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.messages.in:

       * WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureNetworkProcessConnection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/network/ResourceRequestBase.cpp
Source/WebCore/platform/network/ResourceRequestBase.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit/NetworkProcess/NetworkResourceLoadMap.cpp [new file with mode: 0644]
Source/WebKit/NetworkProcess/NetworkResourceLoadMap.h [new file with mode: 0644]
Source/WebKit/NetworkProcess/NetworkSession.cpp
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Sources.txt
Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/UIProcess/WebProcessPool.h
Source/WebKit/UIProcess/WebProcessPool.messages.in
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebProcess.cpp