Drop NetworkCacheStatistics code
[WebKit-https.git] / Source / WebKit / ChangeLog
index 2a985e2..df1cfa8 100644 (file)
@@ -1,3 +1,337 @@
+2019-03-19  Chris Dumez  <cdumez@apple.com>
+
+        Drop NetworkCacheStatistics code
+        https://bugs.webkit.org/show_bug.cgi?id=195910
+
+        Reviewed by Antti Koivisto.
+
+        Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time.
+
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::Cache::Cache):
+        (WebKit::NetworkCache::Cache::retrieve):
+        (WebKit::NetworkCache::Cache::store):
+        (WebKit::NetworkCache::Cache::storeRedirect):
+        (WebKit::NetworkCache::Cache::update):
+        (WebKit::NetworkCache::Cache::clear):
+        * NetworkProcess/cache/NetworkCache.h:
+        * NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed.
+        * NetworkProcess/cache/NetworkCacheStatistics.h: Removed.
+        * NetworkProcess/cache/NetworkCacheStorage.cpp:
+        (WebKit::NetworkCache::traverseRecordsFiles):
+        * NetworkProcess/cache/NetworkCacheStorage.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+        * NetworkProcess/soup/NetworkProcessSoup.cpp:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * Sources.txt:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::registerUserDefaultsIfNeeded):
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+        * UIProcess/soup/WebProcessPoolSoup.cpp:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+        * WebKit.xcodeproj/project.pbxproj:
+
+2019-03-19  Chris Dumez  <cdumez@apple.com>
+
+        Spew: Unhandled web process message 'VisitedLinkTableController:VisitedLinkStateChanged'
+        https://bugs.webkit.org/show_bug.cgi?id=194787
+        <rdar://problem/48175520>
+
+        Reviewed by Geoffrey Garen.
+
+        The unhandled 'VisitedLinkTableController:VisitedLinkStateChanged' message logging happens
+        when IPC is sent to a WebProcess which does not have a VisitedLinkTableController with the
+        given identifier. VisitedLinkTableController are kept alive by the WebPage in the WebProcess
+        side so this indicates that there is no WebPage using this VisitedLinkTableController anymore.
+
+        In the UIProcess side, our tracking of who is using which VisitedLinkStore was very poor.
+        WebPageProxy objects would ask their process to register itself with the page's visitedLinkStore
+        as soon as the WebPage object has been created on the WebProcess side. This part was fine.
+        However, unregistration from the visitedLinkStores would only happen when either the
+        visitedLinkStore would get destroyed or when the WebProcess would shutdown. This means that
+        WebProcess could stay registered with a visitedLinkStore even after the page that was using it
+        has been closed, which would lead to such logging.
+
+        To address the issue, the WebProcessProxy now keeps track for which pages are using which
+        visitedLinkStore. When a visitedLinkStore is used by a page for the first time, the
+        WebProcessProxy will register itself with the visitedLinkStore. Similarly, when the last page
+        using a given visitedLinkStore is closed, the process unregisters itself from the
+        visitedLinkStore, thus avoiding the bug.
+
+        I also simplified a lot the logic for having a page telling the WebProcessProxy it started
+        using a visitedLinkStore. Previously, it would have to wait until the process is done launching
+        before notifying the WebProcessProxy. Now, the WebPageProxy merely tells the WebProcessProxy
+        that it is starting to use a visitedLinkStore as soon as it sent the CreateWebPage IPC to the
+        WebProcess (no matter if the process is still launching or not). At this point, the
+        WebProcessProxy registers the page as a user of the visitedLinkStore and takes care of waiting
+        until it is done launching before registering itself with the visitedLinkStore.
+
+        * UIProcess/ProvisionalPageProxy.cpp:
+        (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy):
+        (WebKit::ProvisionalPageProxy::initializeWebPage):
+        (WebKit::ProvisionalPageProxy::processDidFinishLaunching): Deleted.
+        (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
+        * UIProcess/ProvisionalPageProxy.h:
+        * UIProcess/VisitedLinkStore.cpp:
+        (WebKit::VisitedLinkStore::~VisitedLinkStore):
+        (WebKit::VisitedLinkStore::addProcess):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::finishAttachingToWebProcess):
+        (WebKit::WebPageProxy::initializeWebPage):
+        (WebKit::WebPageProxy::resetStateAfterProcessExited):
+        (WebKit::WebPageProxy::finishInitializingWebPageAfterProcessLaunch): Deleted.
+        (WebKit::WebPageProxy::processDidFinishLaunching): Deleted.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::shutDown):
+        (WebKit::WebProcessProxy::removeWebPage):
+        (WebKit::WebProcessProxy::addVisitedLinkStoreUser):
+        (WebKit::WebProcessProxy::removeVisitedLinkStoreUser):
+        (WebKit::WebProcessProxy::addWebUserContentControllerProxy):
+        (WebKit::WebProcessProxy::didFinishLaunching):
+        (WebKit::WebProcessProxy::addVisitedLinkStore): Deleted.
+        (WebKit::WebProcessProxy::didDestroyVisitedLinkStore): Deleted.
+        * UIProcess/WebProcessProxy.h:
+
+2019-03-19  Alex Christensen  <achristensen@webkit.org>
+
+        Make WTFLogChannelState and WTFLogLevel enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=195904
+
+        Reviewed by Eric Carlson.
+
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
+        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
+
+2019-03-19  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed, rolling out r243132.
+
+        Broke GTK build
+
+        Reverted changeset:
+
+        "Make WTFLogChannelState and WTFLogLevel enum classes"
+        https://bugs.webkit.org/show_bug.cgi?id=195904
+        https://trac.webkit.org/changeset/243132
+
+2019-03-19  Antti Koivisto  <antti@apple.com>
+
+        Layer with no backing store should still hit-test over a scroller
+        https://bugs.webkit.org/show_bug.cgi?id=195378
+        <rdar://problem/48652078>
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
+        (WebKit::RemoteLayerTreeHost::makeNode):
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.h:
+        * UIProcess/RemoteLayerTree/ios/RemoteLayerTreeViews.mm:
+        (WebKit::collectDescendantViewsAtPoint):
+
+        No need for special WKTiledBackingView, tiled views now have correct event regions.
+
+2019-03-18  Alex Christensen  <achristensen@webkit.org>
+
+        Make WTFLogChannelState and WTFLogLevel enum classes
+        https://bugs.webkit.org/show_bug.cgi?id=195904
+
+        Reviewed by Eric Carlson.
+
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+        (WebKit::NetworkCache::logSpeculativeLoadingDiagnosticMessage):
+        * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
+        (WebKit::NetworkRTCProvider::NetworkRTCProvider):
+
+2019-03-18  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r243092 and r243096.
+        https://bugs.webkit.org/show_bug.cgi?id=195926
+
+        Caused assertions in tests (Requested by smfr on #webkit).
+
+        Reverted changesets:
+
+        "Layer with no backing store should still hit-test over a
+        scroller"
+        https://bugs.webkit.org/show_bug.cgi?id=195378
+        https://trac.webkit.org/changeset/243092
+
+        "Try to fix Windows build."
+        https://trac.webkit.org/changeset/243096
+
+2019-03-18  Timothy Hatcher  <timothy@apple.com>
+
+        WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
+        https://bugs.webkit.org/show_bug.cgi?id=195916
+
+        Reviewed by Tim Horton.
+
+        Add direct support for UIColor so it does not try to use the NSSecureCoding path.
+        This avoids needs to list the classes when decoding the attributes NSDictionary
+        and matches the macOS NSColor encoder/decoder.
+
+        * Shared/Cocoa/ArgumentCodersCocoa.mm:
+        (IPC::typeFromObject):
+        (IPC::encodeColorInternal):
+        (IPC::decodeColorInternal):
+        (IPC::encodeObject):
+        (IPC::decodeObject):
+
+2019-03-18  Timothy Hatcher  <timothy@apple.com>
+
+        Add new NSAttributedString API for converting HTML.
+        https://bugs.webkit.org/show_bug.cgi?id=195636
+        rdar://problem/45055697
+
+        Reviewed by Tim Horton.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * SourcesCocoa.txt:
+        * UIProcess/API/Cocoa/NSAttributedString.h: Added.
+        * UIProcess/API/Cocoa/NSAttributedString.mm: Added.
+        (-[_WKAttributedStringNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
+        (-[_WKAttributedStringNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
+        (-[_WKAttributedStringNavigationDelegate webView:didFailNavigation:withError:]):
+        (-[_WKAttributedStringNavigationDelegate webView:didFinishNavigation:]):
+        (+[_WKAttributedStringWebViewCache cache]):
+        (+[_WKAttributedStringWebViewCache configuration]):
+        (+[_WKAttributedStringWebViewCache clearConfiguration]):
+        (+[_WKAttributedStringWebViewCache retrieveOrCreateWebView]):
+        (+[_WKAttributedStringWebViewCache cacheWebView:]):
+        (+[_WKAttributedStringWebViewCache resetPurgeDelay]):
+        (+[_WKAttributedStringWebViewCache purgeSingleWebView]):
+        (+[_WKAttributedStringWebViewCache purgeAllWebViews]):
+        (+[NSAttributedString _loadFromHTMLWithOptions:contentLoader:completionHandler:]):
+        (+[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:]):
+        (+[NSAttributedString loadFromHTMLWithFileURL:options:completionHandler:]):
+        (+[NSAttributedString loadFromHTMLWithString:options:completionHandler:]):
+        (+[NSAttributedString loadFromHTMLWithData:options:completionHandler:]):
+        * UIProcess/API/Cocoa/NSAttributedStringPrivate.h: Copied from Source/WebKit/UIProcess/API/Cocoa/WKErrorInternal.h.
+        * UIProcess/API/Cocoa/WKError.h:
+        * UIProcess/API/Cocoa/WKError.mm:
+        (localizedDescriptionForErrorCode):
+        (createNSError):
+        * UIProcess/API/Cocoa/WKErrorInternal.h:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+        (WebKit::WebPage::getContentsAsAttributedString):
+
+2019-03-18  Alex Christensen  <achristensen@webkit.org>
+
+        Implement DownloadMonitor to prevent long-running slow downloads from background apps
+        https://bugs.webkit.org/show_bug.cgi?id=195785
+
+        Reviewed by Geoffrey Garen.
+
+        This is similar to what was updated in <rdar://problem/42677685> but for WebKit Downloads.
+        To test it I implemented a throttled TCP server, SPI to speed up DownloadMonitor's timer,
+        and SPI to synthesize the application going into the background and foreground, which
+        NSNotificationCenter does on iOS.
+
+        * NetworkProcess/Downloads/Download.cpp:
+        (WebKit::Download::didReceiveData):
+        (WebKit::Download::didFinish):
+        (WebKit::Download::didFail):
+        (WebKit::Download::didCancel):
+        * NetworkProcess/Downloads/Download.h:
+        (WebKit::Download::applicationEnteredBackground):
+        (WebKit::Download::applicationEnteredForeground):
+        (WebKit::Download::manager const):
+        * NetworkProcess/Downloads/DownloadManager.cpp:
+        (WebKit::DownloadManager::downloadFinished):
+        (WebKit::DownloadManager::applicationDidEnterBackground):
+        (WebKit::DownloadManager::applicationWillEnterForeground):
+        * NetworkProcess/Downloads/DownloadManager.h:
+        * NetworkProcess/Downloads/DownloadMap.cpp:
+        (WebKit::DownloadMap::values):
+        * NetworkProcess/Downloads/DownloadMap.h:
+        * NetworkProcess/Downloads/DownloadMonitor.cpp: Added.
+        (WebKit::operator _kbps):
+        (WebKit::timeUntilNextInterval):
+        (WebKit::DownloadMonitor::DownloadMonitor):
+        (WebKit::DownloadMonitor::measuredThroughputRate const):
+        (WebKit::DownloadMonitor::downloadReceivedBytes):
+        (WebKit::DownloadMonitor::applicationEnteredForeground):
+        (WebKit::DownloadMonitor::applicationEnteredBackground):
+        (WebKit::DownloadMonitor::speedMultiplier const):
+        (WebKit::DownloadMonitor::timerFired):
+        * NetworkProcess/Downloads/DownloadMonitor.h: Added.
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        (WebKit::NetworkProcess::applicationDidEnterBackground):
+        (WebKit::NetworkProcess::applicationWillEnterForeground):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode const):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * Sources.txt:
+        * SourcesCocoa.txt:
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::copy):
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextDownloadURLRequest):
+        (WKContextResumeDownload):
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _synthesizeAppIsBackground:]):
+        (-[WKProcessPool _downloadURLRequest:originatingWebView:]):
+        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
+        (-[_WKProcessPoolConfiguration downloadMonitorSpeedMultiplier]):
+        (-[_WKProcessPoolConfiguration setDownloadMonitorSpeedMultiplier:]):
+        * UIProcess/Cocoa/DownloadProxyMapCocoa.mm: Added.
+        (WebKit::DownloadProxyMap::platformCreate):
+        (WebKit::DownloadProxyMap::platformDestroy):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::didFinish):
+        (WebKit::DownloadProxy::didFail):
+        (WebKit::DownloadProxy::didCancel):
+        * UIProcess/Downloads/DownloadProxyMap.cpp:
+        (WebKit::DownloadProxyMap::DownloadProxyMap):
+        (WebKit::DownloadProxyMap::~DownloadProxyMap):
+        (WebKit::DownloadProxyMap::platformCreate):
+        (WebKit::DownloadProxyMap::platformDestroy):
+        (WebKit::DownloadProxyMap::applicationDidEnterBackground):
+        (WebKit::DownloadProxyMap::applicationWillEnterForeground):
+        (WebKit::DownloadProxyMap::createDownloadProxy):
+        (WebKit::DownloadProxyMap::downloadFinished):
+        * UIProcess/Downloads/DownloadProxyMap.h:
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::synthesizeAppIsBackground):
+        (WebKit::NetworkProcessProxy::createDownloadProxy):
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::receivedPolicyDecision):
+        (WebKit::WebPageProxy::handleDownloadRequest):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::download):
+        (WebKit::WebProcessPool::resumeDownload):
+        (WebKit::WebProcessPool::createDownloadProxy):
+        (WebKit::WebProcessPool::synthesizeAppIsBackground):
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::handleDownloadRequest):
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::handleDownloadRequest):
+        * WebKit.xcodeproj/project.pbxproj:
+
 2019-03-18  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [iOS] Native selection views sometimes appear in hidden editable areas after losing focus