Changeset 240117 in webkit
- Timestamp:
- Jan 17, 2019, 11:10:53 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 3 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240112 r240117 1 2019-01-17 Alex Christensen <achristensen@webkit.org> 2 3 Stop using NetworkStorageSession::storageSession in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=193529 5 6 Reviewed by Tim Horton. 7 8 Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer, 9 so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object. 10 I've called this client StorageSessionProvider::storageSession. Right now it just looks in NetworkStorageSession::storageSession, 11 but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object. 12 13 * Modules/websockets/WebSocketChannel.cpp: 14 (WebCore::WebSocketChannel::connect): 15 * WebCore.xcodeproj/project.pbxproj: 16 * loader/CookieJar.cpp: 17 (WebCore::CookieJar::create): 18 (WebCore::CookieJar::CookieJar): 19 (WebCore::CookieJar::cookies const): 20 (WebCore::CookieJar::setCookies): 21 (WebCore::CookieJar::cookiesEnabled const): 22 (WebCore::CookieJar::cookieRequestHeaderFieldValue const): 23 (WebCore::CookieJar::getRawCookies const): 24 (WebCore::CookieJar::deleteCookie): 25 * loader/CookieJar.h: 26 * loader/EmptyClients.cpp: 27 (WebCore::pageConfigurationWithEmptyClients): 28 * page/Page.h: 29 * page/SocketProvider.cpp: 30 (WebCore::SocketProvider::createSocketStreamHandle): 31 * page/SocketProvider.h: 32 * platform/network/NetworkingContext.h: 33 * platform/network/SocketStreamHandleImpl.cpp: 34 (WebCore::cookieDataForHandshake): 35 (WebCore::SocketStreamHandleImpl::platformSendHandshake): 36 * platform/network/StorageSessionProvider.h: Added. 37 (WebCore::StorageSessionProvider::~StorageSessionProvider): 38 * platform/network/cf/SocketStreamHandleImpl.h: 39 (WebCore::SocketStreamHandleImpl::create): 40 * platform/network/cf/SocketStreamHandleImplCFNet.cpp: 41 (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl): 42 (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials): 43 * platform/network/curl/SocketStreamHandleImpl.h: 44 (WebCore::SocketStreamHandleImpl::create): 45 * platform/network/soup/SocketStreamHandleImpl.h: 46 * platform/network/soup/SocketStreamHandleImplSoup.cpp: 47 (WebCore::SocketStreamHandleImpl::create): 48 1 49 2019-01-17 Jon Lee <jonlee@apple.com> 2 50 -
trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
r240014 r240117 41 41 #include "InspectorInstrumentation.h" 42 42 #include "Logging.h" 43 #include "NetworkingContext.h" 43 44 #include "Page.h" 44 45 #include "ProgressTracker.h" … … 124 125 PAL::SessionID sessionID = page ? page->sessionID() : PAL::SessionID::defaultSessionID(); 125 126 String partition = m_document->domainForCachePartition(); 126 m_handle = m_socketProvider->createSocketStreamHandle(m_handshake->url(), *this, sessionID, partition );127 m_handle = m_socketProvider->createSocketStreamHandle(m_handshake->url(), *this, sessionID, partition, frame->loader().networkingContext()); 127 128 } 128 129 } -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r240105 r240117 1903 1903 5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; }; 1904 1904 5C7C88D81D0F1F4A009D2F6D /* SocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1905 5C9EF2F321F06190003BDC56 /* StorageSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1905 1906 5CA1DEC61F71F1C700E71BD3 /* HTTPHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1906 1907 5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; }; … … 8911 8912 5C9EF16F1DFF719900A452E3 /* XPathGrammar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathGrammar.cpp; sourceTree = "<group>"; }; 8912 8913 5C9EF1701DFF719900A452E3 /* XPathGrammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPathGrammar.h; sourceTree = "<group>"; }; 8914 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageSessionProvider.h; sourceTree = "<group>"; }; 8913 8915 5CA1DEC21F71E68600E71BD3 /* HTTPHeaderField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderField.cpp; sourceTree = "<group>"; }; 8914 8916 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderField.h; sourceTree = "<group>"; }; … … 19940 19942 510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */, 19941 19943 5C668E641E7C6C3500D32B3B /* SocketStreamHandleImpl.cpp */, 19944 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */, 19942 19945 4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */, 19943 19946 E180811016FCF42E00B80D07 /* SynchronousLoaderClient.cpp */, … … 31545 31548 C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */, 31546 31549 1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */, 31550 5C9EF2F321F06190003BDC56 /* StorageSessionProvider.h in Headers */, 31547 31551 5166D3CD1E8ED48F00AD62E3 /* StorageType.h in Headers */, 31548 31552 4682D2001F79783000C863DB /* StoredCredentialsPolicy.h in Headers */, -
trunk/Source/WebCore/loader/CookieJar.cpp
r240014 r240117 37 37 #include "PlatformStrategies.h" 38 38 #include "SameSiteInfo.h" 39 #include "StorageSessionProvider.h" 39 40 #include <wtf/SystemTracing.h> 40 41 41 42 namespace WebCore { 43 44 Ref<CookieJar> CookieJar::create(Ref<StorageSessionProvider>&& storageSessionProvider) 45 { 46 return adoptRef(*new CookieJar(WTFMove(storageSessionProvider))); 47 } 42 48 43 49 IncludeSecureCookies CookieJar::shouldIncludeSecureCookies(const Document& document, const URL& url) … … 53 59 } 54 60 55 Ref<CookieJar> CookieJar::create() 61 CookieJar::CookieJar(Ref<StorageSessionProvider>&& storageSessionProvider) 62 : m_storageSessionProvider(WTFMove(storageSessionProvider)) 56 63 { 57 return adoptRef(*new CookieJar);58 64 } 59 65 … … 74 80 75 81 std::pair<String, bool> result; 76 if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))82 if (auto* session = m_storageSessionProvider->storageSession()) 77 83 result = session->cookiesForDOM(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, includeSecureCookies); 78 84 else … … 111 117 } 112 118 113 if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))119 if (auto* session = m_storageSessionProvider->storageSession()) 114 120 session->setCookiesFromDOM(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, cookieString); 115 121 else … … 117 123 } 118 124 119 bool CookieJar::cookiesEnabled(const Document& document) const125 bool CookieJar::cookiesEnabled(const Document&) const 120 126 { 121 if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))127 if (auto* session = m_storageSessionProvider->storageSession()) 122 128 return session->cookiesEnabled(); 123 129 … … 126 132 } 127 133 128 std::pair<String, SecureCookiesAccessed> CookieJar::cookieRequestHeaderFieldValue(const PAL::SessionID& sessionID, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const134 std::pair<String, SecureCookiesAccessed> CookieJar::cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const SameSiteInfo& sameSiteInfo, const URL& url, Optional<uint64_t> frameID, Optional<uint64_t> pageID, IncludeSecureCookies includeSecureCookies) const 129 135 { 130 if (auto* session = NetworkStorageSession::storageSession(sessionID)) {136 if (auto* session = m_storageSessionProvider->storageSession()) { 131 137 std::pair<String, bool> result = session->cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies); 132 138 return { result.first, result.second ? SecureCookiesAccessed::Yes : SecureCookiesAccessed::No }; … … 161 167 } 162 168 163 if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))169 if (auto* session = m_storageSessionProvider->storageSession()) 164 170 return session->getRawCookies(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, cookies); 165 171 … … 168 174 } 169 175 170 void CookieJar::deleteCookie(const Document& document, const URL& url, const String& cookieName)176 void CookieJar::deleteCookie(const Document&, const URL& url, const String& cookieName) 171 177 { 172 if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))178 if (auto* session = m_storageSessionProvider->storageSession()) 173 179 session->deleteCookie(url, cookieName); 174 180 else -
trunk/Source/WebCore/loader/CookieJar.h
r240014 r240117 41 41 struct Cookie; 42 42 struct CookieRequestHeaderFieldProxy; 43 class NetworkStorageSession; 44 class StorageSessionProvider; 43 45 struct SameSiteInfo; 44 46 45 47 class WEBCORE_EXPORT CookieJar : public RefCounted<CookieJar> { 46 48 public: 47 static Ref<CookieJar> create( );49 static Ref<CookieJar> create(Ref<StorageSessionProvider>&&); 48 50 49 51 static CookieRequestHeaderFieldProxy cookieRequestHeaderFieldProxy(const Document&, const URL&); … … 64 66 static SameSiteInfo sameSiteInfo(const Document&); 65 67 static IncludeSecureCookies shouldIncludeSecureCookies(const Document&, const URL&); 68 CookieJar(Ref<StorageSessionProvider>&&); 69 70 private: 71 Ref<StorageSessionProvider> m_storageSessionProvider; 66 72 }; 67 73 -
trunk/Source/WebCore/loader/EmptyClients.cpp
r240031 r240117 536 536 } 537 537 538 class EmptyStorageSessionProvider : public StorageSessionProvider { 539 NetworkStorageSession* storageSession() const final { return nullptr; } 540 }; 541 538 542 PageConfiguration pageConfigurationWithEmptyClients() 539 543 { … … 544 548 CacheStorageProvider::create(), 545 549 adoptRef(*new EmptyBackForwardClient), 546 CookieJar::create( )550 CookieJar::create(adoptRef(*new EmptyStorageSessionProvider)) 547 551 }; 548 552 -
trunk/Source/WebCore/page/Page.h
r240014 r240117 48 48 #include <wtf/Ref.h> 49 49 #include <wtf/UniqueRef.h> 50 #include <wtf/WeakPtr.h> 50 51 #include <wtf/text/WTFString.h> 51 52 … … 167 168 enum class ShouldTreatAsContinuingLoad : bool; 168 169 169 class Page : public Supplementable<Page> {170 class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page> { 170 171 WTF_MAKE_NONCOPYABLE(Page); 171 172 WTF_MAKE_FAST_ALLOCATED; -
trunk/Source/WebCore/page/SocketProvider.cpp
r220857 r240117 31 31 namespace WebCore { 32 32 33 Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition )33 Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider* provider) 34 34 { 35 return SocketStreamHandleImpl::create(url, client, sessionID, credentialPartition, { } );35 return SocketStreamHandleImpl::create(url, client, sessionID, credentialPartition, { }, provider); 36 36 } 37 37 -
trunk/Source/WebCore/page/SocketProvider.h
r238771 r240117 32 32 namespace WebCore { 33 33 34 class StorageSessionProvider; 34 35 class ScriptExecutionContext; 35 36 class SocketStreamHandle; … … 39 40 public: 40 41 static Ref<SocketProvider> create() { return adoptRef(*new SocketProvider); } 41 virtual Ref<SocketStreamHandle> createSocketStreamHandle(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition );42 virtual Ref<SocketStreamHandle> createSocketStreamHandle(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, const StorageSessionProvider*); 42 43 virtual ~SocketProvider() { }; 43 44 }; -
trunk/Source/WebCore/platform/network/NetworkingContext.h
r239737 r240117 20 20 #pragma once 21 21 22 #include <wtf/RefCounted.h>22 #include "StorageSessionProvider.h" 23 23 #include <wtf/RetainPtr.h> 24 24 #include <wtf/text/WTFString.h> … … 42 42 class ResourceRequest; 43 43 44 class NetworkingContext : public RefCounted<NetworkingContext>{44 class NetworkingContext : public StorageSessionProvider { 45 45 public: 46 46 virtual ~NetworkingContext() = default; … … 59 59 virtual String sourceApplicationIdentifier() const { return emptyString(); } 60 60 61 virtual NetworkStorageSession* storageSession() const = 0;62 63 61 #if PLATFORM(WIN) 64 62 virtual ResourceError blockedError(const ResourceRequest&) const = 0; -
trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp
r239427 r240117 30 30 #include "NetworkStorageSession.h" 31 31 #include "SocketStreamHandleClient.h" 32 #include "StorageSessionProvider.h" 32 33 #include <wtf/Function.h> 33 34 … … 77 78 } 78 79 79 static Optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy)80 static Optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const NetworkStorageSession* networkStorageSession, const CookieRequestHeaderFieldProxy& headerFieldProxy) 80 81 { 81 auto networkStorageSession = NetworkStorageSession::storageSession(headerFieldProxy.sessionID);82 82 if (!networkStorageSession) 83 83 return WTF::nullopt; … … 104 104 105 105 if (headerFieldProxy) { 106 auto cookieDataFromNetworkSession = cookieDataForHandshake( headerFieldProxy.value());106 auto cookieDataFromNetworkSession = cookieDataForHandshake(m_storageSessionProvider ? m_storageSessionProvider->storageSession() : nullptr, *headerFieldProxy); 107 107 if (!cookieDataFromNetworkSession) { 108 108 completionHandler(false, false); -
trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
r239427 r240117 42 42 43 43 class Credential; 44 class StorageSessionProvider; 44 45 class ProtectionSpace; 45 46 class SocketStreamHandleClient; … … 47 48 class SocketStreamHandleImpl : public SocketStreamHandle { 48 49 public: 49 static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData ) { return adoptRef(*new SocketStreamHandleImpl(url, client, sessionID, credentialPartition, WTFMove(auditData))); }50 static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData, const StorageSessionProvider* provider) { return adoptRef(*new SocketStreamHandleImpl(url, client, sessionID, credentialPartition, WTFMove(auditData), provider)); } 50 51 51 52 virtual ~SocketStreamHandleImpl(); … … 59 60 bool sendPendingData(); 60 61 61 WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, SourceApplicationAuditToken&& );62 WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, SourceApplicationAuditToken&&, const StorageSessionProvider*); 62 63 void createStreams(); 63 64 void scheduleStreams(); … … 104 105 String m_credentialPartition; 105 106 SourceApplicationAuditToken m_auditData; 107 RefPtr<const StorageSessionProvider> m_storageSessionProvider; 106 108 107 109 StreamBuffer<uint8_t, 1024 * 1024> m_buffer; -
trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
r239427 r240117 41 41 #include "SocketStreamError.h" 42 42 #include "SocketStreamHandleClient.h" 43 #include "StorageSessionProvider.h" 43 44 #include <CFNetwork/CFNetwork.h> 44 45 #include <wtf/Condition.h> … … 96 97 } 97 98 98 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData )99 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData, const StorageSessionProvider* provider) 99 100 : SocketStreamHandle(url, client) 100 101 , m_connectingSubstate(New) … … 104 105 , m_credentialPartition(credentialPartition) 105 106 , m_auditData(WTFMove(auditData)) 107 , m_storageSessionProvider(provider) 106 108 { 107 109 LOG(Network, "SocketStreamHandle %p new client %p", this, &m_client); … … 368 370 // Try system credential storage first, matching HTTP behavior (CFNetwork only asks the client for password if it couldn't find it in Keychain). 369 371 Credential storedCredential; 370 if (auto* storageSession = NetworkStorageSession::storageSession(m_sessionID)) {372 if (auto* storageSession = m_storageSessionProvider ? m_storageSessionProvider->storageSession() : nullptr) { 371 373 storedCredential = storageSession->credentialStorage().getFromPersistentStorage(protectionSpace); 372 374 if (storedCredential.isEmpty()) -
trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h
r239427 r240117 45 45 46 46 class SocketStreamHandleClient; 47 class StorageSessionProvider; 47 48 48 49 class SocketStreamHandleImpl : public SocketStreamHandle { 49 50 public: 50 static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&& ) { return adoptRef(*new SocketStreamHandleImpl(url, client)); }51 static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider* provider) { return adoptRef(*new SocketStreamHandleImpl(url, client, provider)); } 51 52 52 53 virtual ~SocketStreamHandleImpl(); … … 57 58 58 59 private: 59 WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient& );60 WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, const StorageSessionProvider*); 60 61 61 62 size_t bufferedAmount() final; … … 70 71 static const size_t kReadBufferSize = 4 * 1024; 71 72 73 RefPtr<const StorageSessionProvider> m_storageSessionProvider; 72 74 RefPtr<Thread> m_workerThread; 73 75 std::atomic<bool> m_running { true }; -
trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp
r239427 r240117 47 47 namespace WebCore { 48 48 49 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client )49 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, const StorageSessionProvider* provider) 50 50 : SocketStreamHandle(url, client) 51 , m_storageSessionProvider(provider) 51 52 { 52 53 LOG(Network, "SocketStreamHandle %p new client %p", this, &m_client); -
trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h
r239427 r240117 1 1 2 /* 2 3 * Copyright (C) 2009-2018 Apple Inc. All rights reserved. … … 49 50 class SocketStreamError; 50 51 class SocketStreamHandleClient; 52 class StorageSessionProvider; 51 53 52 54 class SocketStreamHandleImpl final : public SocketStreamHandle { 53 55 public: 54 static Ref<SocketStreamHandleImpl> create(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String&, SourceApplicationAuditToken&& );56 static Ref<SocketStreamHandleImpl> create(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider*); 55 57 virtual ~SocketStreamHandleImpl(); 56 58 … … 61 63 void platformClose() final; 62 64 private: 63 SocketStreamHandleImpl(const URL&, SocketStreamHandleClient& );65 SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, const StorageSessionProvider*); 64 66 65 67 size_t bufferedAmount() final; … … 79 81 void writeReady(); 80 82 83 RefPtr<const StorageSessionProvider> m_storageSessionProvider; 84 81 85 GRefPtr<GIOStream> m_stream; 82 86 GRefPtr<GInputStream> m_inputStream; -
trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
r239427 r240117 42 42 #include "SocketStreamHandleClient.h" 43 43 #include "SoupNetworkSession.h" 44 #include "StorageSessionProvider.h" 44 45 #include "URLSoup.h" 45 46 #include <gio/gio.h> … … 82 83 #endif 83 84 84 Ref<SocketStreamHandleImpl> SocketStreamHandleImpl::create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String&, SourceApplicationAuditToken&&)85 { 86 Ref<SocketStreamHandleImpl> socket = adoptRef(*new SocketStreamHandleImpl(url, client ));85 Ref<SocketStreamHandleImpl> SocketStreamHandleImpl::create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider* storageSessionProvider) 86 { 87 Ref<SocketStreamHandleImpl> socket = adoptRef(*new SocketStreamHandleImpl(url, client, storageSessionProvider)); 87 88 88 89 #if SOUP_CHECK_VERSION(2, 61, 90) 89 auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID);90 auto* networkStorageSession = storageSessionProvider ? storageSessionProvider->storageSession() : nullptr; 90 91 if (!networkStorageSession) 91 92 return socket; … … 97 98 reinterpret_cast<GAsyncReadyCallback>(connectedCallback), &protectedSocketStreamHandle.leakRef()); 98 99 #else 99 UNUSED_PARAM(sessionID);100 100 unsigned port = url.port() ? url.port().value() : (url.protocolIs("wss") ? 443 : 80); 101 101 GRefPtr<GSocketClient> socketClient = adoptGRef(g_socket_client_new()); … … 112 112 } 113 113 114 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client )114 SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, const StorageSessionProvider* provider) 115 115 : SocketStreamHandle(url, client) 116 , m_storageSessionProvider(provider) 116 117 , m_cancellable(adoptGRef(g_cancellable_new())) 117 118 { -
trunk/Source/WebKit/ChangeLog
r240100 r240117 1 2019-01-17 Alex Christensen <achristensen@webkit.org> 2 3 Stop using NetworkStorageSession::storageSession in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=193529 5 6 Reviewed by Tim Horton. 7 8 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 9 (WebKit::NetworkConnectionToWebProcess::createSocketStream): 10 * NetworkProcess/NetworkProcess.h: 11 * NetworkProcess/NetworkSocketStream.cpp: 12 (WebKit::NetworkSocketStream::create): 13 (WebKit::NetworkSocketStream::NetworkSocketStream): 14 * NetworkProcess/NetworkSocketStream.h: 15 * NetworkProcess/NetworkStorageSessionProvider.h: Added. 16 * WebKit.xcodeproj/project.pbxproj: 17 * WebProcess/Network/WebSocketProvider.cpp: 18 (WebKit::WebSocketProvider::createSocketStreamHandle): 19 * WebProcess/Network/WebSocketProvider.h: 20 * WebProcess/WebPage/WebCookieJar.cpp: 21 (WebKit::WebCookieJar::WebCookieJar): 22 * WebProcess/WebPage/WebCookieJar.h: 23 1 24 2019-01-16 Youenn Fablet <youenn@apple.com> 2 25 -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r240089 r240117 282 282 token = { m_networkProcess->sourceApplicationAuditData() }; 283 283 #endif 284 m_networkSocketStreams.set(identifier, NetworkSocketStream::create( WTFMove(url), sessionID, cachePartition, identifier, m_connection, WTFMove(token)));284 m_networkSocketStreams.set(identifier, NetworkSocketStream::create(m_networkProcess.get(), WTFMove(url), sessionID, cachePartition, identifier, m_connection, WTFMove(token))); 285 285 } 286 286 -
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp
r239427 r240117 28 28 29 29 #include "DataReference.h" 30 #include "NetworkStorageSessionProvider.h" 30 31 #include "WebSocketStreamMessages.h" 31 32 #include <WebCore/CookieRequestHeaderFieldProxy.h> … … 35 36 using namespace WebCore; 36 37 37 Ref<NetworkSocketStream> NetworkSocketStream::create( URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)38 Ref<NetworkSocketStream> NetworkSocketStream::create(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) 38 39 { 39 return adoptRef(*new NetworkSocketStream( WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData)));40 return adoptRef(*new NetworkSocketStream(networkProcess, WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData))); 40 41 } 41 42 42 NetworkSocketStream::NetworkSocketStream( URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)43 NetworkSocketStream::NetworkSocketStream(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData) 43 44 : m_identifier(identifier) 44 45 , m_connection(connection) 45 , m_impl(SocketStreamHandleImpl::create(url, *this, sessionID, credentialPartition, WTFMove(auditData) ))46 , m_impl(SocketStreamHandleImpl::create(url, *this, sessionID, credentialPartition, WTFMove(auditData), NetworkStorageSessionProvider::create(networkProcess, sessionID).ptr())) 46 47 { 47 48 } -
trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h
r239427 r240117 40 40 namespace WebKit { 41 41 42 class NetworkProcess; 43 42 44 class NetworkSocketStream : public RefCounted<NetworkSocketStream>, public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandleClient { 43 45 public: 44 static Ref<NetworkSocketStream> create( URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);46 static Ref<NetworkSocketStream> create(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); 45 47 ~NetworkSocketStream(); 46 48 … … 63 65 uint64_t messageSenderDestinationID() final; 64 66 65 NetworkSocketStream( URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);67 NetworkSocketStream(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&); 66 68 67 69 uint64_t m_identifier; -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r240100 r240117 3446 3446 5C9E56801DF7F05500C9EE33 /* WKWebsitePolicies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebsitePolicies.cpp; sourceTree = "<group>"; }; 3447 3447 5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsitePolicies.h; sourceTree = "<group>"; }; 3448 5C9EF2E721F058F9003BDC56 /* NetworkStorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkStorageSessionProvider.h; sourceTree = "<group>"; }; 3448 3449 5CA26D7F217ABBB600F97A35 /* WKSafeBrowsingWarning.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKSafeBrowsingWarning.mm; sourceTree = "<group>"; }; 3449 3450 5CA26D80217ABBB600F97A35 /* WKSafeBrowsingWarning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSafeBrowsingWarning.h; sourceTree = "<group>"; }; … … 6440 6441 5C0B177E1E7C886700E9123C /* NetworkSocketStream.h */, 6441 6442 5C0B177F1E7C886700E9123C /* NetworkSocketStream.messages.in */, 6443 5C9EF2E721F058F9003BDC56 /* NetworkStorageSessionProvider.h */, 6442 6444 462107D71F38DBD300DD7810 /* PingLoad.cpp */, 6443 6445 5CE85B1F1C88E6430070BFCE /* PingLoad.h */, -
trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.cpp
r235205 r240117 37 37 using namespace WebCore; 38 38 39 Ref<SocketStreamHandle> WebSocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition )39 Ref<SocketStreamHandle> WebSocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider*) 40 40 { 41 41 return WebSocketStream::create(url, client, sessionID, credentialPartition); -
trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.h
r238771 r240117 33 33 public: 34 34 static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); } 35 Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition ) final;35 Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, const WebCore::StorageSessionProvider*) final; 36 36 virtual ~WebSocketProvider() { } 37 37 }; -
trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp
r240014 r240117 35 35 #include <WebCore/FrameLoader.h> 36 36 #include <WebCore/FrameLoaderClient.h> 37 #include <WebCore/StorageSessionProvider.h> 37 38 38 39 namespace WebKit { 40 41 class WebStorageSessionProvider : public WebCore::StorageSessionProvider { 42 // NetworkStorageSessions are accessed only in the NetworkProcess. 43 WebCore::NetworkStorageSession* storageSession() const final { return nullptr; } 44 }; 45 46 WebCookieJar::WebCookieJar() 47 : WebCore::CookieJar(adoptRef(*new WebStorageSessionProvider)) { } 39 48 40 49 String WebCookieJar::cookies(WebCore::Document& document, const URL& url) const -
trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h
r240014 r240117 40 40 bool getRawCookies(const WebCore::Document&, const URL&, Vector<WebCore::Cookie>&) const final; 41 41 void deleteCookie(const WebCore::Document&, const URL&, const String& cookieName) final; 42 private: 43 WebCookieJar(); 42 44 }; 43 45 -
trunk/Source/WebKitLegacy/ChangeLog
r239634 r240117 1 2019-01-17 Alex Christensen <achristensen@webkit.org> 2 3 Stop using NetworkStorageSession::storageSession in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=193529 5 6 Reviewed by Tim Horton. 7 8 * WebCoreSupport/PageStorageSessionProvider.h: Added. 9 * WebKitLegacy.xcodeproj/project.pbxproj: 10 1 11 2019-01-04 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
r238815 r240117 148 148 598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */; }; 149 149 598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; 150 5C9EF2F521F061BE003BDC56 /* PageStorageSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */; }; 150 151 5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE44F49206D70E9003EFD01 /* PingHandle.h */; }; 151 152 5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 987 988 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMockInternal.h; sourceTree = "<group>"; }; 988 989 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProvider.h; sourceTree = "<group>"; }; 990 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PageStorageSessionProvider.h; path = WebCoreSupport/PageStorageSessionProvider.h; sourceTree = SOURCE_ROOT; }; 989 991 5CE44F49206D70E9003EFD01 /* PingHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PingHandle.h; path = WebCoreSupport/PingHandle.h; sourceTree = SOURCE_ROOT; }; 990 992 5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; }; … … 2555 2557 B82958D1132707D0000D0E79 /* CorrectionPanel.h */, 2556 2558 B82958D2132707D0000D0E79 /* CorrectionPanel.mm */, 2559 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */, 2557 2560 5CE44F49206D70E9003EFD01 /* PingHandle.h */, 2558 2561 7C01CB81173435C900C5D807 /* PopupMenuMac.h */, … … 2935 2938 93D4379B1D57ABEF00AB85EA /* ObjCEventListener.h in Headers */, 2936 2939 93D4379D1D57ABEF00AB85EA /* ObjCNodeFilterCondition.h in Headers */, 2940 5C9EF2F521F061BE003BDC56 /* PageStorageSessionProvider.h in Headers */, 2937 2941 5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */, 2938 2942 A10C1D5F1820300E0036883A /* PopupMenuIOS.h in Headers */, -
trunk/Source/WebKitLegacy/mac/ChangeLog
r240031 r240117 1 2019-01-17 Alex Christensen <achristensen@webkit.org> 2 3 Stop using NetworkStorageSession::storageSession in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=193529 5 6 Reviewed by Tim Horton. 7 8 * Misc/WebCache.mm: 9 (+[WebCache addImageToCache:forURL:forFrame:]): 10 * WebView/WebView.mm: 11 (-[WebView _commonInitializationWithFrameName:groupName:]): 12 (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]): 13 1 14 2019-01-15 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm
r240031 r240117 39 39 #import <WebCore/MemoryCache.h> 40 40 #import <WebCore/NetworkStorageSession.h> 41 #import <WebCore/StorageSessionProvider.h> 41 42 #import <wtf/MainThread.h> 42 43 #import <wtf/RunLoop.h> … … 51 52 #endif 52 53 54 class DefaultStorageSessionProvider : public WebCore::StorageSessionProvider { 55 WebCore::NetworkStorageSession* storageSession() const final 56 { 57 return &WebCore::NetworkStorageSession::defaultStorageSession(); 58 } 59 }; 60 53 61 @implementation WebCache 54 62 … … 166 174 return false; 167 175 168 return WebCore::MemoryCache::singleton().addImageToCache(RetainPtr<CGImageRef>(image), url, frame ? core(frame)->document()->domainForCachePartition() : emptyString(), PAL::SessionID::defaultSessionID(), WebCore::CookieJar::create().ptr()); 176 auto provider = adoptRef(*new DefaultStorageSessionProvider); 177 return WebCore::MemoryCache::singleton().addImageToCache(RetainPtr<CGImageRef>(image), url, frame ? core(frame)->document()->domainForCachePartition() : emptyString(), PAL::SessionID::defaultSessionID(), WebCore::CookieJar::create(WTFMove(provider)).ptr()); 169 178 } 170 179 -
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
r240014 r240117 38 38 #import "DOMNodeInternal.h" 39 39 #import "DOMRangeInternal.h" 40 #import "PageStorageSessionProvider.h" 40 41 #import "StorageThread.h" 41 42 #import "WebAlternativeTextClient.h" … … 1441 1442 _private->group->addWebView(self); 1442 1443 1444 auto storageProvider = PageStorageSessionProvider::create(); 1443 1445 PageConfiguration pageConfiguration( 1444 1446 makeUniqueRef<WebEditorClient>(self), … … 1447 1449 WebCore::CacheStorageProvider::create(), 1448 1450 BackForwardList::create(self), 1449 CookieJar::create( )1451 CookieJar::create(storageProvider.copyRef()) 1450 1452 ); 1451 1453 #if !PLATFORM(IOS_FAMILY) … … 1478 1480 pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore(); 1479 1481 _private->page = new Page(WTFMove(pageConfiguration)); 1482 storageProvider->setPage(*_private->page); 1480 1483 1481 1484 _private->page->setGroupName(groupName); … … 1707 1710 _private->group->addWebView(self); 1708 1711 1712 auto storageProvider = PageStorageSessionProvider::create(); 1709 1713 PageConfiguration pageConfiguration( 1710 1714 makeUniqueRef<WebEditorClient>(self), … … 1713 1717 WebCore::CacheStorageProvider::create(), 1714 1718 BackForwardList::create(self), 1715 CookieJar::create( )1719 CookieJar::create(storageProvider.copyRef()) 1716 1720 ); 1717 1721 pageConfiguration.chromeClient = new WebChromeClientIOS(self); … … 1735 1739 1736 1740 _private->page = new Page(WTFMove(pageConfiguration)); 1741 storageProvider->setPage(*_private->page); 1737 1742 1738 1743 [self setSmartInsertDeleteEnabled:YES]; -
trunk/Source/WebKitLegacy/win/ChangeLog
r240031 r240117 1 2019-01-17 Alex Christensen <achristensen@webkit.org> 2 3 Stop using NetworkStorageSession::storageSession in WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=193529 5 6 Reviewed by Tim Horton. 7 8 * WebView.cpp: 9 (WebView::initWithFrame): 10 1 11 2019-01-15 Alex Christensen <achristensen@webkit.org> 2 12 -
trunk/Source/WebKitLegacy/win/WebView.cpp
r240028 r240117 33 33 #include "FullscreenVideoController.h" 34 34 #include "MarshallingHelpers.h" 35 #include "PageStorageSessionProvider.h" 35 36 #include "PluginDatabase.h" 36 37 #include "PluginView.h" … … 3107 3108 m_inspectorClient = new WebInspectorClient(this); 3108 3109 3110 auto storageProvider = PageStorageSessionProvider::create(); 3109 3111 PageConfiguration configuration( 3110 3112 makeUniqueRef<WebEditorClient>(this), … … 3113 3115 WebCore::CacheStorageProvider::create(), 3114 3116 BackForwardList::create(), 3115 CookieJar::create( )3117 CookieJar::create(storageProvider.copyRef()) 3116 3118 ); 3117 3119 configuration.chromeClient = new WebChromeClient(this); … … 3129 3131 3130 3132 m_page = new Page(WTFMove(configuration)); 3133 storageProvider->setPage(*m_page); 3131 3134 provideGeolocationTo(m_page, *new WebGeolocationClient(this)); 3132 3135
Note:
See TracChangeset
for help on using the changeset viewer.