Diff
Modified: trunk/Source/WebCore/ChangeLog (240116 => 240117)
--- trunk/Source/WebCore/ChangeLog 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/ChangeLog 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,51 @@
+2019-01-17 Alex Christensen <[email protected]>
+
+ Stop using NetworkStorageSession::storageSession in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=193529
+
+ Reviewed by Tim Horton.
+
+ Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
+ 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.
+ I've called this client StorageSessionProvider::storageSession. Right now it just looks in NetworkStorageSession::storageSession,
+ but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
+
+ * Modules/websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::connect):
+ * WebCore.xcodeproj/project.pbxproj:
+ * loader/CookieJar.cpp:
+ (WebCore::CookieJar::create):
+ (WebCore::CookieJar::CookieJar):
+ (WebCore::CookieJar::cookies const):
+ (WebCore::CookieJar::setCookies):
+ (WebCore::CookieJar::cookiesEnabled const):
+ (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
+ (WebCore::CookieJar::getRawCookies const):
+ (WebCore::CookieJar::deleteCookie):
+ * loader/CookieJar.h:
+ * loader/EmptyClients.cpp:
+ (WebCore::pageConfigurationWithEmptyClients):
+ * page/Page.h:
+ * page/SocketProvider.cpp:
+ (WebCore::SocketProvider::createSocketStreamHandle):
+ * page/SocketProvider.h:
+ * platform/network/NetworkingContext.h:
+ * platform/network/SocketStreamHandleImpl.cpp:
+ (WebCore::cookieDataForHandshake):
+ (WebCore::SocketStreamHandleImpl::platformSendHandshake):
+ * platform/network/StorageSessionProvider.h: Added.
+ (WebCore::StorageSessionProvider::~StorageSessionProvider):
+ * platform/network/cf/SocketStreamHandleImpl.h:
+ (WebCore::SocketStreamHandleImpl::create):
+ * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+ (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
+ (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
+ * platform/network/curl/SocketStreamHandleImpl.h:
+ (WebCore::SocketStreamHandleImpl::create):
+ * platform/network/soup/SocketStreamHandleImpl.h:
+ * platform/network/soup/SocketStreamHandleImplSoup.cpp:
+ (WebCore::SocketStreamHandleImpl::create):
+
2019-01-17 Jon Lee <[email protected]>
[EME] Remove Amazon Prime Video from quirks list
Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (240116 => 240117)
--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -40,6 +40,7 @@
#include "Frame.h"
#include "InspectorInstrumentation.h"
#include "Logging.h"
+#include "NetworkingContext.h"
#include "Page.h"
#include "ProgressTracker.h"
#include "ResourceRequest.h"
@@ -123,7 +124,7 @@
Page* page = frame->page();
PAL::SessionID sessionID = page ? page->sessionID() : PAL::SessionID::defaultSessionID();
String partition = m_document->domainForCachePartition();
- m_handle = m_socketProvider->createSocketStreamHandle(m_handshake->url(), *this, sessionID, partition);
+ m_handle = m_socketProvider->createSocketStreamHandle(m_handshake->url(), *this, sessionID, partition, frame->loader().networkingContext());
}
}
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (240116 => 240117)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1902,6 +1902,7 @@
5C4304B1191AC908000E2BC0 /* EXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304AE191AC908000E2BC0 /* EXTShaderTextureLOD.h */; };
5C4304B6191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C4304B4191AEF46000E2BC0 /* JSEXTShaderTextureLOD.h */; };
5C7C88D81D0F1F4A009D2F6D /* SocketProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D71D0F1F2B009D2F6D /* SocketProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5C9EF2F321F06190003BDC56 /* StorageSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
5CA1DEC61F71F1C700E71BD3 /* HTTPHeaderField.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */; settings = {ATTRIBUTES = (Private, ); }; };
5CB37FFF1C62D2A100F20188 /* ScrollAnimatorMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CB37FFD1C62D27800F20188 /* ScrollAnimatorMock.h */; };
5CBC8DAD1AAA302200E1C803 /* MediaAccessibilitySoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CBC8DAB1AAA302200E1C803 /* MediaAccessibilitySoftLink.h */; };
@@ -8910,6 +8911,7 @@
5C9B860B1C21E3C600110F36 /* NetworkLoadMetrics.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkLoadMetrics.mm; sourceTree = "<group>"; };
5C9EF16F1DFF719900A452E3 /* XPathGrammar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathGrammar.cpp; sourceTree = "<group>"; };
5C9EF1701DFF719900A452E3 /* XPathGrammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPathGrammar.h; sourceTree = "<group>"; };
+ 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageSessionProvider.h; sourceTree = "<group>"; };
5CA1DEC21F71E68600E71BD3 /* HTTPHeaderField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderField.cpp; sourceTree = "<group>"; };
5CA1DEC41F71E68700E71BD3 /* HTTPHeaderField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPHeaderField.h; sourceTree = "<group>"; };
5CB37FFC1C62D27800F20188 /* ScrollAnimatorMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimatorMock.cpp; sourceTree = "<group>"; };
@@ -19939,6 +19941,7 @@
510D4A31103165EE0049EA54 /* SocketStreamHandle.h */,
510D4A32103165EE0049EA54 /* SocketStreamHandleClient.h */,
5C668E641E7C6C3500D32B3B /* SocketStreamHandleImpl.cpp */,
+ 5C9EF2F221F06171003BDC56 /* StorageSessionProvider.h */,
4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */,
E180811016FCF42E00B80D07 /* SynchronousLoaderClient.cpp */,
E180811516FCF9CB00B80D07 /* SynchronousLoaderClient.h */,
@@ -31544,6 +31547,7 @@
51E0BB380DA5ACB600A9E417 /* StorageMap.h in Headers */,
C50D0E830FF4272900AC2644 /* StorageNamespace.h in Headers */,
1A37636C1A2E68BB009A7EE2 /* StorageNamespaceProvider.h in Headers */,
+ 5C9EF2F321F06190003BDC56 /* StorageSessionProvider.h in Headers */,
5166D3CD1E8ED48F00AD62E3 /* StorageType.h in Headers */,
4682D2001F79783000C863DB /* StoredCredentialsPolicy.h in Headers */,
416E6FE81BBD12DF000A6033 /* StreamInternalsBuiltins.h in Headers */,
Modified: trunk/Source/WebCore/loader/CookieJar.cpp (240116 => 240117)
--- trunk/Source/WebCore/loader/CookieJar.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/loader/CookieJar.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -36,10 +36,16 @@
#include "NetworkingContext.h"
#include "PlatformStrategies.h"
#include "SameSiteInfo.h"
+#include "StorageSessionProvider.h"
#include <wtf/SystemTracing.h>
namespace WebCore {
+Ref<CookieJar> CookieJar::create(Ref<StorageSessionProvider>&& storageSessionProvider)
+{
+ return adoptRef(*new CookieJar(WTFMove(storageSessionProvider)));
+}
+
IncludeSecureCookies CookieJar::shouldIncludeSecureCookies(const Document& document, const URL& url)
{
return (url.protocolIs("https") && !document.foundMixedContent().contains(SecurityContext::MixedContentType::Active)) ? IncludeSecureCookies::Yes : IncludeSecureCookies::No;
@@ -52,9 +58,9 @@
return { };
}
-Ref<CookieJar> CookieJar::create()
+CookieJar::CookieJar(Ref<StorageSessionProvider>&& storageSessionProvider)
+ : m_storageSessionProvider(WTFMove(storageSessionProvider))
{
- return adoptRef(*new CookieJar);
}
CookieJar::~CookieJar() = default;
@@ -73,7 +79,7 @@
}
std::pair<String, bool> result;
- if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))
+ if (auto* session = m_storageSessionProvider->storageSession())
result = session->cookiesForDOM(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, includeSecureCookies);
else
ASSERT_NOT_REACHED();
@@ -110,15 +116,15 @@
pageID = frame->loader().client().pageID();
}
- if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))
+ if (auto* session = m_storageSessionProvider->storageSession())
session->setCookiesFromDOM(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, cookieString);
else
ASSERT_NOT_REACHED();
}
-bool CookieJar::cookiesEnabled(const Document& document) const
+bool CookieJar::cookiesEnabled(const Document&) const
{
- if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))
+ if (auto* session = m_storageSessionProvider->storageSession())
return session->cookiesEnabled();
ASSERT_NOT_REACHED();
@@ -125,9 +131,9 @@
return false;
}
-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) const
+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
{
- if (auto* session = NetworkStorageSession::storageSession(sessionID)) {
+ if (auto* session = m_storageSessionProvider->storageSession()) {
std::pair<String, bool> result = session->cookieRequestHeaderFieldValue(firstParty, sameSiteInfo, url, frameID, pageID, includeSecureCookies);
return { result.first, result.second ? SecureCookiesAccessed::Yes : SecureCookiesAccessed::No };
}
@@ -160,7 +166,7 @@
pageID = frame->loader().client().pageID();
}
- if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))
+ if (auto* session = m_storageSessionProvider->storageSession())
return session->getRawCookies(document.firstPartyForCookies(), sameSiteInfo(document), url, frameID, pageID, cookies);
ASSERT_NOT_REACHED();
@@ -167,9 +173,9 @@
return false;
}
-void CookieJar::deleteCookie(const Document& document, const URL& url, const String& cookieName)
+void CookieJar::deleteCookie(const Document&, const URL& url, const String& cookieName)
{
- if (auto* session = NetworkStorageSession::storageSession(document.sessionID()))
+ if (auto* session = m_storageSessionProvider->storageSession())
session->deleteCookie(url, cookieName);
else
ASSERT_NOT_REACHED();
Modified: trunk/Source/WebCore/loader/CookieJar.h (240116 => 240117)
--- trunk/Source/WebCore/loader/CookieJar.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/loader/CookieJar.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -40,11 +40,13 @@
class Document;
struct Cookie;
struct CookieRequestHeaderFieldProxy;
+class NetworkStorageSession;
+class StorageSessionProvider;
struct SameSiteInfo;
class WEBCORE_EXPORT CookieJar : public RefCounted<CookieJar> {
public:
- static Ref<CookieJar> create();
+ static Ref<CookieJar> create(Ref<StorageSessionProvider>&&);
static CookieRequestHeaderFieldProxy cookieRequestHeaderFieldProxy(const Document&, const URL&);
@@ -63,6 +65,10 @@
protected:
static SameSiteInfo sameSiteInfo(const Document&);
static IncludeSecureCookies shouldIncludeSecureCookies(const Document&, const URL&);
+ CookieJar(Ref<StorageSessionProvider>&&);
+
+private:
+ Ref<StorageSessionProvider> m_storageSessionProvider;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (240116 => 240117)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -535,6 +535,10 @@
return adoptRef(*new EmptyStorageNamespace);
}
+class EmptyStorageSessionProvider : public StorageSessionProvider {
+ NetworkStorageSession* storageSession() const final { return nullptr; }
+};
+
PageConfiguration pageConfigurationWithEmptyClients()
{
PageConfiguration pageConfiguration {
@@ -543,7 +547,7 @@
LibWebRTCProvider::create(),
CacheStorageProvider::create(),
adoptRef(*new EmptyBackForwardClient),
- CookieJar::create()
+ CookieJar::create(adoptRef(*new EmptyStorageSessionProvider))
};
static NeverDestroyed<EmptyChromeClient> dummyChromeClient;
Modified: trunk/Source/WebCore/page/Page.h (240116 => 240117)
--- trunk/Source/WebCore/page/Page.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/page/Page.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -47,6 +47,7 @@
#include <wtf/Noncopyable.h>
#include <wtf/Ref.h>
#include <wtf/UniqueRef.h>
+#include <wtf/WeakPtr.h>
#include <wtf/text/WTFString.h>
#if PLATFORM(COCOA)
@@ -166,7 +167,7 @@
enum class RouteSharingPolicy : uint8_t;
enum class ShouldTreatAsContinuingLoad : bool;
-class Page : public Supplementable<Page> {
+class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page> {
WTF_MAKE_NONCOPYABLE(Page);
WTF_MAKE_FAST_ALLOCATED;
friend class SettingsBase;
Modified: trunk/Source/WebCore/page/SocketProvider.cpp (240116 => 240117)
--- trunk/Source/WebCore/page/SocketProvider.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/page/SocketProvider.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -30,9 +30,9 @@
namespace WebCore {
-Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition)
+Ref<SocketStreamHandle> SocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider* provider)
{
- return SocketStreamHandleImpl::create(url, client, sessionID, credentialPartition, { });
+ return SocketStreamHandleImpl::create(url, client, sessionID, credentialPartition, { }, provider);
}
}
Modified: trunk/Source/WebCore/page/SocketProvider.h (240116 => 240117)
--- trunk/Source/WebCore/page/SocketProvider.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/page/SocketProvider.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -31,6 +31,7 @@
namespace WebCore {
+class StorageSessionProvider;
class ScriptExecutionContext;
class SocketStreamHandle;
class SocketStreamHandleClient;
@@ -38,7 +39,7 @@
class WEBCORE_EXPORT SocketProvider : public ThreadSafeRefCounted<SocketProvider> {
public:
static Ref<SocketProvider> create() { return adoptRef(*new SocketProvider); }
- virtual Ref<SocketStreamHandle> createSocketStreamHandle(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition);
+ virtual Ref<SocketStreamHandle> createSocketStreamHandle(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, const StorageSessionProvider*);
virtual ~SocketProvider() { };
};
Modified: trunk/Source/WebCore/platform/network/NetworkingContext.h (240116 => 240117)
--- trunk/Source/WebCore/platform/network/NetworkingContext.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/NetworkingContext.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -19,7 +19,7 @@
#pragma once
-#include <wtf/RefCounted.h>
+#include "StorageSessionProvider.h"
#include <wtf/RetainPtr.h>
#include <wtf/text/WTFString.h>
@@ -41,7 +41,7 @@
class ResourceError;
class ResourceRequest;
-class NetworkingContext : public RefCounted<NetworkingContext> {
+class NetworkingContext : public StorageSessionProvider {
public:
virtual ~NetworkingContext() = default;
@@ -58,8 +58,6 @@
virtual String sourceApplicationIdentifier() const { return emptyString(); }
- virtual NetworkStorageSession* storageSession() const = 0;
-
#if PLATFORM(WIN)
virtual ResourceError blockedError(const ResourceRequest&) const = 0;
#endif
Modified: trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp (240116 => 240117)
--- trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -29,6 +29,7 @@
#include "CookieRequestHeaderFieldProxy.h"
#include "NetworkStorageSession.h"
#include "SocketStreamHandleClient.h"
+#include "StorageSessionProvider.h"
#include <wtf/Function.h>
namespace WebCore {
@@ -76,9 +77,8 @@
return dataLength - 2;
}
-static Optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const CookieRequestHeaderFieldProxy& headerFieldProxy)
+static Optional<std::pair<Vector<uint8_t>, bool>> cookieDataForHandshake(const NetworkStorageSession* networkStorageSession, const CookieRequestHeaderFieldProxy& headerFieldProxy)
{
- auto networkStorageSession = NetworkStorageSession::storageSession(headerFieldProxy.sessionID);
if (!networkStorageSession)
return WTF::nullopt;
@@ -103,7 +103,7 @@
bool secureCookiesAccessed = false;
if (headerFieldProxy) {
- auto cookieDataFromNetworkSession = cookieDataForHandshake(headerFieldProxy.value());
+ auto cookieDataFromNetworkSession = cookieDataForHandshake(m_storageSessionProvider ? m_storageSessionProvider->storageSession() : nullptr, *headerFieldProxy);
if (!cookieDataFromNetworkSession) {
completionHandler(false, false);
return;
Added: trunk/Source/WebCore/platform/network/StorageSessionProvider.h (0 => 240117)
--- trunk/Source/WebCore/platform/network/StorageSessionProvider.h (rev 0)
+++ trunk/Source/WebCore/platform/network/StorageSessionProvider.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2019 Apple, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/ThreadSafeRefCounted.h>
+
+namespace PAL {
+class SessionID;
+}
+
+namespace WebCore {
+
+class NetworkStorageSession;
+
+class StorageSessionProvider : public ThreadSafeRefCounted<StorageSessionProvider> {
+public:
+ virtual NetworkStorageSession* storageSession() const = 0;
+
+ virtual ~StorageSessionProvider() { }
+};
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h (240116 => 240117)
--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -41,12 +41,13 @@
namespace WebCore {
class Credential;
+class StorageSessionProvider;
class ProtectionSpace;
class SocketStreamHandleClient;
class SocketStreamHandleImpl : public SocketStreamHandle {
public:
- 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))); }
+ 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)); }
virtual ~SocketStreamHandleImpl();
@@ -58,7 +59,7 @@
Optional<size_t> platformSendInternal(const uint8_t*, size_t);
bool sendPendingData();
- WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, SourceApplicationAuditToken&&);
+ WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, SourceApplicationAuditToken&&, const StorageSessionProvider*);
void createStreams();
void scheduleStreams();
void chooseProxy();
@@ -103,6 +104,7 @@
PAL::SessionID m_sessionID;
String m_credentialPartition;
SourceApplicationAuditToken m_auditData;
+ RefPtr<const StorageSessionProvider> m_storageSessionProvider;
StreamBuffer<uint8_t, 1024 * 1024> m_buffer;
static const unsigned maxBufferSize = 100 * 1024 * 1024;
Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp (240116 => 240117)
--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -40,6 +40,7 @@
#include "ProtectionSpace.h"
#include "SocketStreamError.h"
#include "SocketStreamHandleClient.h"
+#include "StorageSessionProvider.h"
#include <CFNetwork/CFNetwork.h>
#include <wtf/Condition.h>
#include <wtf/Lock.h>
@@ -95,7 +96,7 @@
#endif
}
-SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData)
+SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, SourceApplicationAuditToken&& auditData, const StorageSessionProvider* provider)
: SocketStreamHandle(url, client)
, m_connectingSubstate(New)
, m_connectionType(Unknown)
@@ -103,6 +104,7 @@
, m_sessionID(sessionID)
, m_credentialPartition(credentialPartition)
, m_auditData(WTFMove(auditData))
+ , m_storageSessionProvider(provider)
{
LOG(Network, "SocketStreamHandle %p new client %p", this, &m_client);
@@ -367,7 +369,7 @@
// Try system credential storage first, matching HTTP behavior (CFNetwork only asks the client for password if it couldn't find it in Keychain).
Credential storedCredential;
- if (auto* storageSession = NetworkStorageSession::storageSession(m_sessionID)) {
+ if (auto* storageSession = m_storageSessionProvider ? m_storageSessionProvider->storageSession() : nullptr) {
storedCredential = storageSession->credentialStorage().getFromPersistentStorage(protectionSpace);
if (storedCredential.isEmpty())
storedCredential = storageSession->credentialStorage().get(m_credentialPartition, protectionSpace);
Modified: trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h (240116 => 240117)
--- trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -44,10 +44,11 @@
namespace WebCore {
class SocketStreamHandleClient;
+class StorageSessionProvider;
class SocketStreamHandleImpl : public SocketStreamHandle {
public:
- static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&&) { return adoptRef(*new SocketStreamHandleImpl(url, client)); }
+ static Ref<SocketStreamHandleImpl> create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider* provider) { return adoptRef(*new SocketStreamHandleImpl(url, client, provider)); }
virtual ~SocketStreamHandleImpl();
@@ -56,7 +57,7 @@
WEBCORE_EXPORT void platformClose() final;
private:
- WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&);
+ WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, const StorageSessionProvider*);
size_t bufferedAmount() final;
Optional<size_t> platformSendInternal(const uint8_t*, size_t);
@@ -69,6 +70,7 @@
static const size_t kWriteBufferSize = 4 * 1024;
static const size_t kReadBufferSize = 4 * 1024;
+ RefPtr<const StorageSessionProvider> m_storageSessionProvider;
RefPtr<Thread> m_workerThread;
std::atomic<bool> m_running { true };
Modified: trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp (240116 => 240117)
--- trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -46,8 +46,9 @@
namespace WebCore {
-SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client)
+SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, const StorageSessionProvider* provider)
: SocketStreamHandle(url, client)
+ , m_storageSessionProvider(provider)
{
LOG(Network, "SocketStreamHandle %p new client %p", this, &m_client);
ASSERT(isMainThread());
Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h (240116 => 240117)
--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,4 @@
+
/*
* Copyright (C) 2009-2018 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
@@ -48,10 +49,11 @@
class SocketStreamError;
class SocketStreamHandleClient;
+class StorageSessionProvider;
class SocketStreamHandleImpl final : public SocketStreamHandle {
public:
- static Ref<SocketStreamHandleImpl> create(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String&, SourceApplicationAuditToken&&);
+ static Ref<SocketStreamHandleImpl> create(const URL&, SocketStreamHandleClient&, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider*);
virtual ~SocketStreamHandleImpl();
const URL& url() const { return m_url; }
@@ -60,7 +62,7 @@
void platformSendHandshake(const uint8_t* data, size_t length, const Optional<CookieRequestHeaderFieldProxy>&, Function<void(bool, bool)>&&) final;
void platformClose() final;
private:
- SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&);
+ SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, const StorageSessionProvider*);
size_t bufferedAmount() final;
Optional<size_t> platformSendInternal(const uint8_t*, size_t);
@@ -78,6 +80,8 @@
void didFail(SocketStreamError&&);
void writeReady();
+ RefPtr<const StorageSessionProvider> m_storageSessionProvider;
+
GRefPtr<GIOStream> m_stream;
GRefPtr<GInputStream> m_inputStream;
GRefPtr<GPollableOutputStream> m_outputStream;
Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp (240116 => 240117)
--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -41,6 +41,7 @@
#include "SocketStreamError.h"
#include "SocketStreamHandleClient.h"
#include "SoupNetworkSession.h"
+#include "StorageSessionProvider.h"
#include "URLSoup.h"
#include <gio/gio.h>
#include <glib.h>
@@ -81,12 +82,12 @@
}
#endif
-Ref<SocketStreamHandleImpl> SocketStreamHandleImpl::create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String&, SourceApplicationAuditToken&&)
+Ref<SocketStreamHandleImpl> SocketStreamHandleImpl::create(const URL& url, SocketStreamHandleClient& client, PAL::SessionID, const String&, SourceApplicationAuditToken&&, const StorageSessionProvider* storageSessionProvider)
{
- Ref<SocketStreamHandleImpl> socket = adoptRef(*new SocketStreamHandleImpl(url, client));
+ Ref<SocketStreamHandleImpl> socket = adoptRef(*new SocketStreamHandleImpl(url, client, storageSessionProvider));
#if SOUP_CHECK_VERSION(2, 61, 90)
- auto* networkStorageSession = NetworkStorageSession::storageSession(sessionID);
+ auto* networkStorageSession = storageSessionProvider ? storageSessionProvider->storageSession() : nullptr;
if (!networkStorageSession)
return socket;
@@ -96,7 +97,6 @@
url.protocolIs("wss") ? reinterpret_cast<SoupSessionConnectProgressCallback>(connectProgressCallback) : nullptr,
reinterpret_cast<GAsyncReadyCallback>(connectedCallback), &protectedSocketStreamHandle.leakRef());
#else
- UNUSED_PARAM(sessionID);
unsigned port = url.port() ? url.port().value() : (url.protocolIs("wss") ? 443 : 80);
GRefPtr<GSocketClient> socketClient = adoptGRef(g_socket_client_new());
if (url.protocolIs("wss")) {
@@ -111,8 +111,9 @@
return socket;
}
-SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client)
+SocketStreamHandleImpl::SocketStreamHandleImpl(const URL& url, SocketStreamHandleClient& client, const StorageSessionProvider* provider)
: SocketStreamHandle(url, client)
+ , m_storageSessionProvider(provider)
, m_cancellable(adoptGRef(g_cancellable_new()))
{
LOG(Network, "SocketStreamHandle %p new client %p", this, &m_client);
Modified: trunk/Source/WebKit/ChangeLog (240116 => 240117)
--- trunk/Source/WebKit/ChangeLog 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/ChangeLog 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,26 @@
+2019-01-17 Alex Christensen <[email protected]>
+
+ Stop using NetworkStorageSession::storageSession in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=193529
+
+ Reviewed by Tim Horton.
+
+ * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+ (WebKit::NetworkConnectionToWebProcess::createSocketStream):
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkSocketStream.cpp:
+ (WebKit::NetworkSocketStream::create):
+ (WebKit::NetworkSocketStream::NetworkSocketStream):
+ * NetworkProcess/NetworkSocketStream.h:
+ * NetworkProcess/NetworkStorageSessionProvider.h: Added.
+ * WebKit.xcodeproj/project.pbxproj:
+ * WebProcess/Network/WebSocketProvider.cpp:
+ (WebKit::WebSocketProvider::createSocketStreamHandle):
+ * WebProcess/Network/WebSocketProvider.h:
+ * WebProcess/WebPage/WebCookieJar.cpp:
+ (WebKit::WebCookieJar::WebCookieJar):
+ * WebProcess/WebPage/WebCookieJar.h:
+
2019-01-16 Youenn Fablet <[email protected]>
Add a new SPI for controlling getUserMedia
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (240116 => 240117)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -281,7 +281,7 @@
#if PLATFORM(COCOA)
token = { m_networkProcess->sourceApplicationAuditData() };
#endif
- m_networkSocketStreams.set(identifier, NetworkSocketStream::create(WTFMove(url), sessionID, cachePartition, identifier, m_connection, WTFMove(token)));
+ m_networkSocketStreams.set(identifier, NetworkSocketStream::create(m_networkProcess.get(), WTFMove(url), sessionID, cachePartition, identifier, m_connection, WTFMove(token)));
}
void NetworkConnectionToWebProcess::destroySocketStream(uint64_t identifier)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp (240116 => 240117)
--- trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -27,6 +27,7 @@
#include "NetworkSocketStream.h"
#include "DataReference.h"
+#include "NetworkStorageSessionProvider.h"
#include "WebSocketStreamMessages.h"
#include <WebCore/CookieRequestHeaderFieldProxy.h>
#include <WebCore/SocketStreamError.h>
@@ -34,15 +35,15 @@
namespace WebKit {
using namespace WebCore;
-Ref<NetworkSocketStream> NetworkSocketStream::create(URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)
+Ref<NetworkSocketStream> NetworkSocketStream::create(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)
{
- return adoptRef(*new NetworkSocketStream(WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData)));
+ return adoptRef(*new NetworkSocketStream(networkProcess, WTFMove(url), sessionID, credentialPartition, identifier, connection, WTFMove(auditData)));
}
-NetworkSocketStream::NetworkSocketStream(URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)
+NetworkSocketStream::NetworkSocketStream(NetworkProcess& networkProcess, URL&& url, PAL::SessionID sessionID, const String& credentialPartition, uint64_t identifier, IPC::Connection& connection, SourceApplicationAuditToken&& auditData)
: m_identifier(identifier)
, m_connection(connection)
- , m_impl(SocketStreamHandleImpl::create(url, *this, sessionID, credentialPartition, WTFMove(auditData)))
+ , m_impl(SocketStreamHandleImpl::create(url, *this, sessionID, credentialPartition, WTFMove(auditData), NetworkStorageSessionProvider::create(networkProcess, sessionID).ptr()))
{
}
Modified: trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h (240116 => 240117)
--- trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSocketStream.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -39,9 +39,11 @@
namespace WebKit {
+class NetworkProcess;
+
class NetworkSocketStream : public RefCounted<NetworkSocketStream>, public IPC::MessageSender, public IPC::MessageReceiver, public WebCore::SocketStreamHandleClient {
public:
- static Ref<NetworkSocketStream> create(URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);
+ static Ref<NetworkSocketStream> create(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);
~NetworkSocketStream();
void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
@@ -62,7 +64,7 @@
IPC::Connection* messageSenderConnection() final;
uint64_t messageSenderDestinationID() final;
- NetworkSocketStream(URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);
+ NetworkSocketStream(NetworkProcess&, URL&&, PAL::SessionID, const String& credentialPartition, uint64_t, IPC::Connection&, WebCore::SourceApplicationAuditToken&&);
uint64_t m_identifier;
IPC::Connection& m_connection;
Added: trunk/Source/WebKit/NetworkProcess/NetworkStorageSessionProvider.h (0 => 240117)
--- trunk/Source/WebKit/NetworkProcess/NetworkStorageSessionProvider.h (rev 0)
+++ trunk/Source/WebKit/NetworkProcess/NetworkStorageSessionProvider.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "NetworkProcess.h"
+#include <WebCore/NetworkStorageSession.h>
+#include <WebCore/StorageSessionProvider.h>
+#include <pal/SessionID.h>
+#include <wtf/WeakPtr.h>
+
+namespace WebKit {
+
+class NetworkStorageSessionProvider final : public WebCore::StorageSessionProvider {
+public:
+ static Ref<NetworkStorageSessionProvider> create(NetworkProcess& networkProcess, const PAL::SessionID& sessionID) { return adoptRef(*new NetworkStorageSessionProvider(networkProcess, sessionID)); }
+
+private:
+ NetworkStorageSessionProvider(NetworkProcess& networkProcess, const PAL::SessionID& sessionID)
+ : m_networkProcess(makeWeakPtr(networkProcess))
+ , m_sessionID(sessionID) { }
+
+ WebCore::NetworkStorageSession* storageSession() const final
+ {
+ if (m_networkProcess)
+ return WebCore::NetworkStorageSession::storageSession(m_sessionID);
+ return nullptr;
+ }
+
+ WeakPtr<NetworkProcess> m_networkProcess;
+ PAL::SessionID m_sessionID;
+};
+
+}
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (240116 => 240117)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-01-17 19:10:53 UTC (rev 240117)
@@ -3445,6 +3445,7 @@
5C8DD3811FE455CA00F2A556 /* WebsiteAutoplayQuirk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteAutoplayQuirk.h; sourceTree = "<group>"; };
5C9E56801DF7F05500C9EE33 /* WKWebsitePolicies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKWebsitePolicies.cpp; sourceTree = "<group>"; };
5C9E56811DF7F05500C9EE33 /* WKWebsitePolicies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebsitePolicies.h; sourceTree = "<group>"; };
+ 5C9EF2E721F058F9003BDC56 /* NetworkStorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkStorageSessionProvider.h; sourceTree = "<group>"; };
5CA26D7F217ABBB600F97A35 /* WKSafeBrowsingWarning.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKSafeBrowsingWarning.mm; sourceTree = "<group>"; };
5CA26D80217ABBB600F97A35 /* WKSafeBrowsingWarning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSafeBrowsingWarning.h; sourceTree = "<group>"; };
5CA98549210BEB5A0057EB6B /* SafeBrowsingWarning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SafeBrowsingWarning.h; sourceTree = "<group>"; };
@@ -6439,6 +6440,7 @@
5C0B177D1E7C886700E9123C /* NetworkSocketStream.cpp */,
5C0B177E1E7C886700E9123C /* NetworkSocketStream.h */,
5C0B177F1E7C886700E9123C /* NetworkSocketStream.messages.in */,
+ 5C9EF2E721F058F9003BDC56 /* NetworkStorageSessionProvider.h */,
462107D71F38DBD300DD7810 /* PingLoad.cpp */,
5CE85B1F1C88E6430070BFCE /* PingLoad.h */,
83A0ED331F747CC7003299EB /* PreconnectTask.cpp */,
Modified: trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.cpp (240116 => 240117)
--- trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -36,7 +36,7 @@
namespace WebKit {
using namespace WebCore;
-Ref<SocketStreamHandle> WebSocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition)
+Ref<SocketStreamHandle> WebSocketProvider::createSocketStreamHandle(const URL& url, SocketStreamHandleClient& client, PAL::SessionID sessionID, const String& credentialPartition, const StorageSessionProvider*)
{
return WebSocketStream::create(url, client, sessionID, credentialPartition);
}
Modified: trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.h (240116 => 240117)
--- trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/WebProcess/Network/WebSocketProvider.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -32,7 +32,7 @@
class WebSocketProvider final : public WebCore::SocketProvider {
public:
static Ref<WebSocketProvider> create() { return adoptRef(*new WebSocketProvider); }
- Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition) final;
+ Ref<WebCore::SocketStreamHandle> createSocketStreamHandle(const URL&, WebCore::SocketStreamHandleClient&, PAL::SessionID, const String& credentialPartition, const WebCore::StorageSessionProvider*) final;
virtual ~WebSocketProvider() { }
};
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp (240116 => 240117)
--- trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -34,9 +34,18 @@
#include <WebCore/Frame.h>
#include <WebCore/FrameLoader.h>
#include <WebCore/FrameLoaderClient.h>
+#include <WebCore/StorageSessionProvider.h>
namespace WebKit {
+class WebStorageSessionProvider : public WebCore::StorageSessionProvider {
+ // NetworkStorageSessions are accessed only in the NetworkProcess.
+ WebCore::NetworkStorageSession* storageSession() const final { return nullptr; }
+};
+
+WebCookieJar::WebCookieJar()
+ : WebCore::CookieJar(adoptRef(*new WebStorageSessionProvider)) { }
+
String WebCookieJar::cookies(WebCore::Document& document, const URL& url) const
{
Optional<uint64_t> frameID;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h (240116 => 240117)
--- trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebCookieJar.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -39,6 +39,8 @@
std::pair<String, WebCore::SecureCookiesAccessed> cookieRequestHeaderFieldValue(const PAL::SessionID&, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<uint64_t> pageID, WebCore::IncludeSecureCookies) const final;
bool getRawCookies(const WebCore::Document&, const URL&, Vector<WebCore::Cookie>&) const final;
void deleteCookie(const WebCore::Document&, const URL&, const String& cookieName) final;
+private:
+ WebCookieJar();
};
} // namespace WebKit
Modified: trunk/Source/WebKitLegacy/ChangeLog (240116 => 240117)
--- trunk/Source/WebKitLegacy/ChangeLog 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/ChangeLog 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,13 @@
+2019-01-17 Alex Christensen <[email protected]>
+
+ Stop using NetworkStorageSession::storageSession in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=193529
+
+ Reviewed by Tim Horton.
+
+ * WebCoreSupport/PageStorageSessionProvider.h: Added.
+ * WebKitLegacy.xcodeproj/project.pbxproj:
+
2019-01-04 Youenn Fablet <[email protected]>
CSP violation reports should bypass CSP checks
Added: trunk/Source/WebKitLegacy/WebCoreSupport/PageStorageSessionProvider.h (0 => 240117)
--- trunk/Source/WebKitLegacy/WebCoreSupport/PageStorageSessionProvider.h (rev 0)
+++ trunk/Source/WebKitLegacy/WebCoreSupport/PageStorageSessionProvider.h 2019-01-17 19:10:53 UTC (rev 240117)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebCore/NetworkStorageSession.h>
+#include <WebCore/Page.h>
+#include <WebCore/StorageSessionProvider.h>
+#include <wtf/WeakPtr.h>
+
+class PageStorageSessionProvider final : public WebCore::StorageSessionProvider {
+public:
+ static Ref<PageStorageSessionProvider> create() { return adoptRef(*new PageStorageSessionProvider); }
+
+ WebCore::NetworkStorageSession* storageSession() const
+ {
+ if (m_page)
+ return WebCore::NetworkStorageSession::storageSession(m_page->sessionID());
+ return nullptr;
+ }
+
+ void setPage(WebCore::Page& page)
+ {
+ m_page = makeWeakPtr(page);
+ }
+
+private:
+ WeakPtr<WebCore::Page> m_page;
+};
Modified: trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj (240116 => 240117)
--- trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj 2019-01-17 19:10:53 UTC (rev 240117)
@@ -147,6 +147,7 @@
598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */ = {isa = PBXBuildFile; fileRef = 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */; };
598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */; };
598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 5C9EF2F521F061BE003BDC56 /* PageStorageSessionProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */; };
5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE44F49206D70E9003EFD01 /* PingHandle.h */; };
5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 5D7BF8120C2A1D90008CE06D /* WebInspector.h */; settings = {ATTRIBUTES = (Private, ); }; };
5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5D7BF8130C2A1D90008CE06D /* WebInspector.mm */; };
@@ -986,6 +987,7 @@
598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDeviceOrientationProviderMock.mm; sourceTree = "<group>"; };
598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProviderMockInternal.h; sourceTree = "<group>"; };
598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationProvider.h; sourceTree = "<group>"; };
+ 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PageStorageSessionProvider.h; path = WebCoreSupport/PageStorageSessionProvider.h; sourceTree = SOURCE_ROOT; };
5CE44F49206D70E9003EFD01 /* PingHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PingHandle.h; path = WebCoreSupport/PingHandle.h; sourceTree = SOURCE_ROOT; };
5D7BF8120C2A1D90008CE06D /* WebInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebInspector.h; sourceTree = "<group>"; };
5D7BF8130C2A1D90008CE06D /* WebInspector.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspector.mm; sourceTree = "<group>"; };
@@ -2554,6 +2556,7 @@
A10C1D4418202FFB0036883A /* ios */,
B82958D1132707D0000D0E79 /* CorrectionPanel.h */,
B82958D2132707D0000D0E79 /* CorrectionPanel.mm */,
+ 5C9EF2F421F061BE003BDC56 /* PageStorageSessionProvider.h */,
5CE44F49206D70E9003EFD01 /* PingHandle.h */,
7C01CB81173435C900C5D807 /* PopupMenuMac.h */,
7C01CB82173435C900C5D807 /* PopupMenuMac.mm */,
@@ -2934,6 +2937,7 @@
E1531BD82187B954002E3F81 /* NSURLDownloadSPI.h in Headers */,
93D4379B1D57ABEF00AB85EA /* ObjCEventListener.h in Headers */,
93D4379D1D57ABEF00AB85EA /* ObjCNodeFilterCondition.h in Headers */,
+ 5C9EF2F521F061BE003BDC56 /* PageStorageSessionProvider.h in Headers */,
5CE44F4A206D70EA003EFD01 /* PingHandle.h in Headers */,
A10C1D5F1820300E0036883A /* PopupMenuIOS.h in Headers */,
7C01CB85173435C900C5D807 /* PopupMenuMac.h in Headers */,
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (240116 => 240117)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,16 @@
+2019-01-17 Alex Christensen <[email protected]>
+
+ Stop using NetworkStorageSession::storageSession in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=193529
+
+ Reviewed by Tim Horton.
+
+ * Misc/WebCache.mm:
+ (+[WebCache addImageToCache:forURL:forFrame:]):
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
2019-01-15 Alex Christensen <[email protected]>
Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
Modified: trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm (240116 => 240117)
--- trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/mac/Misc/WebCache.mm 2019-01-17 19:10:53 UTC (rev 240117)
@@ -38,6 +38,7 @@
#import <WebCore/Document.h>
#import <WebCore/MemoryCache.h>
#import <WebCore/NetworkStorageSession.h>
+#import <WebCore/StorageSessionProvider.h>
#import <wtf/MainThread.h>
#import <wtf/RunLoop.h>
@@ -50,6 +51,13 @@
#import <WebCore/WebCoreThreadRun.h>
#endif
+class DefaultStorageSessionProvider : public WebCore::StorageSessionProvider {
+ WebCore::NetworkStorageSession* storageSession() const final
+ {
+ return &WebCore::NetworkStorageSession::defaultStorageSession();
+ }
+};
+
@implementation WebCache
+ (void)initialize
@@ -165,7 +173,8 @@
if (!image || !url || ![[url absoluteString] length])
return false;
- return WebCore::MemoryCache::singleton().addImageToCache(RetainPtr<CGImageRef>(image), url, frame ? core(frame)->document()->domainForCachePartition() : emptyString(), PAL::SessionID::defaultSessionID(), WebCore::CookieJar::create().ptr());
+ auto provider = adoptRef(*new DefaultStorageSessionProvider);
+ return WebCore::MemoryCache::singleton().addImageToCache(RetainPtr<CGImageRef>(image), url, frame ? core(frame)->document()->domainForCachePartition() : emptyString(), PAL::SessionID::defaultSessionID(), WebCore::CookieJar::create(WTFMove(provider)).ptr());
}
+ (void)removeImageFromCacheForURL:(NSURL *)url
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (240116 => 240117)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-01-17 19:10:53 UTC (rev 240117)
@@ -37,6 +37,7 @@
#import "DOMInternal.h"
#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
+#import "PageStorageSessionProvider.h"
#import "StorageThread.h"
#import "WebAlternativeTextClient.h"
#import "WebApplicationCacheInternal.h"
@@ -1440,6 +1441,7 @@
_private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
_private->group->addWebView(self);
+ auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration pageConfiguration(
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
@@ -1446,7 +1448,7 @@
LibWebRTCProvider::create(),
WebCore::CacheStorageProvider::create(),
BackForwardList::create(self),
- CookieJar::create()
+ CookieJar::create(storageProvider.copyRef())
);
#if !PLATFORM(IOS_FAMILY)
pageConfiguration.chromeClient = new WebChromeClient(self);
@@ -1477,6 +1479,7 @@
pageConfiguration.userContentProvider = &_private->group->userContentController();
pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
_private->page = new Page(WTFMove(pageConfiguration));
+ storageProvider->setPage(*_private->page);
_private->page->setGroupName(groupName);
@@ -1706,6 +1709,7 @@
_private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
_private->group->addWebView(self);
+ auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration pageConfiguration(
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
@@ -1712,7 +1716,7 @@
LibWebRTCProvider::create(),
WebCore::CacheStorageProvider::create(),
BackForwardList::create(self),
- CookieJar::create()
+ CookieJar::create(storageProvider.copyRef())
);
pageConfiguration.chromeClient = new WebChromeClientIOS(self);
#if ENABLE(DRAG_SUPPORT)
@@ -1734,6 +1738,7 @@
pageConfiguration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
_private->page = new Page(WTFMove(pageConfiguration));
+ storageProvider->setPage(*_private->page);
[self setSmartInsertDeleteEnabled:YES];
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (240116 => 240117)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2019-01-17 19:10:53 UTC (rev 240117)
@@ -1,3 +1,13 @@
+2019-01-17 Alex Christensen <[email protected]>
+
+ Stop using NetworkStorageSession::storageSession in WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=193529
+
+ Reviewed by Tim Horton.
+
+ * WebView.cpp:
+ (WebView::initWithFrame):
+
2019-01-15 Alex Christensen <[email protected]>
Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (240116 => 240117)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2019-01-17 19:03:08 UTC (rev 240116)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2019-01-17 19:10:53 UTC (rev 240117)
@@ -32,6 +32,7 @@
#include "DOMCoreClasses.h"
#include "FullscreenVideoController.h"
#include "MarshallingHelpers.h"
+#include "PageStorageSessionProvider.h"
#include "PluginDatabase.h"
#include "PluginView.h"
#include "WebApplicationCache.h"
@@ -3106,6 +3107,7 @@
m_inspectorClient = new WebInspectorClient(this);
+ auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration configuration(
makeUniqueRef<WebEditorClient>(this),
SocketProvider::create(),
@@ -3112,7 +3114,7 @@
makeUniqueRef<LibWebRTCProvider>(),
WebCore::CacheStorageProvider::create(),
BackForwardList::create(),
- CookieJar::create()
+ CookieJar::create(storageProvider.copyRef())
);
configuration.chromeClient = new WebChromeClient(this);
configuration.contextMenuClient = new WebContextMenuClient(this);
@@ -3128,6 +3130,7 @@
configuration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
m_page = new Page(WTFMove(configuration));
+ storageProvider->setPage(*m_page);
provideGeolocationTo(m_page, *new WebGeolocationClient(this));
m_page->addLayoutMilestones({ DidFirstLayout, DidFirstVisuallyNonEmptyLayout });