Diff
Modified: trunk/Source/WebCore/ChangeLog (250005 => 250006)
--- trunk/Source/WebCore/ChangeLog 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/ChangeLog 2019-09-18 00:38:46 UTC (rev 250006)
@@ -1,3 +1,32 @@
+2019-09-17 Chris Dumez <[email protected]>
+
+ Stop calling Page::setSessionID() from WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=201888
+
+ Reviewed by Alex Christensen.
+
+ Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
+ using WebKit2 (We process-swap and create a new Page in a new process when changing data
+ store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
+ PageConfiguration structure.
+
+ * editing/markup.cpp:
+ (WebCore::createPageForSanitizingWebContent):
+ * loader/EmptyClients.cpp:
+ (WebCore::pageConfigurationWithEmptyClients):
+ * loader/EmptyClients.h:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ (WebCore::Page::setSessionID):
+ * page/PageConfiguration.cpp:
+ (WebCore::PageConfiguration::PageConfiguration):
+ * page/PageConfiguration.h:
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::dataChanged):
+ * workers/service/context/ServiceWorkerThreadProxy.cpp:
+ (WebCore::createPageForServiceWorker):
+ (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
+
2019-09-17 Mark Lam <[email protected]>
Use constexpr instead of const in symbol definitions that are obviously constexpr.
Modified: trunk/Source/WebCore/editing/markup.cpp (250005 => 250006)
--- trunk/Source/WebCore/editing/markup.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/editing/markup.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -176,7 +176,7 @@
std::unique_ptr<Page> createPageForSanitizingWebContent()
{
- auto pageConfiguration = pageConfigurationWithEmptyClients();
+ auto pageConfiguration = pageConfigurationWithEmptyClients(PAL::SessionID::defaultSessionID());
auto page = makeUnique<Page>(WTFMove(pageConfiguration));
page->setIsForSanitizingWebContent();
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (250005 => 250006)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -70,6 +70,7 @@
#include "UserContentProvider.h"
#include "VisitedLinkStore.h"
#include <_javascript_Core/HeapInlines.h>
+#include <pal/SessionID.h>
#include <wtf/NeverDestroyed.h>
#if ENABLE(CONTENT_EXTENSIONS)
@@ -547,9 +548,10 @@
NetworkStorageSession* storageSession() const final { return nullptr; }
};
-PageConfiguration pageConfigurationWithEmptyClients()
+PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID)
{
PageConfiguration pageConfiguration {
+ sessionID,
makeUniqueRef<EmptyEditorClient>(),
SocketProvider::create(),
LibWebRTCProvider::create(),
Modified: trunk/Source/WebCore/loader/EmptyClients.h (250005 => 250006)
--- trunk/Source/WebCore/loader/EmptyClients.h 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2019-09-18 00:38:46 UTC (rev 250006)
@@ -204,6 +204,6 @@
};
DiagnosticLoggingClient& emptyDiagnosticLoggingClient();
-WEBCORE_EXPORT PageConfiguration pageConfigurationWithEmptyClients();
+WEBCORE_EXPORT PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID);
}
Modified: trunk/Source/WebCore/page/Page.cpp (250005 => 250006)
--- trunk/Source/WebCore/page/Page.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/page/Page.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -263,7 +263,7 @@
, m_storageNamespaceProvider(*WTFMove(pageConfiguration.storageNamespaceProvider))
, m_userContentProvider(*WTFMove(pageConfiguration.userContentProvider))
, m_visitedLinkStore(*WTFMove(pageConfiguration.visitedLinkStore))
- , m_sessionID(PAL::SessionID::defaultSessionID())
+ , m_sessionID(pageConfiguration.sessionID)
#if ENABLE(VIDEO)
, m_playbackControlsManagerUpdateTimer(*this, &Page::playbackControlsManagerUpdateTimerFired)
#endif
@@ -2466,9 +2466,12 @@
return m_sessionID;
}
+// This is only called by WebKitLegacy.
void Page::setSessionID(PAL::SessionID sessionID)
{
ASSERT(sessionID.isValid());
+ ASSERT(m_sessionID == PAL::SessionID::legacyPrivateSessionID() || m_sessionID == PAL::SessionID::defaultSessionID());
+ ASSERT(sessionID == PAL::SessionID::legacyPrivateSessionID() || sessionID == PAL::SessionID::defaultSessionID());
#if ENABLE(INDEXED_DATABASE)
if (sessionID != m_sessionID)
Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (250005 => 250006)
--- trunk/Source/WebCore/page/PageConfiguration.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -51,8 +51,9 @@
namespace WebCore {
-PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar)
- : editorClient(WTFMove(editorClient))
+PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar)
+ : sessionID(sessionID)
+ , editorClient(WTFMove(editorClient))
, socketProvider(WTFMove(socketProvider))
, libWebRTCProvider(WTFMove(libWebRTCProvider))
, backForwardClient(WTFMove(backForwardClient))
Modified: trunk/Source/WebCore/page/PageConfiguration.h (250005 => 250006)
--- trunk/Source/WebCore/page/PageConfiguration.h 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/page/PageConfiguration.h 2019-09-18 00:38:46 UTC (rev 250006)
@@ -25,6 +25,7 @@
#pragma once
+#include <pal/SessionID.h>
#include <wtf/Noncopyable.h>
#include <wtf/Optional.h>
#include <wtf/RefPtr.h>
@@ -67,10 +68,11 @@
class PageConfiguration {
WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
public:
- WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&);
+ WEBCORE_EXPORT PageConfiguration(PAL::SessionID, UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&);
WEBCORE_EXPORT ~PageConfiguration();
PageConfiguration(PageConfiguration&&);
+ PAL::SessionID sessionID;
AlternativeTextClient* alternativeTextClient { nullptr };
ChromeClient* chromeClient { nullptr };
#if ENABLE(CONTEXT_MENUS)
Modified: trunk/Source/WebCore/page/PerformanceObserver.idl (250005 => 250006)
--- trunk/Source/WebCore/page/PerformanceObserver.idl 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/page/PerformanceObserver.idl 2019-09-18 00:38:46 UTC (rev 250006)
@@ -36,7 +36,7 @@
] interface PerformanceObserver {
[MayThrowException] void observe(PerformanceObserverInit options);
void disconnect();
- static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
+ [CachedAttribute] static readonly attribute FrozenArray<DOMString> supportedEntryTypes;
};
dictionary PerformanceObserverInit {
Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (250005 => 250006)
--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -467,7 +467,7 @@
return EncodedDataStatus::Complete;
if (allDataReceived) {
- auto pageConfiguration = pageConfigurationWithEmptyClients();
+ auto pageConfiguration = pageConfigurationWithEmptyClients(PAL::SessionID::defaultSessionID());
m_chromeClient = makeUnique<SVGImageChromeClient>(this);
pageConfiguration.chromeClient = m_chromeClient.get();
Modified: trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp (250005 => 250006)
--- trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -54,10 +54,9 @@
return url;
}
-static inline UniqueRef<Page> createPageForServiceWorker(PageConfiguration&& configuration, const ServiceWorkerContextData& data, SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy, PAL::SessionID sessionID)
+static inline UniqueRef<Page> createPageForServiceWorker(PageConfiguration&& configuration, const ServiceWorkerContextData& data, SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy)
{
auto page = makeUniqueRef<Page>(WTFMove(configuration));
- page->setSessionID(sessionID);
auto& mainFrame = page->mainFrame();
mainFrame.loader().initForSynthesizedDocument({ });
@@ -97,7 +96,7 @@
}
ServiceWorkerThreadProxy::ServiceWorkerThreadProxy(PageConfiguration&& pageConfiguration, const ServiceWorkerContextData& data, PAL::SessionID sessionID, String&& userAgent, CacheStorageProvider& cacheStorageProvider, SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy)
- : m_page(createPageForServiceWorker(WTFMove(pageConfiguration), data, storageBlockingPolicy, data.sessionID))
+ : m_page(createPageForServiceWorker(WTFMove(pageConfiguration), data, storageBlockingPolicy))
, m_document(*m_page->mainFrame().document())
, m_serviceWorkerThread(ServiceWorkerThread::create(data, sessionID, WTFMove(userAgent), *this, *this, idbConnectionProxy(m_document), m_document->socketProvider()))
, m_cacheStorageProvider(cacheStorageProvider)
Modified: trunk/Source/WebKit/ChangeLog (250005 => 250006)
--- trunk/Source/WebKit/ChangeLog 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKit/ChangeLog 2019-09-18 00:38:46 UTC (rev 250006)
@@ -1,3 +1,24 @@
+2019-09-17 Chris Dumez <[email protected]>
+
+ Stop calling Page::setSessionID() from WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=201888
+
+ Reviewed by Alex Christensen.
+
+ Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
+ using WebKit2 (We process-swap and create a new Page in a new process when changing data
+ store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
+ PageConfiguration structure.
+
+ * Shared/WebsitePoliciesData.cpp:
+ (WebKit::WebsitePoliciesData::applyToDocumentLoader):
+ * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+ (WebKit::WebSWContextManagerConnection::installServiceWorker):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_textAutoSizingAdjustmentTimer):
+ (WebKit::WebPage::setSessionID): Deleted.
+ * WebProcess/WebPage/WebPage.h:
+
2019-09-17 Mark Lam <[email protected]>
Use constexpr instead of const in symbol definitions that are obviously constexpr.
Modified: trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp (250005 => 250006)
--- trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKit/Shared/WebsitePoliciesData.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -270,13 +270,6 @@
return;
documentLoader.applyPoliciesToSettings();
-
- auto* page = frame->page();
- if (!page)
- return;
-
- if (websitePolicies.websiteDataStoreParameters)
- page->setSessionID(websitePolicies.websiteDataStoreParameters->networkSessionParameters.sessionID);
}
}
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (250005 => 250006)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -125,7 +125,7 @@
{
LOG(ServiceWorker, "WebSWContextManagerConnection::installServiceWorker for worker %s", data.serviceWorkerIdentifier.loggingString().utf8().data());
- auto pageConfiguration = pageConfigurationWithEmptyClients();
+ auto pageConfiguration = pageConfigurationWithEmptyClients(WebProcess::singleton().sessionID());
#if ENABLE(INDEXED_DATABASE)
pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroupID);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (250005 => 250006)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -443,6 +443,7 @@
#endif
PageConfiguration pageConfiguration(
+ WebProcess::singleton().sessionID(),
makeUniqueRef<WebEditorClient>(this),
WebSocketProvider::create(),
makeUniqueRef<WebKit::LibWebRTCProvider>(),
@@ -503,8 +504,6 @@
m_page = makeUnique<Page>(WTFMove(pageConfiguration));
- setSessionID(WebProcess::singleton().sessionID());
-
updatePreferences(parameters.store);
m_backgroundColor = parameters.backgroundColor;
@@ -3200,11 +3199,6 @@
pluginView->setLayerHostingMode(m_layerHostingMode);
}
-void WebPage::setSessionID(PAL::SessionID sessionID)
-{
- m_page->setSessionID(sessionID);
-}
-
void WebPage::didReceivePolicyDecision(FrameIdentifier frameID, uint64_t listenerID, PolicyCheckIdentifier identifier, PolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, Optional<WebsitePoliciesData>&& websitePolicies)
{
WebFrame* frame = WebProcess::singleton().webFrame(frameID);
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (250005 => 250006)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2019-09-18 00:38:46 UTC (rev 250006)
@@ -296,8 +296,6 @@
PAL::SessionID sessionID() const { return m_page->sessionID(); }
bool usesEphemeralSession() const { return m_page->usesEphemeralSession(); }
- void setSessionID(PAL::SessionID);
-
void setSize(const WebCore::IntSize&);
const WebCore::IntSize& size() const { return m_viewSize; }
WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (250005 => 250006)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-09-18 00:38:46 UTC (rev 250006)
@@ -1,3 +1,18 @@
+2019-09-17 Chris Dumez <[email protected]>
+
+ Stop calling Page::setSessionID() from WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=201888
+
+ Reviewed by Alex Christensen.
+
+ Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
+ using WebKit2 (We process-swap and create a new Page in a new process when changing data
+ store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
+ PageConfiguration structure.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+
2019-09-09 Alex Christensen <[email protected]>
Disable TLS 1.0 and 1.1 in WebSockets
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (250005 => 250006)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2019-09-18 00:38:46 UTC (rev 250006)
@@ -1432,6 +1432,7 @@
auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration pageConfiguration(
+ [[self preferences] privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID(),
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
LibWebRTCProvider::create(),
@@ -1700,6 +1701,7 @@
auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration pageConfiguration(
+ [[self preferences] privateBrowsingEnabled] ? PAL::SessionID::legacyPrivateSessionID() : PAL::SessionID::defaultSessionID(),
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
LibWebRTCProvider::create(),
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (250005 => 250006)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2019-09-18 00:36:19 UTC (rev 250005)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2019-09-18 00:38:46 UTC (rev 250006)
@@ -3101,6 +3101,7 @@
auto storageProvider = PageStorageSessionProvider::create();
PageConfiguration configuration(
+ PAL::SessionID::defaultSessionID(),
makeUniqueRef<WebEditorClient>(this),
SocketProvider::create(),
makeUniqueRef<LibWebRTCProvider>(),