Changeset 227364 in webkit
- Timestamp:
- Jan 22, 2018 2:28:44 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 8 deleted
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/CMakeLists.txt
r227340 r227364 97 97 98 98 set(WebKit_SOURCES 99 NetworkProcess/Downloads/BlobDownloadClient.cpp100 99 NetworkProcess/Downloads/Download.cpp 101 100 NetworkProcess/Downloads/DownloadManager.cpp -
trunk/Source/WebKit/ChangeLog
r227358 r227364 1 2018-01-22 Alex Christensen <achristensen@webkit.org> 2 3 Remove pre-NetworkSession loading code 4 https://bugs.webkit.org/show_bug.cgi?id=181944 5 6 Reviewed by Tim Horton. 7 8 We were keeping it around for El Capitan. 9 10 * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm: 11 (WebKit::LegacyCustomProtocolManager::registerProtocolClass): 12 * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.cpp: 13 (WebKit::LegacyCustomProtocolManager::initialize): 14 * NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h: 15 * NetworkProcess/Downloads/BlobDownloadClient.cpp: Removed. 16 * NetworkProcess/Downloads/BlobDownloadClient.h: Removed. 17 * NetworkProcess/Downloads/Download.cpp: 18 (WebKit::Download::~Download): 19 (WebKit::Download::cancel): 20 (WebKit::Download::didReceiveChallenge): 21 (WebKit::Download::didFinish): 22 (WebKit::Download::isAlwaysOnLoggingAllowed const): 23 (WebKit::Download::start): Deleted. 24 (WebKit::Download::startWithHandle): Deleted. 25 (WebKit::Download::didStart): Deleted. 26 (WebKit::Download::willSendRedirectedRequest): Deleted. 27 (WebKit::Download::didReceiveAuthenticationChallenge): Deleted. 28 (WebKit::Download::didReceiveResponse): Deleted. 29 (WebKit::Download::shouldDecodeSourceDataOfMIMEType): Deleted. 30 (WebKit::Download::decideDestinationWithSuggestedFilename): Deleted. 31 (WebKit::Download::decideDestinationWithSuggestedFilenameAsync): Deleted. 32 (WebKit::Download::didDecideDownloadDestination): Deleted. 33 (WebKit::Download::continueDidReceiveResponse): Deleted. 34 * NetworkProcess/Downloads/Download.h: 35 (WebKit::Download::setBlobFileReferences): Deleted. 36 (WebKit::Download::request const): Deleted. 37 * NetworkProcess/Downloads/DownloadManager.cpp: 38 (WebKit::DownloadManager::startDownload): 39 (WebKit::DownloadManager::willDecidePendingDownloadDestination): 40 (WebKit::DownloadManager::convertNetworkLoadToDownload): 41 (WebKit::DownloadManager::continueDecidePendingDownloadDestination): 42 (WebKit::DownloadManager::resumeDownload): 43 (WebKit::DownloadManager::cancelDownload): 44 * NetworkProcess/Downloads/DownloadManager.h: 45 (WebKit::DownloadManager::startDownload): 46 * NetworkProcess/Downloads/PendingDownload.cpp: 47 * NetworkProcess/Downloads/PendingDownload.h: 48 * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm: 49 * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed. 50 * NetworkProcess/Downloads/mac/DownloadMac.mm: Removed. 51 * NetworkProcess/NetworkCORSPreflightChecker.cpp: 52 * NetworkProcess/NetworkCORSPreflightChecker.h: 53 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 54 (WebKit::NetworkConnectionToWebProcess::loadPing): 55 * NetworkProcess/NetworkDataTask.cpp: 56 * NetworkProcess/NetworkDataTask.h: 57 * NetworkProcess/NetworkDataTaskBlob.cpp: 58 * NetworkProcess/NetworkDataTaskBlob.h: 59 * NetworkProcess/NetworkLoad.cpp: 60 (WebKit::NetworkLoad::~NetworkLoad): 61 (WebKit::NetworkLoad::setDefersLoading): 62 (WebKit::NetworkLoad::cancel): 63 (WebKit::NetworkLoad::continueWillSendRequest): 64 (WebKit::NetworkLoad::continueDidReceiveResponse): 65 (WebKit::NetworkLoad::shouldCaptureExtraNetworkLoadMetrics const): 66 (WebKit::NetworkLoad::didReceiveResponseAsync): Deleted. 67 (WebKit::NetworkLoad::didReceiveBuffer): Deleted. 68 (WebKit::NetworkLoad::didFinishLoading): Deleted. 69 (WebKit::NetworkLoad::didFail): Deleted. 70 (WebKit::NetworkLoad::willSendRequestAsync): Deleted. 71 (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted. 72 (WebKit::NetworkLoad::shouldUseCredentialStorage): Deleted. 73 (WebKit::NetworkLoad::didReceiveAuthenticationChallenge): Deleted. 74 (WebKit::NetworkLoad::receivedCancellation): Deleted. 75 * NetworkProcess/NetworkLoad.h: 76 * NetworkProcess/NetworkLoadParameters.h: 77 * NetworkProcess/NetworkProcess.cpp: 78 (WebKit::NetworkProcess::initializeNetworkProcess): 79 (WebKit::NetworkProcess::clearCachedCredentials): 80 (WebKit::NetworkProcess::findPendingDownloadLocation): 81 * NetworkProcess/NetworkProcess.h: 82 * NetworkProcess/NetworkProcess.messages.in: 83 * NetworkProcess/NetworkResourceLoader.cpp: 84 (WebKit::NetworkResourceLoader::startNetworkLoad): 85 * NetworkProcess/NetworkSession.cpp: 86 * NetworkProcess/NetworkSession.h: 87 * NetworkProcess/PingLoad.cpp: 88 * NetworkProcess/PingLoad.h: 89 * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: 90 (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad): 91 * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: 92 * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: 93 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: 94 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 95 * NetworkProcess/cocoa/NetworkSessionCocoa.h: 96 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 97 * NetworkProcess/mac/NetworkLoadMac.mm: Removed. 98 * NetworkProcess/mac/RemoteNetworkingContext.mm: 99 (WebKit::RemoteNetworkingContext::ensureWebsiteDataStoreSession): 100 * Shared/Authentication/AuthenticationManager.cpp: 101 (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge): 102 (WebKit::AuthenticationManager::useCredentialForSingleChallenge): 103 (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge): 104 (WebKit::AuthenticationManager::cancelSingleChallenge): 105 (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge): 106 (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge): 107 * Shared/Authentication/AuthenticationManager.h: 108 * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Removed. 109 * Shared/SessionTracker.cpp: 110 (WebKit::SessionTracker::setSession): 111 (WebKit::SessionTracker::destroySession): 112 * Shared/SessionTracker.h: 113 * Shared/mac/CookieStorageShim.h: Removed. 114 * Shared/mac/CookieStorageShim.mm: Removed. 115 * UIProcess/API/APIDownloadClient.h: 116 (API::DownloadClient::didReceiveData): 117 (API::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted. 118 * UIProcess/API/C/WKContext.cpp: 119 (WKContextSetDownloadClient): 120 * UIProcess/Cocoa/DownloadClient.h: 121 * UIProcess/Cocoa/DownloadClient.mm: 122 (WebKit::DownloadClient::shouldDecodeSourceDataOfMIMEType): Deleted. 123 * UIProcess/Downloads/DownloadProxy.cpp: 124 (WebKit::DownloadProxy::willSendRequest): 125 (WebKit::DownloadProxy::didReceiveResponse): 126 (WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType): Deleted. 127 (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Deleted. 128 * UIProcess/Downloads/DownloadProxy.h: 129 * UIProcess/Downloads/DownloadProxy.messages.in: 130 * WebKit.xcodeproj/project.pbxproj: 131 * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm: 132 (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession): 133 * WebProcess/WebProcess.cpp: 134 (WebKit::WebProcess::initializeWebProcess): 135 (WebKit::WebProcess::clearCachedCredentials): 136 * config.h: 137 1 138 2018-01-22 Youenn Fablet <youenn@apple.com> 2 139 -
trunk/Source/WebKit/NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm
r220506 r227364 108 108 void LegacyCustomProtocolManager::registerProtocolClass() 109 109 { 110 #if !USE(NETWORK_SESSION) 111 [NSURLProtocol registerClass:[WKCustomProtocol class]]; 112 #endif 113 } 114 115 #if USE(NETWORK_SESSION) 110 } 111 116 112 void LegacyCustomProtocolManager::registerProtocolClass(NSURLSessionConfiguration *configuration) 117 113 { 118 114 configuration.protocolClasses = @[[WKCustomProtocol class]]; 119 115 } 120 #endif121 116 122 117 void LegacyCustomProtocolManager::registerScheme(const String& scheme) -
trunk/Source/WebKit/NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h
r221743 r227364 95 95 void stopLoading(uint64_t customProtocolID); 96 96 97 #if PLATFORM(COCOA) && USE(NETWORK_SESSION)97 #if PLATFORM(COCOA) 98 98 void registerProtocolClass(NSURLSessionConfiguration*); 99 99 #endif -
trunk/Source/WebKit/NetworkProcess/Downloads/Download.cpp
r225926 r227364 28 28 29 29 #include "AuthenticationManager.h" 30 #include "BlobDownloadClient.h"31 30 #include "Connection.h" 32 31 #include "DataReference.h" … … 51 50 namespace WebKit { 52 51 53 #if USE(NETWORK_SESSION)54 52 Download::Download(DownloadManager& downloadManager, DownloadID downloadID, NetworkDataTask& download, const PAL::SessionID& sessionID, const String& suggestedName) 55 53 : m_downloadManager(downloadManager) … … 63 61 m_downloadManager.didCreateDownload(); 64 62 } 63 65 64 #if PLATFORM(COCOA) 66 65 Download::Download(DownloadManager& downloadManager, DownloadID downloadID, NSURLSessionDownloadTask* download, const PAL::SessionID& sessionID, const String& suggestedName) … … 76 75 } 77 76 #endif 78 #else79 Download::Download(DownloadManager& downloadManager, DownloadID downloadID, const ResourceRequest& request, const String& suggestedName)80 : m_downloadManager(downloadManager)81 , m_downloadID(downloadID)82 , m_request(request)83 , m_suggestedName(suggestedName)84 {85 ASSERT(m_downloadID.downloadID());86 87 m_downloadManager.didCreateDownload();88 }89 #endif // USE(NETWORK_SESSION)90 77 91 78 Download::~Download() 92 79 { 93 #if !USE(NETWORK_SESSION)94 for (auto& fileReference : m_blobFileReferences)95 fileReference->revokeFileAccess();96 97 if (m_resourceHandle) {98 m_resourceHandle->clearClient();99 m_resourceHandle->cancel();100 m_resourceHandle = nullptr;101 }102 m_downloadClient = nullptr;103 104 platformInvalidate();105 #endif106 107 80 m_downloadManager.didDestroyDownload(); 108 81 } 109 82 110 #if !USE(NETWORK_SESSION)111 void Download::start()112 {113 if (m_request.url().protocolIsBlob()) {114 m_downloadClient = std::make_unique<BlobDownloadClient>(*this);115 bool defersLoading = false;116 bool shouldContentSniff = false;117 bool shouldContentEncodingSniff = true;118 m_resourceHandle = ResourceHandle::create(nullptr, m_request, m_downloadClient.get(), defersLoading, shouldContentSniff, shouldContentEncodingSniff);119 didStart();120 return;121 }122 123 startNetworkLoad();124 }125 126 void Download::startWithHandle(ResourceHandle* handle, const ResourceResponse& response)127 {128 if (m_request.url().protocolIsBlob()) {129 m_downloadClient = std::make_unique<BlobDownloadClient>(*this);130 bool defersLoading = false;131 bool shouldContentSniff = false;132 bool shouldContentEncodingSniff = true;133 m_resourceHandle = ResourceHandle::create(nullptr, m_request, m_downloadClient.get(), defersLoading, shouldContentSniff, shouldContentEncodingSniff);134 didStart();135 return;136 }137 138 startNetworkLoadWithHandle(handle, response);139 }140 #endif141 142 83 void Download::cancel() 143 84 { 144 #if USE(NETWORK_SESSION)145 85 if (m_download) { 146 86 m_download->cancel(); … … 148 88 return; 149 89 } 150 #else151 if (m_request.url().protocolIsBlob()) {152 auto resourceHandle = WTFMove(m_resourceHandle);153 resourceHandle->cancel();154 static_cast<BlobDownloadClient*>(m_downloadClient.get())->didCancel();155 return;156 }157 #endif158 90 platformCancelNetworkLoad(); 159 91 } 160 92 161 #if USE(NETWORK_SESSION)162 93 void Download::didReceiveChallenge(const WebCore::AuthenticationChallenge& challenge, ChallengeCompletionHandler&& completionHandler) 163 94 { … … 169 100 NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*this, challenge, WTFMove(completionHandler)); 170 101 } 171 #endif // USE(NETWORK_SESSION)172 173 #if !USE(NETWORK_SESSION)174 void Download::didStart()175 {176 send(Messages::DownloadProxy::DidStart(m_request, m_suggestedName));177 }178 179 void Download::willSendRedirectedRequest(WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse)180 {181 send(Messages::DownloadProxy::WillSendRequest(WTFMove(redirectRequest), WTFMove(redirectResponse)));182 }183 184 void Download::didReceiveAuthenticationChallenge(const AuthenticationChallenge& authenticationChallenge)185 {186 m_downloadManager.downloadsAuthenticationManager().didReceiveAuthenticationChallenge(*this, authenticationChallenge);187 }188 189 void Download::didReceiveResponse(const ResourceResponse& response)190 {191 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: Created (id = %" PRIu64 ")", downloadID().downloadID());192 193 m_responseMIMEType = response.mimeType();194 send(Messages::DownloadProxy::DidReceiveResponse(response));195 }196 197 bool Download::shouldDecodeSourceDataOfMIMEType(const String& mimeType)198 {199 bool result;200 if (!sendSync(Messages::DownloadProxy::ShouldDecodeSourceDataOfMIMEType(mimeType), Messages::DownloadProxy::ShouldDecodeSourceDataOfMIMEType::Reply(result)))201 return true;202 203 return result;204 }205 206 String Download::decideDestinationWithSuggestedFilename(const String& filename, bool& allowOverwrite)207 {208 String destination;209 SandboxExtension::Handle sandboxExtensionHandle;210 if (!sendSync(Messages::DownloadProxy::DecideDestinationWithSuggestedFilename(filename, m_responseMIMEType), Messages::DownloadProxy::DecideDestinationWithSuggestedFilename::Reply(destination, allowOverwrite, sandboxExtensionHandle)))211 return String();212 213 m_sandboxExtension = SandboxExtension::create(WTFMove(sandboxExtensionHandle));214 if (m_sandboxExtension)215 m_sandboxExtension->consume();216 217 return destination;218 }219 220 void Download::decideDestinationWithSuggestedFilenameAsync(const String& suggestedFilename)221 {222 send(Messages::DownloadProxy::DecideDestinationWithSuggestedFilenameAsync(downloadID(), suggestedFilename));223 }224 225 void Download::didDecideDownloadDestination(const String& destinationPath, SandboxExtension::Handle&& sandboxExtensionHandle, bool allowOverwrite)226 {227 ASSERT(!m_sandboxExtension);228 m_sandboxExtension = SandboxExtension::create(WTFMove(sandboxExtensionHandle));229 if (m_sandboxExtension)230 m_sandboxExtension->consume();231 232 if (m_request.url().protocolIsBlob()) {233 static_cast<BlobDownloadClient*>(m_downloadClient.get())->didDecideDownloadDestination(destinationPath, allowOverwrite);234 return;235 }236 237 // For now, only Blob URL downloads go through this code path.238 ASSERT_NOT_REACHED();239 }240 241 void Download::continueDidReceiveResponse()242 {243 m_resourceHandle->continueDidReceiveResponse();244 }245 #endif246 102 247 103 void Download::didCreateDestination(const String& path) … … 263 119 { 264 120 RELEASE_LOG_IF_ALLOWED("didFinish: (id = %" PRIu64 ")", downloadID().downloadID()); 265 266 #if !USE(NETWORK_SESSION)267 platformDidFinish();268 #endif269 121 270 122 send(Messages::DownloadProxy::DidFinish()); … … 317 169 bool Download::isAlwaysOnLoggingAllowed() const 318 170 { 319 #if USE(NETWORK_SESSION) &&PLATFORM(COCOA)171 #if PLATFORM(COCOA) 320 172 return m_sessionID.isAlwaysOnLoggingAllowed(); 321 173 #else -
trunk/Source/WebKit/NetworkProcess/Downloads/Download.h
r225926 r227364 28 28 #include "DownloadID.h" 29 29 #include "MessageSender.h" 30 #include "NetworkDataTask.h" 30 31 #include "SandboxExtension.h" 32 #include <WebCore/AuthenticationChallenge.h> 31 33 #include <WebCore/ResourceHandle.h> 32 34 #include <WebCore/ResourceHandleClient.h> … … 37 39 #include <wtf/RetainPtr.h> 38 40 39 #if USE(NETWORK_SESSION)40 #include "NetworkDataTask.h"41 #include <WebCore/AuthenticationChallenge.h>42 41 #if PLATFORM(COCOA) 43 42 OBJC_CLASS NSURLSessionDownloadTask; 44 43 #endif 45 #else // USE(NETWORK_SESSION)46 #if PLATFORM(COCOA)47 OBJC_CLASS NSURLDownload;48 OBJC_CLASS WKDownloadAsDelegate;49 #endif50 #endif // USE(NETWORK_SESSION)51 44 52 45 namespace IPC { … … 74 67 WTF_MAKE_NONCOPYABLE(Download); WTF_MAKE_FAST_ALLOCATED; 75 68 public: 76 #if USE(NETWORK_SESSION)77 69 Download(DownloadManager&, DownloadID, NetworkDataTask&, const PAL::SessionID& sessionID, const String& suggestedFilename = { }); 78 70 #if PLATFORM(COCOA) 79 71 Download(DownloadManager&, DownloadID, NSURLSessionDownloadTask*, const PAL::SessionID& sessionID, const String& suggestedFilename = { }); 80 72 #endif 81 #else82 Download(DownloadManager&, DownloadID, const WebCore::ResourceRequest&, const String& suggestedFilename = { });83 #endif84 73 85 74 ~Download(); 86 75 87 #if !USE(NETWORK_SESSION)88 void setBlobFileReferences(Vector<RefPtr<WebCore::BlobDataFileReference>>&& fileReferences) { m_blobFileReferences = WTFMove(fileReferences); }89 90 void start();91 void startWithHandle(WebCore::ResourceHandle*, const WebCore::ResourceResponse&);92 #endif93 76 void resume(const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&); 94 77 void cancel(); … … 97 80 const String& suggestedName() const { return m_suggestedName; } 98 81 99 #if USE(NETWORK_SESSION)100 82 void setSandboxExtension(RefPtr<SandboxExtension>&& sandboxExtension) { m_sandboxExtension = WTFMove(sandboxExtension); } 101 83 void didReceiveChallenge(const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&); 102 #else103 const WebCore::ResourceRequest& request() const { return m_request; }104 void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&);105 void didStart();106 void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceResponse&&);107 void didReceiveResponse(const WebCore::ResourceResponse&);108 bool shouldDecodeSourceDataOfMIMEType(const String& mimeType);109 String decideDestinationWithSuggestedFilename(const String& filename, bool& allowOverwrite);110 void decideDestinationWithSuggestedFilenameAsync(const String&);111 void didDecideDownloadDestination(const String& destinationPath, SandboxExtension::Handle&&, bool allowOverwrite);112 void continueDidReceiveResponse();113 void platformDidFinish();114 #endif115 84 void didCreateDestination(const String& path); 116 85 void didReceiveData(uint64_t length); … … 124 93 uint64_t messageSenderDestinationID() override; 125 94 126 #if !USE(NETWORK_SESSION)127 void startNetworkLoad();128 void startNetworkLoadWithHandle(WebCore::ResourceHandle*, const WebCore::ResourceResponse&);129 void platformInvalidate();130 #endif131 95 void platformCancelNetworkLoad(); 132 96 … … 139 103 RefPtr<SandboxExtension> m_sandboxExtension; 140 104 141 #if USE(NETWORK_SESSION)142 105 RefPtr<NetworkDataTask> m_download; 143 106 #if PLATFORM(COCOA) … … 145 108 #endif 146 109 PAL::SessionID m_sessionID; 147 #else // USE(NETWORK_SESSION)148 WebCore::ResourceRequest m_request;149 String m_responseMIMEType;150 #if PLATFORM(COCOA)151 RetainPtr<NSURLDownload> m_nsURLDownload;152 RetainPtr<WKDownloadAsDelegate> m_delegate;153 #endif154 std::unique_ptr<WebCore::ResourceHandleClient> m_downloadClient;155 RefPtr<WebCore::ResourceHandle> m_resourceHandle;156 #endif // USE(NETWORK_SESSION)157 110 String m_suggestedName; 158 111 bool m_hasReceivedData { false }; -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp
r225926 r227364 48 48 void DownloadManager::startDownload(NetworkConnectionToWebProcess* connection, PAL::SessionID sessionID, DownloadID downloadID, const ResourceRequest& request, const String& suggestedName) 49 49 { 50 #if USE(NETWORK_SESSION)51 50 auto* networkSession = SessionTracker::networkSession(sessionID); 52 51 if (!networkSession) … … 62 61 63 62 m_pendingDownloads.add(downloadID, std::make_unique<PendingDownload>(WTFMove(parameters), downloadID, *networkSession, suggestedName)); 64 #else65 auto download = std::make_unique<Download>(*this, downloadID, request, suggestedName);66 if (request.url().protocolIsBlob() && connection) {67 auto blobFileReferences = NetworkBlobRegistry::singleton().filesInBlob(*connection, request.url());68 for (auto& fileReference : blobFileReferences)69 fileReference->prepareForFileAccess();70 download->setBlobFileReferences(WTFMove(blobFileReferences));71 }72 download->start();73 74 ASSERT(!m_downloads.contains(downloadID));75 m_downloads.add(downloadID, WTFMove(download));76 #endif77 63 } 78 64 79 #if USE(NETWORK_SESSION)80 65 void DownloadManager::dataTaskBecameDownloadTask(DownloadID downloadID, std::unique_ptr<Download>&& download) 81 66 { … … 101 86 ASSERT_UNUSED(addResult, addResult.isNewEntry); 102 87 } 103 #endif // USE(NETWORK_SESSION)104 88 105 89 void DownloadManager::convertNetworkLoadToDownload(DownloadID downloadID, std::unique_ptr<NetworkLoad>&& networkLoad, Vector<RefPtr<WebCore::BlobDataFileReference>>&& blobFileReferences, const ResourceRequest& request, const ResourceResponse& response) 106 90 { 107 #if USE(NETWORK_SESSION)108 91 ASSERT(!m_pendingDownloads.contains(downloadID)); 109 92 m_pendingDownloads.add(downloadID, std::make_unique<PendingDownload>(WTFMove(networkLoad), downloadID, request, response)); 110 #else111 auto download = std::make_unique<Download>(*this, downloadID, request);112 download->setBlobFileReferences(WTFMove(blobFileReferences));113 114 auto* handle = networkLoad->handle();115 ASSERT(handle);116 download->startWithHandle(handle, response);117 ASSERT(!m_downloads.contains(downloadID));118 m_downloads.add(downloadID, WTFMove(download));119 120 // Unblock the URL connection operation queue.121 handle->continueDidReceiveResponse();122 #endif123 93 } 124 94 125 95 void DownloadManager::continueDecidePendingDownloadDestination(DownloadID downloadID, String destination, SandboxExtension::Handle&& sandboxExtensionHandle, bool allowOverwrite) 126 96 { 127 #if USE(NETWORK_SESSION)128 97 if (m_downloadsWaitingForDestination.contains(downloadID)) { 129 98 auto pair = m_downloadsWaitingForDestination.take(downloadID); … … 147 116 m_downloadsAfterDestinationDecided.set(downloadID, networkDataTask); 148 117 } 149 #else150 if (auto* waitingDownload = download(downloadID))151 waitingDownload->didDecideDownloadDestination(destination, WTFMove(sandboxExtensionHandle), allowOverwrite);152 #endif153 118 } 154 119 155 120 void DownloadManager::resumeDownload(PAL::SessionID sessionID, DownloadID downloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&& sandboxExtensionHandle) 156 121 { 157 #if USE(NETWORK_SESSION) &&!PLATFORM(COCOA)122 #if !PLATFORM(COCOA) 158 123 notImplemented(); 159 124 #else 160 #if USE(NETWORK_SESSION)161 125 auto download = std::make_unique<Download>(*this, downloadID, nullptr, sessionID); 162 #else163 // Download::resume() is responsible for setting the Download's resource request.164 auto download = std::make_unique<Download>(*this, downloadID, ResourceRequest());165 #endif166 126 167 127 download->resume(resumeData, path, WTFMove(sandboxExtensionHandle)); … … 174 134 { 175 135 if (Download* download = m_downloads.get(downloadID)) { 176 #if USE(NETWORK_SESSION)177 136 ASSERT(!m_downloadsWaitingForDestination.contains(downloadID)); 178 137 ASSERT(!m_pendingDownloads.contains(downloadID)); 179 #endif180 138 download->cancel(); 181 139 return; 182 140 } 183 #if USE(NETWORK_SESSION)184 141 auto pendingDownload = m_pendingDownloads.take(downloadID); 185 142 if (m_downloadsWaitingForDestination.contains(downloadID)) { … … 198 155 if (pendingDownload) 199 156 pendingDownload->cancel(); 200 #endif201 157 } 202 158 -
trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h
r225926 r227364 71 71 virtual IPC::Connection* downloadProxyConnection() = 0; 72 72 virtual AuthenticationManager& downloadsAuthenticationManager() = 0; 73 #if USE(NETWORK_SESSION)74 73 virtual void pendingDownloadCanceled(DownloadID) = 0; 75 #endif76 74 }; 77 75 … … 79 77 80 78 void startDownload(NetworkConnectionToWebProcess*, PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedName = { }); 81 #if USE(NETWORK_SESSION)82 79 void dataTaskBecameDownloadTask(DownloadID, std::unique_ptr<Download>&&); 83 80 void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&); 84 81 void willDecidePendingDownloadDestination(NetworkDataTask&, ResponseCompletionHandler&&); 85 #endif86 82 void convertNetworkLoadToDownload(DownloadID, std::unique_ptr<NetworkLoad>&&, Vector<RefPtr<WebCore::BlobDataFileReference>>&&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); 87 83 void continueDecidePendingDownloadDestination(DownloadID, String destination, SandboxExtension::Handle&&, bool allowOverwrite); … … 105 101 private: 106 102 Client& m_client; 107 #if USE(NETWORK_SESSION)108 103 HashMap<DownloadID, std::unique_ptr<PendingDownload>> m_pendingDownloads; 109 104 HashMap<DownloadID, std::pair<RefPtr<NetworkDataTask>, ResponseCompletionHandler>> m_downloadsWaitingForDestination; 110 105 HashMap<DownloadID, RefPtr<NetworkDataTask>> m_downloadsAfterDestinationDecided; 111 #endif112 106 HashMap<DownloadID, std::unique_ptr<Download>> m_downloads; 113 107 }; -
trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp
r224134 r227364 26 26 #include "config.h" 27 27 #include "PendingDownload.h" 28 29 #if USE(NETWORK_SESSION)30 28 31 29 #include "DataReference.h" … … 102 100 103 101 } 104 105 #endif -
trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h
r224134 r227364 24 24 */ 25 25 26 #ifndef PendingDownload_h 27 #define PendingDownload_h 28 29 #if USE(NETWORK_SESSION) 26 #pragma once 30 27 31 28 #include "MessageSender.h" … … 76 73 77 74 } 78 79 #endif80 81 #endif -
trunk/Source/WebKit/NetworkProcess/Downloads/cocoa/DownloadCocoa.mm
r225926 r227364 26 26 #import "config.h" 27 27 #import "Download.h" 28 29 #if USE(NETWORK_SESSION)30 28 31 29 #import "DataReference.h" … … 75 73 76 74 } 77 78 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp
r222492 r227364 26 26 #include "config.h" 27 27 #include "NetworkCORSPreflightChecker.h" 28 29 #if USE(NETWORK_SESSION)30 28 31 29 #include "AuthenticationManager.h" … … 134 132 135 133 } // Namespace WebKit 136 137 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h
r222467 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 #include "NetworkDataTask.h" … … 76 74 77 75 } // namespace WebKit 78 79 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r226542 r227364 44 44 #include "NetworkSocketStream.h" 45 45 #include "NetworkSocketStreamMessages.h" 46 #include "PingLoad.h" 46 47 #include "PreconnectTask.h" 47 48 #include "RemoteNetworkingContext.h" … … 58 59 #include <pal/SessionID.h> 59 60 60 #if USE(NETWORK_SESSION)61 #include "PingLoad.h"62 #endif63 64 61 using namespace WebCore; 65 62 … … 244 241 }; 245 242 246 #if USE(NETWORK_SESSION)247 243 // PingLoad manages its own lifetime, deleting itself when its purpose has been fulfilled. 248 244 new PingLoad(WTFMove(loadParameters), WTFMove(originalRequestHeaders), WTFMove(completionHandler)); 249 #else250 UNUSED_PARAM(originalRequestHeaders);251 auto context = RemoteNetworkingContext::create(loadParameters.sessionID, loadParameters.shouldClearReferrerOnHTTPSToHTTPRedirect);252 253 // PingHandle manages its own lifetime, deleting itself when its purpose has been fulfilled.254 new PingHandle(context.ptr(), loadParameters.request, loadParameters.storedCredentialsPolicy == StoredCredentialsPolicy::Use, loadParameters.shouldFollowRedirects, WTFMove(completionHandler));255 #endif256 245 } 257 246 -
trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp
r225827 r227364 26 26 #include "config.h" 27 27 #include "NetworkDataTask.h" 28 29 #if USE(NETWORK_SESSION)30 28 31 29 #include "NetworkDataTaskBlob.h" … … 141 139 142 140 } // namespace WebKit 143 144 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkDataTask.h
r225926 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 #include "DownloadID.h" … … 161 159 162 160 } // namespace WebKit 163 164 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp
r225926 r227364 33 33 #include "NetworkDataTaskBlob.h" 34 34 35 #if USE(NETWORK_SESSION)36 37 35 #include "DataReference.h" 38 36 #include "Download.h" … … 585 583 586 584 } // namespace WebKit 587 588 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.h
r225926 r227364 31 31 32 32 #pragma once 33 34 #if USE(NETWORK_SESSION)35 33 36 34 #include "NetworkDataTask.h" … … 121 119 122 120 } // namespace WebKit 123 124 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp
r224373 r227364 54 54 using namespace WebCore; 55 55 56 #if USE(NETWORK_SESSION)57 58 56 struct NetworkLoad::Throttle { 59 57 Throttle(NetworkLoad& load, Seconds delay, ResourceResponse&& response, ResponseCompletionHandler&& handler) … … 118 116 } 119 117 120 #else121 122 NetworkLoad::NetworkLoad(NetworkLoadClient& client, NetworkLoadParameters&& parameters)123 : m_client(client)124 , m_parameters(WTFMove(parameters))125 , m_networkingContext(RemoteNetworkingContext::create(m_parameters.sessionID, m_parameters.shouldClearReferrerOnHTTPSToHTTPRedirect))126 , m_currentRequest(m_parameters.request)127 {128 m_handle = ResourceHandle::create(m_networkingContext.get(), m_parameters.request, this, m_parameters.defersLoading, m_parameters.contentSniffingPolicy == SniffContent, m_parameters.contentEncodingSniffingPolicy == ContentEncodingSniffingPolicy::Sniff);129 }130 131 #endif132 133 118 NetworkLoad::~NetworkLoad() 134 119 { … … 136 121 if (m_redirectCompletionHandler) 137 122 m_redirectCompletionHandler({ }); 138 #if USE(NETWORK_SESSION)139 123 if (m_responseCompletionHandler) 140 124 m_responseCompletionHandler(PolicyAction::Ignore); … … 145 129 if (m_task) 146 130 m_task->clearClient(); 147 #else148 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)149 if (m_handle && m_waitingForContinueCanAuthenticateAgainstProtectionSpace)150 m_handle->continueCanAuthenticateAgainstProtectionSpace(false);151 #endif152 if (m_handle)153 m_handle->clearClient();154 #endif155 131 } 156 132 157 133 void NetworkLoad::setDefersLoading(bool defers) 158 134 { 159 #if USE(NETWORK_SESSION)160 135 if (m_task) { 161 136 if (defers) … … 169 144 } 170 145 } 171 #else172 if (m_handle)173 m_handle->setDefersLoading(defers);174 #endif175 146 } 176 147 177 148 void NetworkLoad::cancel() 178 149 { 179 #if USE(NETWORK_SESSION)180 150 if (m_task) 181 151 m_task->cancel(); 182 #else183 if (m_handle)184 m_handle->cancel();185 #endif186 152 } 187 153 … … 200 166 #endif 201 167 202 #if USE(NETWORK_SESSION)203 168 auto redirectCompletionHandler = std::exchange(m_redirectCompletionHandler, nullptr); 204 169 ASSERT(redirectCompletionHandler); … … 213 178 if (redirectCompletionHandler) 214 179 redirectCompletionHandler(ResourceRequest(m_currentRequest)); 215 #else216 if (m_currentRequest.isNull()) {217 if (m_handle)218 m_handle->cancel();219 didFail(m_handle.get(), cancelledError(m_currentRequest));220 } else if (m_handle) {221 auto currentRequestCopy = m_currentRequest;222 auto redirectCompletionHandler = std::exchange(m_redirectCompletionHandler, nullptr);223 ASSERT(redirectCompletionHandler);224 redirectCompletionHandler(WTFMove(currentRequestCopy));225 }226 #endif227 180 } 228 181 229 182 void NetworkLoad::continueDidReceiveResponse() 230 183 { 231 #if USE(NETWORK_SESSION)232 184 if (m_responseCompletionHandler) { 233 185 auto responseCompletionHandler = std::exchange(m_responseCompletionHandler, nullptr); 234 186 responseCompletionHandler(PolicyAction::Use); 235 187 } 236 #else 237 if (m_handle) 238 m_handle->continueDidReceiveResponse(); 239 #endif 240 } 241 242 #if USE(NETWORK_SESSION) 188 } 189 243 190 bool NetworkLoad::shouldCaptureExtraNetworkLoadMetrics() const 244 191 { 245 192 return m_client.get().shouldCaptureExtraNetworkLoadMetrics(); 246 193 } 247 #endif248 194 249 195 NetworkLoadClient::ShouldContinueDidReceiveResponse NetworkLoad::sharedDidReceiveResponse(ResourceResponse&& response) … … 276 222 return m_client.get().isAllowedToAskUserForCredentials(); 277 223 } 278 279 #if USE(NETWORK_SESSION)280 224 281 225 void NetworkLoad::convertTaskToDownload(PendingDownload& pendingDownload, const ResourceRequest& updatedRequest, const ResourceResponse& response) … … 456 400 } 457 401 458 #else459 460 void NetworkLoad::didReceiveResponseAsync(ResourceHandle* handle, ResourceResponse&& receivedResponse)461 {462 ASSERT_UNUSED(handle, handle == m_handle);463 if (sharedDidReceiveResponse(WTFMove(receivedResponse)) == NetworkLoadClient::ShouldContinueDidReceiveResponse::Yes)464 m_handle->continueDidReceiveResponse();465 }466 467 void NetworkLoad::didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int /* encodedDataLength */)468 {469 // The NetworkProcess should never get a didReceiveData callback.470 // We should always be using didReceiveBuffer.471 ASSERT_NOT_REACHED();472 }473 474 void NetworkLoad::didReceiveBuffer(ResourceHandle* handle, Ref<SharedBuffer>&& buffer, int reportedEncodedDataLength)475 {476 ASSERT_UNUSED(handle, handle == m_handle);477 m_client.get().didReceiveBuffer(WTFMove(buffer), reportedEncodedDataLength);478 }479 480 void NetworkLoad::didFinishLoading(ResourceHandle* handle)481 {482 ASSERT_UNUSED(handle, handle == m_handle);483 NetworkLoadMetrics emptyMetrics;484 m_client.get().didFinishLoading(emptyMetrics);485 }486 487 void NetworkLoad::didFail(ResourceHandle* handle, const ResourceError& error)488 {489 ASSERT_UNUSED(handle, !handle || handle == m_handle);490 ASSERT(!error.isNull());491 492 m_client.get().didFailLoading(error);493 }494 495 void NetworkLoad::willSendRequestAsync(ResourceHandle* handle, ResourceRequest&& request, ResourceResponse&& redirectResponse, CompletionHandler<void(ResourceRequest&&)>&& completionHandler)496 {497 ASSERT(!m_redirectCompletionHandler);498 m_redirectCompletionHandler = WTFMove(completionHandler);499 ASSERT_UNUSED(handle, handle == m_handle);500 sharedWillSendRedirectedRequest(WTFMove(request), WTFMove(redirectResponse));501 }502 503 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)504 void NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle* handle, const ProtectionSpace& protectionSpace)505 {506 ASSERT(RunLoop::isMain());507 ASSERT_UNUSED(handle, handle == m_handle);508 509 // Handle server trust evaluation at platform-level if requested, for performance reasons.510 if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested511 && !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) {512 continueCanAuthenticateAgainstProtectionSpace(false);513 return;514 }515 516 m_waitingForContinueCanAuthenticateAgainstProtectionSpace = true;517 m_client.get().canAuthenticateAgainstProtectionSpaceAsync(protectionSpace);518 }519 520 void NetworkLoad::continueCanAuthenticateAgainstProtectionSpace(bool result)521 {522 m_waitingForContinueCanAuthenticateAgainstProtectionSpace = false;523 if (m_handle)524 m_handle->continueCanAuthenticateAgainstProtectionSpace(result);525 }526 #endif527 528 void NetworkLoad::didSendData(ResourceHandle* handle, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)529 {530 ASSERT_UNUSED(handle, handle == m_handle);531 532 m_client.get().didSendData(bytesSent, totalBytesToBeSent);533 }534 535 void NetworkLoad::wasBlocked(ResourceHandle* handle)536 {537 ASSERT_UNUSED(handle, handle == m_handle);538 539 didFail(handle, WebKit::blockedError(m_currentRequest));540 }541 542 void NetworkLoad::cannotShowURL(ResourceHandle* handle)543 {544 ASSERT_UNUSED(handle, handle == m_handle);545 546 didFail(handle, WebKit::cannotShowURLError(m_currentRequest));547 }548 549 bool NetworkLoad::shouldUseCredentialStorage(ResourceHandle* handle)550 {551 ASSERT_UNUSED(handle, handle == m_handle || !m_handle); // m_handle will be 0 if called from ResourceHandle::start().552 553 // When the WebProcess is handling loading a client is consulted each time this shouldUseCredentialStorage question is asked.554 // In NetworkProcess mode we ask the WebProcess client up front once and then reuse the cached answer.555 556 // We still need this sync version, because ResourceHandle itself uses it internally, even when the delegate uses an async one.557 558 return m_parameters.storedCredentialsPolicy == StoredCredentialsPolicy::Use;559 }560 561 void NetworkLoad::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge)562 {563 ASSERT_UNUSED(handle, handle == m_handle);564 565 if (!isAllowedToAskUserForCredentials()) {566 challenge.authenticationClient()->receivedRequestToContinueWithoutCredential(challenge);567 return;568 }569 570 NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);571 }572 573 void NetworkLoad::receivedCancellation(ResourceHandle* handle, const AuthenticationChallenge&)574 {575 ASSERT_UNUSED(handle, handle == m_handle);576 577 m_handle->cancel();578 didFail(m_handle.get(), cancelledError(m_currentRequest));579 }580 #endif // USE(NETWORK_SESSION)581 582 402 } // namespace WebKit -
trunk/Source/WebKit/NetworkProcess/NetworkLoad.h
r224828 r227364 26 26 #pragma once 27 27 28 #include "DownloadID.h" 29 #include "NetworkDataTask.h" 28 30 #include "NetworkLoadClient.h" 29 31 #include "NetworkLoadParameters.h" 30 32 #include "RemoteNetworkingContext.h" 33 #include <WebCore/AuthenticationChallenge.h> 31 34 #include <WebCore/ResourceHandleClient.h> 32 35 #include <wtf/CompletionHandler.h> 33 36 #include <wtf/Optional.h> 34 35 #if USE(NETWORK_SESSION)36 #include "DownloadID.h"37 #include "NetworkDataTask.h"38 #include <WebCore/AuthenticationChallenge.h>39 #endif40 37 41 38 #if ENABLE(NETWORK_CAPTURE) … … 46 43 namespace WebKit { 47 44 48 class NetworkLoad final : 49 #if USE(NETWORK_SESSION) 50 private NetworkDataTaskClient 51 #else 52 private WebCore::ResourceHandleClient 53 #endif 45 class NetworkLoad final : private NetworkDataTaskClient 54 46 { 55 47 WTF_MAKE_FAST_ALLOCATED; 56 48 public: 57 #if USE(NETWORK_SESSION)58 49 NetworkLoad(NetworkLoadClient&, NetworkLoadParameters&&, NetworkSession&); 59 #else60 NetworkLoad(NetworkLoadClient&, NetworkLoadParameters&&);61 #endif62 50 ~NetworkLoad(); 63 51 … … 75 63 void continueDidReceiveResponse(); 76 64 77 #if USE(NETWORK_SESSION)78 65 void convertTaskToDownload(PendingDownload&, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&); 79 66 void setPendingDownloadID(DownloadID); … … 83 70 84 71 bool shouldCaptureExtraNetworkLoadMetrics() const final; 85 #else86 WebCore::ResourceHandle* handle() const { return m_handle.get(); }87 88 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)89 void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&) override;90 #endif91 #if PLATFORM(COCOA)92 void willCacheResponseAsync(WebCore::ResourceHandle*, NSCachedURLResponse *) override;93 #endif94 #endif // USE(NETWORK_SESSION)95 72 96 73 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) … … 99 76 100 77 private: 101 #if USE(NETWORK_SESSION)102 78 #if ENABLE(NETWORK_CAPTURE) 103 79 void initializeForRecord(NetworkSession&); … … 105 81 #endif 106 82 void initialize(NetworkSession&); 107 #endif108 83 109 84 NetworkLoadClient::ShouldContinueDidReceiveResponse sharedDidReceiveResponse(WebCore::ResourceResponse&&); 110 85 void sharedWillSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceResponse&&); 111 86 112 #if !USE(NETWORK_SESSION)113 // ResourceHandleClient114 void willSendRequestAsync(WebCore::ResourceHandle*, WebCore::ResourceRequest&&, WebCore::ResourceResponse&& redirectResponse, CompletionHandler<void(WebCore::ResourceRequest&&)>&&) final;115 void didSendData(WebCore::ResourceHandle*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) final;116 void didReceiveResponseAsync(WebCore::ResourceHandle*, WebCore::ResourceResponse&&) final;117 void didReceiveData(WebCore::ResourceHandle*, const char*, unsigned, int encodedDataLength) final;118 void didReceiveBuffer(WebCore::ResourceHandle*, Ref<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) final;119 void didFinishLoading(WebCore::ResourceHandle*) final;120 void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError&) final;121 void wasBlocked(WebCore::ResourceHandle*) final;122 void cannotShowURL(WebCore::ResourceHandle*) final;123 bool shouldUseCredentialStorage(WebCore::ResourceHandle*) final;124 void didReceiveAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) final;125 void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&) final;126 bool loadingSynchronousXHR() final { return m_client.get().isSynchronous(); }127 #else128 87 // NetworkDataTaskClient 129 88 void willPerformHTTPRedirection(WebCore::ResourceResponse&&, WebCore::ResourceRequest&&, RedirectCompletionHandler&&) final; … … 140 99 141 100 void completeAuthenticationChallenge(ChallengeCompletionHandler&&); 142 #endif143 101 144 102 std::reference_wrapper<NetworkLoadClient> m_client; 145 103 const NetworkLoadParameters m_parameters; 146 104 CompletionHandler<void(WebCore::ResourceRequest&&)> m_redirectCompletionHandler; 147 #if USE(NETWORK_SESSION)148 105 RefPtr<NetworkDataTask> m_task; 149 106 std::optional<WebCore::AuthenticationChallenge> m_challenge; … … 155 112 struct Throttle; 156 113 std::unique_ptr<Throttle> m_throttle; 157 #else158 bool m_waitingForContinueCanAuthenticateAgainstProtectionSpace { false };159 RefPtr<RemoteNetworkingContext> m_networkingContext;160 RefPtr<WebCore::ResourceHandle> m_handle;161 #endif162 114 163 115 WebCore::ResourceRequest m_currentRequest; // Updated on redirects. -
trunk/Source/WebKit/NetworkProcess/NetworkLoadParameters.h
r224299 r227364 24 24 */ 25 25 26 #ifndef NetworkLoadParameters_h 27 #define NetworkLoadParameters_h 26 #pragma once 28 27 29 28 #include <WebCore/BlobDataFileReference.h> … … 50 49 bool defersLoading { false }; 51 50 bool needsCertificateInfo { false }; 52 #if USE(NETWORK_SESSION)53 51 Vector<RefPtr<WebCore::BlobDataFileReference>> blobFileReferences; 54 #endif55 52 PreconnectOnly shouldPreconnectOnly { PreconnectOnly::No }; 56 53 }; 57 54 58 55 } // namespace WebKit 59 60 #endif // NetworkLoadParameters_h -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
r226482 r227364 253 253 #endif 254 254 255 #if USE(NETWORK_SESSION)256 255 #if ENABLE(LEGACY_CUSTOM_PROTOCOL_MANAGER) 257 256 parameters.defaultSessionParameters.legacyCustomProtocolManager = supplement<LegacyCustomProtocolManager>(); 258 257 #endif 259 258 SessionTracker::setSession(PAL::SessionID::defaultSessionID(), NetworkSession::create(WTFMove(parameters.defaultSessionParameters))); 260 #endif261 259 262 260 for (auto& supplement : m_supplements.values()) … … 301 299 { 302 300 NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials(); 303 #if USE(NETWORK_SESSION)304 301 if (auto* networkSession = SessionTracker::networkSession(PAL::SessionID::defaultSessionID())) 305 302 networkSession->clearCredentials(); 306 303 else 307 304 ASSERT_NOT_REACHED(); 308 #endif309 305 } 310 306 … … 594 590 #endif 595 591 596 #if USE(NETWORK_SESSION)597 592 void NetworkProcess::continueWillSendRequest(DownloadID downloadID, WebCore::ResourceRequest&& request) 598 593 { … … 619 614 downloadProxyConnection()->send(Messages::DownloadProxy::DecideDestinationWithSuggestedFilenameAsync(networkDataTask.pendingDownloadID(), suggestedFilename), destinationID); 620 615 } 621 #endif622 616 623 617 void NetworkProcess::continueDecidePendingDownloadDestination(DownloadID downloadID, String destination, SandboxExtension::Handle&& sandboxExtensionHandle, bool allowOverwrite) -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
r226482 r227364 120 120 #endif 121 121 122 #if USE(NETWORK_SESSION)123 122 void findPendingDownloadLocation(NetworkDataTask&, ResponseCompletionHandler&&, const WebCore::ResourceResponse&); 124 #endif125 123 126 124 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) … … 185 183 IPC::Connection* downloadProxyConnection() override; 186 184 AuthenticationManager& downloadsAuthenticationManager() override; 187 #if USE(NETWORK_SESSION)188 185 void pendingDownloadCanceled(DownloadID) override; 189 #endif190 186 191 187 // Message Handlers … … 211 207 void continueCanAuthenticateAgainstProtectionSpace(uint64_t resourceLoadIdentifier, bool canAuthenticate); 212 208 #endif 213 #if USE(NETWORK_SESSION)214 209 void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&); 215 #endif216 210 void continueDecidePendingDownloadDestination(DownloadID, String destination, SandboxExtension::Handle&&, bool allowOverwrite); 217 211 -
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
r226482 r227364 50 50 ContinueCanAuthenticateAgainstProtectionSpace(uint64_t loaderID, bool canAuthenticate) 51 51 #endif 52 #if USE(NETWORK_SESSION)53 52 ContinueWillSendRequest(WebKit::DownloadID downloadID, WebCore::ResourceRequest request) 54 #endif55 53 ContinueDecidePendingDownloadDestination(WebKit::DownloadID downloadID, String destination, WebKit::SandboxExtension::Handle sandboxExtensionHandle, bool allowOverwrite) 56 54 -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r226913 r227364 107 107 } 108 108 109 #if !USE(NETWORK_SESSION)110 if (originalRequest().url().protocolIsBlob()) {111 ASSERT(!m_parameters.resourceSandboxExtension);112 m_fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(connection, originalRequest().url()));113 }114 #endif115 116 117 109 if (synchronousReply) 118 110 m_synchronousLoadData = std::make_unique<SynchronousLoadData>(WTFMove(synchronousReply)); … … 230 222 parameters.request = request; 231 223 232 #if USE(NETWORK_SESSION)233 224 if (request.url().protocolIsBlob()) 234 225 parameters.blobFileReferences = NetworkBlobRegistry::singleton().filesInBlob(m_connection, originalRequest().url()); … … 243 234 } 244 235 m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters), *networkSession); 245 #else246 m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters));247 #endif248 236 249 237 if (m_defersLoading) { -
trunk/Source/WebKit/NetworkProcess/NetworkSession.cpp
r223791 r227364 26 26 #include "config.h" 27 27 #include "NetworkSession.h" 28 29 #if USE(NETWORK_SESSION)30 28 31 29 #include "NetworkDataTask.h" … … 88 86 89 87 } // namespace WebKit 90 91 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/NetworkSession.h
r223791 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 #include <pal/SessionID.h> … … 68 66 69 67 } // namespace WebKit 70 71 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/PingLoad.cpp
r222739 r227364 27 27 #include "PingLoad.h" 28 28 29 #if USE(NETWORK_SESSION)30 31 29 #include "AuthenticationManager.h" 32 30 #include "Logging.h" … … 331 329 332 330 } // namespace WebKit 333 334 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/PingLoad.h
r222739 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 #include "NetworkDataTask.h" … … 99 97 100 98 } 101 102 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp
r224299 r227364 59 59 parameters.contentEncodingSniffingPolicy = ContentEncodingSniffingPolicy::Sniff; 60 60 parameters.request = m_originalRequest; 61 #if USE(NETWORK_SESSION)62 61 m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters), *SessionTracker::networkSession(PAL::SessionID::defaultSessionID())); 63 #else64 m_networkLoad = std::make_unique<NetworkLoad>(*this, WTFMove(parameters));65 #endif66 62 } 67 63 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.h
r227103 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 #include "NetworkDataTask.h" … … 100 98 101 99 } // namespace WebKit 102 103 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
r227103 r227364 27 27 #import "NetworkDataTaskCocoa.h" 28 28 29 #if USE(NETWORK_SESSION)30 31 29 #import "AuthenticationManager.h" 32 30 #import "Download.h" … … 440 438 441 439 } 442 443 #endif -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r226349 r227364 80 80 SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier); 81 81 82 #if USE(NETWORK_SESSION)83 82 NetworkSessionCocoa::setSourceApplicationAuditTokenData(sourceApplicationAuditData()); 84 83 NetworkSessionCocoa::setSourceApplicationBundleIdentifier(parameters.sourceApplicationBundleIdentifier); … … 87 86 #if PLATFORM(IOS) 88 87 NetworkSessionCocoa::setCTDataConnectionServiceType(parameters.ctDataConnectionServiceType); 89 #endif90 88 #endif 91 89 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
r223791 r227364 25 25 26 26 #pragma once 27 28 #if USE(NETWORK_SESSION)29 27 30 28 OBJC_CLASS NSData; … … 88 86 89 87 } // namespace WebKit 90 91 #endif // USE(NETWORK_SESSION) -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r227103 r227364 27 27 #import "NetworkSessionCocoa.h" 28 28 29 #if USE(NETWORK_SESSION)30 31 29 #import "AuthenticationManager.h" 32 30 #import "DataReference.h" … … 801 799 802 800 } 803 804 #endif -
trunk/Source/WebKit/NetworkProcess/mac/RemoteNetworkingContext.mm
r225383 r227364 113 113 } 114 114 115 #if USE(NETWORK_SESSION)116 115 parameters.networkSessionParameters.legacyCustomProtocolManager = NetworkProcess::singleton().supplement<LegacyCustomProtocolManager>(); 117 116 SessionTracker::setSession(sessionID, NetworkSession::create(WTFMove(parameters.networkSessionParameters))); 118 #endif119 117 } 120 118 -
trunk/Source/WebKit/PlatformMac.cmake
r227001 r227364 28 28 NetworkProcess/Downloads/cocoa/DownloadCocoa.mm 29 29 30 NetworkProcess/Downloads/mac/DownloadMac.mm31 32 30 NetworkProcess/cache/NetworkCacheCodersCocoa.cpp 33 31 NetworkProcess/cache/NetworkCacheDataCocoa.mm … … 38 36 NetworkProcess/cocoa/NetworkSessionCocoa.mm 39 37 40 NetworkProcess/mac/NetworkLoadMac.mm41 38 NetworkProcess/mac/NetworkProcessMac.mm 42 39 NetworkProcess/mac/RemoteNetworkingContext.mm … … 72 69 Shared/APIWebArchive.mm 73 70 Shared/APIWebArchiveResource.mm 74 75 Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm76 71 77 72 Shared/API/Cocoa/RemoteObjectInvocation.mm … … 142 137 Shared/mac/CodeSigning.mm 143 138 Shared/mac/ColorSpaceData.mm 144 Shared/mac/CookieStorageShim.mm145 139 Shared/mac/CookieStorageShimLibrary.cpp 146 140 Shared/mac/HangDetectionDisablerMac.mm -
trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp
r224828 r227364 117 117 118 118 auto pageID = frame->page()->pageID(); 119 uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge 120 #if USE(NETWORK_SESSION) 121 , { } 122 #endif 123 }); 119 uint64_t challengeID = addChallengeToChallengeMap({ pageID, authenticationChallenge, { } }); 124 120 125 121 // Coalesce challenges in the same protection space and in the same page. … … 130 126 } 131 127 132 #if USE(NETWORK_SESSION)133 128 void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler) 134 129 { … … 156 151 download.send(Messages::DownloadProxy::DidReceiveAuthenticationChallenge(authenticationChallenge, challengeID)); 157 152 } 158 #endif159 160 #if !USE(NETWORK_SESSION)161 void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const AuthenticationChallenge& authenticationChallenge)162 {163 ASSERT(pageID);164 ASSERT(frameID);165 166 uint64_t challengeID = addChallengeToChallengeMap({pageID, authenticationChallenge});167 168 // Coalesce challenges in the same protection space and in the same page.169 if (shouldCoalesceChallenge(pageID, challengeID, authenticationChallenge))170 return;171 172 m_process.send(Messages::NetworkProcessProxy::DidReceiveAuthenticationChallenge(pageID, frameID, authenticationChallenge, challengeID));173 }174 #endif175 176 #if !USE(NETWORK_SESSION)177 void AuthenticationManager::didReceiveAuthenticationChallenge(Download& download, const AuthenticationChallenge& authenticationChallenge)178 {179 uint64_t dummyPageID = 0;180 uint64_t challengeID = addChallengeToChallengeMap({dummyPageID, authenticationChallenge});181 182 // Coalesce challenges in the same protection space and in the same page.183 if (shouldCoalesceChallenge(dummyPageID, challengeID, authenticationChallenge))184 return;185 186 download.send(Messages::DownloadProxy::DidReceiveAuthenticationChallenge(authenticationChallenge, challengeID));187 }188 #endif189 153 190 154 // Currently, only Mac knows how to respond to authentication challenges with certificate info. … … 209 173 ASSERT(!challenge.challenge.isNull()); 210 174 211 #if USE(NETWORK_SESSION)212 175 auto completionHandler = WTFMove(challenge.completionHandler); 213 #else214 ChallengeCompletionHandler completionHandler = nullptr;215 #endif216 176 217 177 if (tryUseCertificateInfoForChallenge(challenge.challenge, certificateInfo, completionHandler)) … … 219 179 220 180 AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); 221 #if USE(NETWORK_SESSION)222 181 // If there is a completion handler, then there is no AuthenticationClient. 223 182 // FIXME: Remove the use of AuthenticationClient in WebKit2 once NETWORK_SESSION is used for all loads. … … 228 187 } 229 188 ASSERT(coreClient); 230 #endif231 189 232 190 if (coreClient) 233 191 coreClient->receivedCredential(challenge.challenge, credential); 234 #if !USE(NETWORK_SESSION)235 else236 receivedCredential(challenge.challenge, credential);237 #endif238 192 } 239 193 … … 252 206 253 207 AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); 254 #if USE(NETWORK_SESSION)255 208 if (challenge.completionHandler) { 256 209 ASSERT(!coreClient); … … 259 212 } 260 213 ASSERT(coreClient); 261 #endif262 214 263 215 if (coreClient) 264 216 coreClient->receivedRequestToContinueWithoutCredential(challenge.challenge); 265 #if !USE(NETWORK_SESSION)266 else267 receivedRequestToContinueWithoutCredential(challenge.challenge);268 #endif269 217 } 270 218 … … 283 231 284 232 AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); 285 #if USE(NETWORK_SESSION)286 233 if (challenge.completionHandler) { 287 234 ASSERT(!coreClient); … … 290 237 } 291 238 ASSERT(coreClient); 292 #endif293 239 294 240 if (coreClient) 295 241 coreClient->receivedCancellation(challenge.challenge); 296 #if !USE(NETWORK_SESSION)297 else298 receivedCancellation(challenge.challenge);299 #endif300 242 } 301 243 … … 314 256 315 257 AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); 316 #if USE(NETWORK_SESSION)317 258 if (challenge.completionHandler) { 318 259 ASSERT(!coreClient); … … 321 262 } 322 263 ASSERT(coreClient); 323 #endif324 264 325 265 if (coreClient) 326 266 coreClient->receivedRequestToPerformDefaultHandling(challenge.challenge); 327 #if !USE(NETWORK_SESSION)328 else329 receivedRequestToPerformDefaultHandling(challenge.challenge);330 #endif331 267 } 332 268 … … 345 281 346 282 AuthenticationClient* coreClient = challenge.challenge.authenticationClient(); 347 #if USE(NETWORK_SESSION)348 283 if (challenge.completionHandler) { 349 284 ASSERT(!coreClient); … … 352 287 } 353 288 ASSERT(coreClient); 354 #endif355 289 356 290 if (coreClient) 357 291 coreClient->receivedChallengeRejection(challenge.challenge); 358 #if !USE(NETWORK_SESSION)359 else360 receivedChallengeRejection(challenge.challenge);361 #endif362 292 } 363 293 -
trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h
r223431 r227364 67 67 static const char* supplementName(); 68 68 69 #if USE(NETWORK_SESSION)70 69 void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&); 71 70 void didReceiveAuthenticationChallenge(IPC::MessageSender& download, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&); … … 73 72 void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate); 74 73 #endif 75 #endif76 74 // Called for resources in the WebProcess (NetworkProcess disabled) 77 75 void didReceiveAuthenticationChallenge(WebFrame*, const WebCore::AuthenticationChallenge&); 78 79 #if !USE(NETWORK_SESSION)80 // Called for resources in the NetworkProcess (NetworkProcess enabled)81 void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&);82 void didReceiveAuthenticationChallenge(Download&, const WebCore::AuthenticationChallenge&);83 #endif84 76 85 77 void useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential&, const WebCore::CertificateInfo&); … … 101 93 uint64_t pageID; 102 94 WebCore::AuthenticationChallenge challenge; 103 #if USE(NETWORK_SESSION)104 95 ChallengeCompletionHandler completionHandler; 105 #endif106 96 }; 107 97 -
trunk/Source/WebKit/Shared/SessionTracker.cpp
r223791 r227364 56 56 } 57 57 58 #if USE(NETWORK_SESSION)59 58 static HashMap<PAL::SessionID, RefPtr<NetworkSession>>& staticSessionMap() 60 59 { … … 74 73 staticSessionMap().set(sessionID, WTFMove(session)); 75 74 } 76 #endif77 75 78 76 void SessionTracker::destroySession(PAL::SessionID sessionID) 79 77 { 80 78 ASSERT(RunLoop::isMain()); 81 #if USE(NETWORK_SESSION)82 79 auto session = staticSessionMap().take(sessionID); 83 80 if (session) 84 81 session->invalidateAndCancel(); 85 #endif86 82 NetworkStorageSession::destroySession(sessionID); 87 83 } -
trunk/Source/WebKit/Shared/SessionTracker.h
r220887 r227364 46 46 static void setIdentifierBase(const String&); 47 47 48 #if USE(NETWORK_SESSION)49 48 static void setSession(PAL::SessionID, Ref<NetworkSession>&&); 50 49 static NetworkSession* networkSession(PAL::SessionID); 51 #endif52 50 static void destroySession(PAL::SessionID); 53 51 }; -
trunk/Source/WebKit/UIProcess/API/APIDownloadClient.h
r224373 r227364 54 54 virtual void didReceiveResponse(WebKit::WebProcessPool&, WebKit::DownloadProxy&, const WebCore::ResourceResponse&) { } 55 55 virtual void didReceiveData(WebKit::WebProcessPool&, WebKit::DownloadProxy&, uint64_t) { } 56 #if !USE(NETWORK_SESSION)57 virtual bool shouldDecodeSourceDataOfMIMEType(WebKit::WebProcessPool&, WebKit::DownloadProxy&, const WTF::String&) { return true; }58 #endif59 56 virtual void decideDestinationWithSuggestedFilename(WebKit::WebProcessPool&, WebKit::DownloadProxy&, const WTF::String&, Function<void(WebKit::AllowOverwrite, WTF::String)>&& completionHandler) { completionHandler(WebKit::AllowOverwrite::No, { }); } 60 57 virtual void didCreateDestination(WebKit::WebProcessPool&, WebKit::DownloadProxy&, const WTF::String&) { } -
trunk/Source/WebKit/UIProcess/API/C/WKContext.cpp
r225622 r227364 205 205 } 206 206 207 #if !USE(NETWORK_SESSION)208 bool shouldDecodeSourceDataOfMIMEType(WebProcessPool& processPool, DownloadProxy& downloadProxy, const String& mimeType) final209 {210 if (!m_client.shouldDecodeSourceDataOfMIMEType)211 return true;212 213 return m_client.shouldDecodeSourceDataOfMIMEType(toAPI(&processPool), toAPI(&downloadProxy), toAPI(mimeType.impl()), m_client.base.clientInfo);214 }215 #endif216 217 207 void decideDestinationWithSuggestedFilename(WebProcessPool& processPool, DownloadProxy& downloadProxy, const String& filename, Function<void(AllowOverwrite, WTF::String)>&& completionHandler) final 218 208 { -
trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.h
r224373 r227364 57 57 void willSendRequest(WebProcessPool&, DownloadProxy&, WebCore::ResourceRequest&&, const WebCore::ResourceResponse&, CompletionHandler<void(WebCore::ResourceRequest&&)>&&) final; 58 58 void didReceiveAuthenticationChallenge(WebProcessPool&, DownloadProxy&, AuthenticationChallengeProxy&) final; 59 #if !USE(NETWORK_SESSION)60 bool shouldDecodeSourceDataOfMIMEType(WebProcessPool&, DownloadProxy&, const String&) final;61 #endif62 59 void didCreateDestination(WebProcessPool&, DownloadProxy&, const String&) final; 63 60 void processDidCrash(WebProcessPool&, DownloadProxy&) final; -
trunk/Source/WebKit/UIProcess/Cocoa/DownloadClient.mm
r224373 r227364 125 125 } 126 126 127 #if !USE(NETWORK_SESSION)128 bool DownloadClient::shouldDecodeSourceDataOfMIMEType(WebProcessPool&, DownloadProxy& downloadProxy, const String& mimeType)129 {130 if (m_delegateMethods.downloadShouldDecodeSourceDataOfMIMEType)131 return [m_delegate _download:wrapper(downloadProxy) shouldDecodeSourceDataOfMIMEType:mimeType];132 return true;133 }134 #endif135 136 127 void DownloadClient::didCreateDestination(WebProcessPool&, DownloadProxy& downloadProxy, const String& destination) 137 128 { -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp
r223798 r227364 135 135 m_redirectChain.append(newRequest.url()); 136 136 137 #if USE(NETWORK_SESSION)138 137 if (!protectedThis->m_processPool) 139 138 return; … … 144 143 145 144 networkProcessProxy->send(Messages::NetworkProcess::ContinueWillSendRequest(protectedThis->m_downloadID, newRequest), 0); 146 #endif147 145 }); 148 146 } … … 153 151 return; 154 152 155 #if !USE(NETWORK_SESSION)156 // As per https://html.spec.whatwg.org/#as-a-download (step 2), the filename from the Content-Disposition header157 // should override the suggested filename from the download attribute.158 if (!m_suggestedFilename.isNull() && response.isAttachmentWithFilename())159 m_suggestedFilename = String();160 #endif161 162 153 m_processPool->downloadClient().didReceiveResponse(*m_processPool, *this, response); 163 154 } … … 170 161 m_processPool->downloadClient().didReceiveData(*m_processPool, *this, length); 171 162 } 172 173 #if !USE(NETWORK_SESSION)174 void DownloadProxy::shouldDecodeSourceDataOfMIMEType(const String& mimeType, bool& result)175 {176 result = false;177 178 if (!m_processPool)179 return;180 181 result = m_processPool->downloadClient().shouldDecodeSourceDataOfMIMEType(*m_processPool, *this, mimeType);182 }183 #endif184 163 185 164 void DownloadProxy::decideDestinationWithSuggestedFilenameAsync(DownloadID downloadID, const String& suggestedFilename) … … 198 177 } 199 178 200 #if !USE(NETWORK_SESSION)201 202 void DownloadProxy::decideDestinationWithSuggestedFilename(const String& filename, const String& mimeType, Ref<Messages::DownloadProxy::DecideDestinationWithSuggestedFilename::DelayedReply>&& reply)203 {204 if (!m_processPool)205 return;206 207 String suggestedFilename = MIMETypeRegistry::appendFileExtensionIfNecessary(m_suggestedFilename.isEmpty() ? filename : m_suggestedFilename, mimeType);208 m_processPool->downloadClient().decideDestinationWithSuggestedFilename(*m_processPool, *this, suggestedFilename, [reply = WTFMove(reply)] (AllowOverwrite allowOverwrite, String destination) {209 SandboxExtension::Handle sandboxExtensionHandle;210 if (!destination.isNull())211 SandboxExtension::createHandle(destination, SandboxExtension::Type::ReadWrite, sandboxExtensionHandle);212 reply->send(destination, allowOverwrite == AllowOverwrite::Yes, sandboxExtensionHandle);213 });214 }215 216 #endif217 218 179 void DownloadProxy::didCreateDestination(const String& path) 219 180 { -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.h
r223730 r227364 86 86 // IPC::MessageReceiver 87 87 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 88 void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;89 88 90 89 // Message handlers. … … 99 98 void didCancel(const IPC::DataReference& resumeData); 100 99 void willSendRequest(WebCore::ResourceRequest&& redirectRequest, const WebCore::ResourceResponse& redirectResponse); 101 #if !USE(NETWORK_SESSION)102 void decideDestinationWithSuggestedFilename(const String& filename, const String& mimeType, Ref<Messages::DownloadProxy::DecideDestinationWithSuggestedFilename::DelayedReply>&&);103 #endif104 100 void decideDestinationWithSuggestedFilenameAsync(DownloadID, const String& suggestedFilename); 105 101 -
trunk/Source/WebKit/UIProcess/Downloads/DownloadProxy.messages.in
r223730 r227364 29 29 DidReceiveResponse(WebCore::ResourceResponse response) 30 30 DidReceiveData(uint64_t length) 31 #if !USE(NETWORK_SESSION)32 ShouldDecodeSourceDataOfMIMEType(String mimeType) -> (bool result)33 DecideDestinationWithSuggestedFilename(String filename, String mimeType) -> (String destination, bool allowOverwrite, WebKit::SandboxExtension::Handle sandboxExtensionHandle) Delayed34 #endif35 31 DidCreateDestination(String path) 36 32 DidFinish() -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r227340 r227364 1187 1187 53BA47D11DC2EF5E004DF4AD /* NetworkDataTaskBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 539EB5471DC2EE40009D48CF /* NetworkDataTaskBlob.h */; }; 1188 1188 53DEA3661DDE423100E82648 /* json.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 53DEA3651DDE422E00E82648 /* json.hpp */; }; 1189 5C052F261C6D3BD30076E919 /* AuthenticationManagerCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */; };1190 1189 5C0B17781E7C880E00E9123C /* NetworkSocketStreamMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C0B17741E7C879C00E9123C /* NetworkSocketStreamMessageReceiver.cpp */; }; 1191 1190 5C0B17791E7C882100E9123C /* WebSocketStreamMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C0B17761E7C879C00E9123C /* WebSocketStreamMessageReceiver.cpp */; }; … … 1202 1201 5C1427061C23F84C00D41183 /* DownloadManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5C1426F81C23F84300D41183 /* DownloadManager.cpp */; }; 1203 1202 5C1427071C23F84C00D41183 /* DownloadManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1426F91C23F84300D41183 /* DownloadManager.h */; }; 1204 5C1427111C23F89E00D41183 /* DownloadIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C14270D1C23F88500D41183 /* DownloadIOS.mm */; };1205 5C1427121C23F89E00D41183 /* DownloadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C14270F1C23F89900D41183 /* DownloadMac.mm */; };1206 1203 5C1427131C23F89E00D41183 /* DownloadCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C1427091C23F86900D41183 /* DownloadCocoa.mm */; }; 1207 1204 5C1427181C23F8B700D41183 /* LegacyCustomProtocolManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C1427141C23F8B000D41183 /* LegacyCustomProtocolManager.h */; }; … … 1411 1408 8360349F1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */; }; 1412 1409 836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */; }; 1413 836EEB801BE9EC9E006B4B82 /* NetworkLoadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */; };1414 1410 8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB241A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1415 1411 8372DB281A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8372DB261A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp */; }; … … 1428 1424 83A0ED351F747CCF003299EB /* PreconnectTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 83A0ED321F747CC6003299EB /* PreconnectTask.h */; }; 1429 1425 83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */; }; 1430 83BFAC421D96137C00433490 /* BlobDownloadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83BFAC401D96136000433490 /* BlobDownloadClient.h */; };1431 83BFAC431D96137C00433490 /* BlobDownloadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BFAC411D96136000433490 /* BlobDownloadClient.cpp */; };1432 1426 83D454D71BE9D3C4006C93BD /* NetworkLoadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */; }; 1433 1427 83EE575B1DB7D61100C74C50 /* WebValidationMessageClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83EE57591DB7D60600C74C50 /* WebValidationMessageClient.cpp */; }; … … 2028 2022 CDC38307172117DD008A2FC3 /* CookieStorageShimLibrary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CDC382F9172116D3008A2FC3 /* CookieStorageShimLibrary.cpp */; }; 2029 2023 CDC3830C17212282008A2FC3 /* CookieStorageShimLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = CDC3830B172121CE008A2FC3 /* CookieStorageShimLibrary.h */; }; 2030 CDC3831017212440008A2FC3 /* CookieStorageShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */; };2031 2024 CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */; }; 2032 2025 CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = CDCA85C7132ABA4E00E961DF /* WKFullScreenWindowController.h */; }; … … 3581 3574 539EB5471DC2EE40009D48CF /* NetworkDataTaskBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkDataTaskBlob.h; path = NetworkProcess/NetworkDataTaskBlob.h; sourceTree = "<group>"; }; 3582 3575 53DEA3651DDE422E00E82648 /* json.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = json.hpp; path = NetworkProcess/capture/json.hpp; sourceTree = "<group>"; }; 3583 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AuthenticationManagerCocoa.mm; path = Authentication/cocoa/AuthenticationManagerCocoa.mm; sourceTree = "<group>"; };3584 3576 5C0B17741E7C879C00E9123C /* NetworkSocketStreamMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkSocketStreamMessageReceiver.cpp; sourceTree = "<group>"; }; 3585 3577 5C0B17751E7C879C00E9123C /* NetworkSocketStreamMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkSocketStreamMessages.h; sourceTree = "<group>"; }; … … 3604 3596 5C1426F91C23F84300D41183 /* DownloadManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DownloadManager.h; path = NetworkProcess/Downloads/DownloadManager.h; sourceTree = "<group>"; }; 3605 3597 5C1427091C23F86900D41183 /* DownloadCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DownloadCocoa.mm; path = NetworkProcess/Downloads/cocoa/DownloadCocoa.mm; sourceTree = "<group>"; }; 3606 5C14270D1C23F88500D41183 /* DownloadIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DownloadIOS.mm; path = NetworkProcess/Downloads/ios/DownloadIOS.mm; sourceTree = "<group>"; };3607 5C14270F1C23F89900D41183 /* DownloadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DownloadMac.mm; path = NetworkProcess/Downloads/mac/DownloadMac.mm; sourceTree = "<group>"; };3608 3598 5C1427141C23F8B000D41183 /* LegacyCustomProtocolManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyCustomProtocolManager.h; path = NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.h; sourceTree = "<group>"; }; 3609 3599 5C1427151C23F8B000D41183 /* LegacyCustomProtocolManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LegacyCustomProtocolManager.messages.in; path = NetworkProcess/CustomProtocols/LegacyCustomProtocolManager.messages.in; sourceTree = "<group>"; }; … … 3838 3828 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSQLiteDatabaseTracker.cpp; sourceTree = "<group>"; }; 3839 3829 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSQLiteDatabaseTracker.h; sourceTree = "<group>"; }; 3840 836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkLoadMac.mm; sourceTree = "<group>"; };3841 3830 8372DB241A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageDiagnosticLoggingClient.h; sourceTree = "<group>"; }; 3842 3831 8372DB261A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageDiagnosticLoggingClient.cpp; sourceTree = "<group>"; }; … … 3855 3844 83A0ED331F747CC7003299EB /* PreconnectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PreconnectTask.cpp; path = NetworkProcess/PreconnectTask.cpp; sourceTree = "<group>"; }; 3856 3845 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheStatistics.cpp; sourceTree = "<group>"; }; 3857 83BFAC401D96136000433490 /* BlobDownloadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobDownloadClient.h; path = NetworkProcess/Downloads/BlobDownloadClient.h; sourceTree = "<group>"; };3858 83BFAC411D96136000433490 /* BlobDownloadClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobDownloadClient.cpp; path = NetworkProcess/Downloads/BlobDownloadClient.cpp; sourceTree = "<group>"; };3859 3846 83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoadClient.h; path = NetworkProcess/NetworkLoadClient.h; sourceTree = "<group>"; }; 3860 3847 83EE57591DB7D60600C74C50 /* WebValidationMessageClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebValidationMessageClient.cpp; sourceTree = "<group>"; }; … … 4502 4489 CDC3830617211799008A2FC3 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; 4503 4490 CDC3830B172121CE008A2FC3 /* CookieStorageShimLibrary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CookieStorageShimLibrary.h; sourceTree = "<group>"; }; 4504 CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageShim.mm; sourceTree = "<group>"; };4505 CDC3830E1721242D008A2FC3 /* CookieStorageShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CookieStorageShim.h; sourceTree = "<group>"; };4506 4491 CDC8F4881725E67800166F6E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; }; 4507 4492 CDCA85C6132ABA4E00E961DF /* WKFullScreenWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKFullScreenWindowController.mm; sourceTree = "<group>"; }; … … 6300 6285 children = ( 6301 6286 E17AE2C116B9C139001C42F1 /* com.apple.WebKit.NetworkProcess.sb.in */, 6302 836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */,6303 6287 51A8A6151627F3F9000D90E9 /* NetworkProcessMac.mm */, 6304 6288 E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */, … … 6495 6479 isa = PBXGroup; 6496 6480 children = ( 6497 5C052F231C6D3AA10076E919 /* cocoa */,6498 6481 518E8EF616B2091C00E91429 /* mac */, 6499 6482 518E8EF316B2091C00E91429 /* AuthenticationManager.cpp */, … … 6632 6615 sourceTree = "<group>"; 6633 6616 }; 6634 5C052F231C6D3AA10076E919 /* cocoa */ = {6635 isa = PBXGroup;6636 children = (6637 5C052F241C6D3AB60076E919 /* AuthenticationManagerCocoa.mm */,6638 );6639 name = cocoa;6640 sourceTree = "<group>";6641 };6642 6617 5C1426F11C23F81700D41183 /* Downloads */ = { 6643 6618 isa = PBXGroup; 6644 6619 children = ( 6645 6620 5C1427081C23F85200D41183 /* cocoa */, 6646 5C14270C1C23F87700D41183 /* ios */,6647 5C14270B1C23F87100D41183 /* mac */,6648 83BFAC411D96136000433490 /* BlobDownloadClient.cpp */,6649 83BFAC401D96136000433490 /* BlobDownloadClient.h */,6650 6621 5C1426F31C23F84300D41183 /* Download.cpp */, 6651 6622 5C1426F41C23F84300D41183 /* Download.h */, … … 6676 6647 ); 6677 6648 name = cocoa; 6678 sourceTree = "<group>";6679 };6680 5C14270B1C23F87100D41183 /* mac */ = {6681 isa = PBXGroup;6682 children = (6683 5C14270F1C23F89900D41183 /* DownloadMac.mm */,6684 );6685 name = mac;6686 sourceTree = "<group>";6687 };6688 5C14270C1C23F87700D41183 /* ios */ = {6689 isa = PBXGroup;6690 children = (6691 5C14270D1C23F88500D41183 /* DownloadIOS.mm */,6692 );6693 name = ios;6694 6649 sourceTree = "<group>"; 6695 6650 }; … … 7525 7480 1A2A4AFE158693920090C9E9 /* ColorSpaceData.h */, 7526 7481 1A2A4AFD158693920090C9E9 /* ColorSpaceData.mm */, 7527 CDC3830E1721242D008A2FC3 /* CookieStorageShim.h */,7528 CDC3830D1721242D008A2FC3 /* CookieStorageShim.mm */,7529 7482 CDC382F9172116D3008A2FC3 /* CookieStorageShimLibrary.cpp */, 7530 7483 CDC3830B172121CE008A2FC3 /* CookieStorageShimLibrary.h */, … … 8685 8638 46A2B6091E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.h in Headers */, 8686 8639 E164A2F2191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.h in Headers */, 8687 83BFAC421D96137C00433490 /* BlobDownloadClient.h in Headers */,8688 8640 E170876C16D6CA6900F99226 /* BlobRegistryProxy.h in Headers */, 8689 8641 4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */, … … 10262 10214 518E8EF816B2091C00E91429 /* AuthenticationManager.cpp in Sources */, 10263 10215 518E8EFB16B2091C00E91429 /* AuthenticationManager.mac.mm in Sources */, 10264 5C052F261C6D3BD30076E919 /* AuthenticationManagerCocoa.mm in Sources */,10265 10216 512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */, 10266 10217 9955A6F41C7986DC00EB6A93 /* AutomationBackendDispatchers.cpp in Sources */, … … 10271 10222 46A2B6081E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.cpp in Sources */, 10272 10223 E164A2F1191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.cpp in Sources */, 10273 83BFAC431D96137C00433490 /* BlobDownloadClient.cpp in Sources */,10274 10224 E170876B16D6CA6900F99226 /* BlobRegistryProxy.cpp in Sources */, 10275 10225 BCF18638167D071E00A1A85A /* CacheModel.cpp in Sources */, … … 10292 10242 1A30EAC6115D7DA30053E937 /* ConnectionMac.mm in Sources */, 10293 10243 5106D7C218BDBE73000AB166 /* ContextMenuContextData.cpp in Sources */, 10294 CDC3831017212440008A2FC3 /* CookieStorageShim.mm in Sources */,10295 10244 5104F5A21F19D7D2004CF821 /* CookieStorageUtilsCF.mm in Sources */, 10296 10245 B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */, … … 10302 10251 A1DF631218E0B7C8003A3E2A /* DownloadClient.mm in Sources */, 10303 10252 5C1427131C23F89E00D41183 /* DownloadCocoa.mm in Sources */, 10304 5C1427111C23F89E00D41183 /* DownloadIOS.mm in Sources */,10305 5C1427121C23F89E00D41183 /* DownloadMac.mm in Sources */,10306 10253 5C1427061C23F84C00D41183 /* DownloadManager.cpp in Sources */, 10307 10254 1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */, … … 10434 10381 530258461DCBBD2200DA89C2 /* NetworkDataTaskReplay.cpp in Sources */, 10435 10382 839902021BE9A02B000F3653 /* NetworkLoad.cpp in Sources */, 10436 836EEB801BE9EC9E006B4B82 /* NetworkLoadMac.mm in Sources */,10437 10383 51795568162876CF00FA43B6 /* NetworkProcess.cpp in Sources */, 10438 10384 7EC4F0FB18E4ACBB008056AF /* NetworkProcessCocoa.mm in Sources */, -
trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm
r226325 r227364 68 68 NetworkStorageSession::ensureSession(sessionID, base + '.' + String::number(sessionID.sessionID()), WTFMove(uiProcessCookieStorage)); 69 69 70 #if USE(NETWORK_SESSION)71 70 SessionTracker::setSession(sessionID, NetworkSession::create(WTFMove(parameters.networkSessionParameters))); 72 #endif73 71 } 74 72 -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r227340 r227364 130 130 131 131 #if PLATFORM(COCOA) 132 #include "CookieStorageShim.h"133 132 #include "ObjCObjectGraph.h" 134 133 #include "UserMediaCaptureManager.h" … … 277 276 platformInitializeWebProcess(WTFMove(parameters)); 278 277 279 #if USE(NETWORK_SESSION)280 278 SessionTracker::setSession(PAL::SessionID::defaultSessionID(), NetworkSession::create({ })); 281 #endif282 279 283 280 // Match the QoS of the UIProcess and the scrolling thread but use a slightly lower priority. … … 390 387 ensureNetworkProcessConnection(); 391 388 392 #if PLATFORM(COCOA) && !USE(NETWORK_SESSION)393 CookieStorageShim::singleton().initialize();394 #endif395 389 setTerminationTimeout(parameters.terminationTimeout); 396 390 … … 561 555 { 562 556 NetworkStorageSession::defaultStorageSession().credentialStorage().clearCredentials(); 563 #if USE(NETWORK_SESSION)564 557 if (auto* networkSession = SessionTracker::networkSession(PAL::SessionID::defaultSessionID())) 565 558 networkSession->clearCredentials(); 566 559 else 567 560 ASSERT_NOT_REACHED(); 568 #endif569 561 } 570 562 -
trunk/Source/WebKit/config.h
r224828 r227364 80 80 81 81 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || PLATFORM(IOS) || PLATFORM(APPLETV) || PLATFORM(WATCHOS) || USE(SOUP) 82 #ifndef USE_NETWORK_SESSION83 #define USE_NETWORK_SESSION 184 #endif85 86 82 #ifndef ENABLE_BEACON_API 87 83 #define ENABLE_BEACON_API 1 … … 94 90 #endif 95 91 96 #if USE(NETWORK_SESSION) && ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000))92 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 97 93 #ifndef ENABLE_SERVER_PRECONNECT 98 94 #define ENABLE_SERVER_PRECONNECT 1 … … 113 109 114 110 #ifndef ENABLE_NETWORK_CAPTURE 115 #if USE(NETWORK_SESSION) &&PLATFORM(COCOA)111 #if PLATFORM(COCOA) 116 112 #define ENABLE_NETWORK_CAPTURE 1 117 113 #endif
Note: See TracChangeset
for help on using the changeset viewer.