Diff
Modified: trunk/Source/WebCore/ChangeLog (237156 => 237157)
--- trunk/Source/WebCore/ChangeLog 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/ChangeLog 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1,3 +1,32 @@
+2018-10-15 Alex Christensen <[email protected]>
+
+ Modernize BackForwardClient.h
+ https://bugs.webkit.org/show_bug.cgi?id=190610
+
+ Reviewed by Chris Dumez.
+
+ * editing/markup.cpp:
+ (WebCore::createPageForSanitizingWebContent):
+ * history/BackForwardClient.h:
+ * history/BackForwardController.h:
+ (WebCore::BackForwardController::client):
+ (WebCore::BackForwardController::client const):
+ * inspector/InspectorOverlay.cpp:
+ (WebCore::InspectorOverlay::overlayPage):
+ * loader/EmptyClients.cpp:
+ (WebCore::pageConfigurationWithEmptyClients):
+ (WebCore::createEmptyFrameNetworkingContext): Deleted.
+ (WebCore::fillWithEmptyClients): Deleted.
+ (WebCore::createEmptyEditorClient): Deleted.
+ * loader/EmptyClients.h:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+ * page/PageConfiguration.cpp:
+ (WebCore::PageConfiguration::PageConfiguration):
+ * page/PageConfiguration.h:
+ * svg/graphics/SVGImage.cpp:
+ (WebCore::SVGImage::dataChanged):
+
2018-10-15 Timothy Hatcher <[email protected]>
Add support for prefers-color-scheme media query
Modified: trunk/Source/WebCore/editing/markup.cpp (237156 => 237157)
--- trunk/Source/WebCore/editing/markup.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/editing/markup.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -174,9 +174,7 @@
std::unique_ptr<Page> createPageForSanitizingWebContent()
{
- PageConfiguration pageConfiguration(createEmptyEditorClient(), SocketProvider::create(), LibWebRTCProvider::create(), CacheStorageProvider::create());
-
- fillWithEmptyClients(pageConfiguration);
+ auto pageConfiguration = pageConfigurationWithEmptyClients();
auto page = std::make_unique<Page>(WTFMove(pageConfiguration));
page->settings().setMediaEnabled(false);
Modified: trunk/Source/WebCore/history/BackForwardClient.h (237156 => 237157)
--- trunk/Source/WebCore/history/BackForwardClient.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/history/BackForwardClient.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -45,8 +45,8 @@
virtual void goToItem(HistoryItem*) = 0;
virtual HistoryItem* itemAtIndex(int) = 0;
- virtual int backListCount() = 0;
- virtual int forwardListCount() = 0;
+ virtual int backListCount() const = 0;
+ virtual int forwardListCount() const = 0;
virtual void close() = 0;
};
Modified: trunk/Source/WebCore/history/BackForwardController.h (237156 => 237157)
--- trunk/Source/WebCore/history/BackForwardController.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/history/BackForwardController.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -41,7 +41,8 @@
BackForwardController(Page&, Ref<BackForwardClient>&&);
~BackForwardController();
- BackForwardClient* client() const { return m_client.get(); }
+ BackForwardClient& client() { return m_client.get(); }
+ const BackForwardClient& client() const { return m_client.get(); }
WEBCORE_EXPORT bool canGoBackOrForward(int distance) const;
void goBackOrForward(int distance);
@@ -66,7 +67,7 @@
private:
Page& m_page;
- RefPtr<BackForwardClient> m_client;
+ Ref<BackForwardClient> m_client;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (237156 => 237157)
--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -704,13 +704,7 @@
if (m_overlayPage)
return m_overlayPage.get();
- PageConfiguration pageConfiguration(
- createEmptyEditorClient(),
- SocketProvider::create(),
- LibWebRTCProvider::create(),
- CacheStorageProvider::create()
- );
- fillWithEmptyClients(pageConfiguration);
+ auto pageConfiguration = pageConfigurationWithEmptyClients();
m_overlayPage = std::make_unique<Page>(WTFMove(pageConfiguration));
m_overlayPage->setDeviceScaleFactor(m_page.deviceScaleFactor());
Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (237156 => 237157)
--- trunk/Source/WebCore/loader/EmptyClients.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -30,6 +30,7 @@
#include "ApplicationCacheStorage.h"
#include "BackForwardClient.h"
+#include "CacheStorageProvider.h"
#include "ColorChooser.h"
#include "ContextMenuClient.h"
#include "DataListSuggestionPicker.h"
@@ -48,6 +49,7 @@
#include "HTMLFormElement.h"
#include "InProcessIDBServer.h"
#include "InspectorClient.h"
+#include "LibWebRTCProvider.h"
#include "NetworkStorageSession.h"
#include "Page.h"
#include "PageConfiguration.h"
@@ -55,6 +57,7 @@
#include "PluginInfoProvider.h"
#include "ProgressTrackerClient.h"
#include "SecurityOriginData.h"
+#include "SocketProvider.h"
#include "StorageArea.h"
#include "StorageNamespace.h"
#include "StorageNamespaceProvider.h"
@@ -82,8 +85,8 @@
void addItem(Ref<HistoryItem>&&) final { }
void goToItem(HistoryItem*) final { }
HistoryItem* itemAtIndex(int) final { return nullptr; }
- int backListCount() final { return 0; }
- int forwardListCount() final { return 0; }
+ int backListCount() const final { return 0; }
+ int forwardListCount() const final { return 0; }
void close() final { }
};
@@ -497,11 +500,6 @@
return EmptyFrameNetworkingContext::create();
}
-Ref<FrameNetworkingContext> createEmptyFrameNetworkingContext()
-{
- return EmptyFrameNetworkingContext::create();
-}
-
void EmptyEditorClient::EmptyTextCheckerClient::requestCheckingOfString(TextCheckingRequest&, const VisibleSelection&)
{
}
@@ -534,8 +532,16 @@
return adoptRef(*new EmptyStorageNamespace);
}
-void fillWithEmptyClients(PageConfiguration& pageConfiguration)
+PageConfiguration pageConfigurationWithEmptyClients()
{
+ PageConfiguration pageConfiguration {
+ makeUniqueRef<EmptyEditorClient>(),
+ SocketProvider::create(),
+ LibWebRTCProvider::create(),
+ CacheStorageProvider::create(),
+ adoptRef(*new EmptyBackForwardClient)
+ };
+
static NeverDestroyed<EmptyChromeClient> dummyChromeClient;
pageConfiguration.chromeClient = &dummyChromeClient.get();
@@ -563,7 +569,6 @@
static NeverDestroyed<EmptyProgressTrackerClient> dummyProgressTrackerClient;
pageConfiguration.progressTrackerClient = &dummyProgressTrackerClient.get();
- pageConfiguration.backForwardClient = adoptRef(*new EmptyBackForwardClient);
pageConfiguration.diagnosticLoggingClient = std::make_unique<EmptyDiagnosticLoggingClient>();
pageConfiguration.applicationCacheStorage = ApplicationCacheStorage::create({ }, { });
@@ -572,13 +577,10 @@
pageConfiguration.storageNamespaceProvider = adoptRef(*new EmptyStorageNamespaceProvider);
pageConfiguration.userContentProvider = adoptRef(*new EmptyUserContentProvider);
pageConfiguration.visitedLinkStore = adoptRef(*new EmptyVisitedLinkStore);
+
+ return pageConfiguration;
}
-UniqueRef<EditorClient> createEmptyEditorClient()
-{
- return makeUniqueRef<EmptyEditorClient>();
-}
-
DiagnosticLoggingClient& emptyDiagnosticLoggingClient()
{
static NeverDestroyed<EmptyDiagnosticLoggingClient> client;
Modified: trunk/Source/WebCore/loader/EmptyClients.h (237156 => 237157)
--- trunk/Source/WebCore/loader/EmptyClients.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/loader/EmptyClients.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -203,11 +203,7 @@
RefPtr<Icon> createIconForFiles(const Vector<String>& /* filenames */) final { return nullptr; }
};
-WEBCORE_EXPORT void fillWithEmptyClients(PageConfiguration&);
-WEBCORE_EXPORT UniqueRef<EditorClient> createEmptyEditorClient();
DiagnosticLoggingClient& emptyDiagnosticLoggingClient();
+WEBCORE_EXPORT PageConfiguration pageConfigurationWithEmptyClients();
-class EmptyFrameNetworkingContext;
-WEBCORE_EXPORT Ref<FrameNetworkingContext> createEmptyFrameNetworkingContext();
-
}
Modified: trunk/Source/WebCore/page/Page.cpp (237156 => 237157)
--- trunk/Source/WebCore/page/Page.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/page/Page.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -215,7 +215,7 @@
#endif
, m_settings(Settings::create(this))
, m_progress(std::make_unique<ProgressTracker>(*pageConfiguration.progressTrackerClient))
- , m_backForwardController(std::make_unique<BackForwardController>(*this, *WTFMove(pageConfiguration.backForwardClient)))
+ , m_backForwardController(std::make_unique<BackForwardController>(*this, WTFMove(pageConfiguration.backForwardClient)))
, m_mainFrame(Frame::create(this, nullptr, pageConfiguration.loaderClientForMainFrame))
, m_editorClient(WTFMove(pageConfiguration.editorClient))
, m_plugInClient(pageConfiguration.plugInClient)
Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (237156 => 237157)
--- trunk/Source/WebCore/page/PageConfiguration.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -48,14 +48,16 @@
namespace WebCore {
-PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider)
+PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient)
: editorClient(WTFMove(editorClient))
, socketProvider(WTFMove(socketProvider))
, libWebRTCProvider(WTFMove(libWebRTCProvider))
+ , backForwardClient(WTFMove(backForwardClient))
, cacheStorageProvider(WTFMove(cacheStorageProvider))
{
}
PageConfiguration::~PageConfiguration() = default;
+PageConfiguration::PageConfiguration(PageConfiguration&&) = default;
}
Modified: trunk/Source/WebCore/page/PageConfiguration.h (237156 => 237157)
--- trunk/Source/WebCore/page/PageConfiguration.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/page/PageConfiguration.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -65,8 +65,9 @@
class PageConfiguration {
WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
public:
- WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&);
+ WEBCORE_EXPORT PageConfiguration(UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&);
WEBCORE_EXPORT ~PageConfiguration();
+ PageConfiguration(PageConfiguration&&);
AlternativeTextClient* alternativeTextClient { nullptr };
ChromeClient* chromeClient { nullptr };
@@ -93,7 +94,7 @@
PlugInClient* plugInClient { nullptr };
ProgressTrackerClient* progressTrackerClient { nullptr };
- RefPtr<BackForwardClient> backForwardClient;
+ Ref<BackForwardClient> backForwardClient;
std::unique_ptr<ValidationMessageClient> validationMessageClient;
FrameLoaderClient* loaderClientForMainFrame { nullptr };
std::unique_ptr<DiagnosticLoggingClient> diagnosticLoggingClient;
Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (237156 => 237157)
--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -453,13 +453,7 @@
return EncodedDataStatus::Complete;
if (allDataReceived) {
- PageConfiguration pageConfiguration(
- createEmptyEditorClient(),
- SocketProvider::create(),
- LibWebRTCProvider::create(),
- CacheStorageProvider::create()
- );
- fillWithEmptyClients(pageConfiguration);
+ auto pageConfiguration = pageConfigurationWithEmptyClients();
m_chromeClient = std::make_unique<SVGImageChromeClient>(this);
pageConfiguration.chromeClient = m_chromeClient.get();
Modified: trunk/Source/WebKit/ChangeLog (237156 => 237157)
--- trunk/Source/WebKit/ChangeLog 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/ChangeLog 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1,3 +1,26 @@
+2018-10-15 Alex Christensen <[email protected]>
+
+ Modernize BackForwardClient.h
+ https://bugs.webkit.org/show_bug.cgi?id=190610
+
+ Reviewed by Chris Dumez.
+
+ * WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp:
+ (WebKit::InjectedBundleBackForwardList::clear):
+ * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+ (WebKit::WebSWContextManagerConnection::installServiceWorker):
+ * WebProcess/WebPage/WebBackForwardListProxy.cpp:
+ (WebKit::WebBackForwardListProxy::WebBackForwardListProxy):
+ (WebKit::WebBackForwardListProxy::backListCount const):
+ (WebKit::WebBackForwardListProxy::forwardListCount const):
+ (WebKit::WebBackForwardListProxy::backListCount): Deleted.
+ (WebKit::WebBackForwardListProxy::forwardListCount): Deleted.
+ * WebProcess/WebPage/WebBackForwardListProxy.h:
+ (WebKit::WebBackForwardListProxy::create):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_cpuLimit):
+ (WebKit::WebPage::restoreSessionInternal):
+
2018-10-15 Timothy Hatcher <[email protected]>
Add support for prefers-color-scheme media query
Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp (237156 => 237157)
--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleBackForwardList.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -72,7 +72,7 @@
Page* page = m_page->corePage();
if (!page)
return;
- static_cast<WebBackForwardListProxy*>(page->backForward().client())->clear();
+ static_cast<WebBackForwardListProxy&>(page->backForward().client()).clear();
}
} // namespace WebKit
Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (237156 => 237157)
--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -139,15 +139,8 @@
{
LOG(ServiceWorker, "WebSWContextManagerConnection::installServiceWorker for worker %s", data.serviceWorkerIdentifier.loggingString().utf8().data());
- PageConfiguration pageConfiguration {
- createEmptyEditorClient(),
- WebSocketProvider::create(),
- WebCore::LibWebRTCProvider::create(),
- WebProcess::singleton().cacheStorageProvider()
- };
+ auto pageConfiguration = pageConfigurationWithEmptyClients();
- fillWithEmptyClients(pageConfiguration);
-
#if ENABLE(INDEXED_DATABASE)
pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroupID);
#endif
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp (237156 => 237157)
--- trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -82,8 +82,8 @@
WebCore::Page::clearPreviousItemFromAllPages(item.get());
}
-WebBackForwardListProxy::WebBackForwardListProxy(WebPage* page)
- : m_page(page)
+WebBackForwardListProxy::WebBackForwardListProxy(WebPage& page)
+ : m_page(&page)
{
WebCore::notifyHistoryItemChanged = WK2NotifyHistoryItemChanged;
}
@@ -125,7 +125,7 @@
return idToHistoryItemMap().get(*itemID);
}
-int WebBackForwardListProxy::backListCount()
+int WebBackForwardListProxy::backListCount() const
{
if (!m_page)
return 0;
@@ -137,7 +137,7 @@
return backListCount;
}
-int WebBackForwardListProxy::forwardListCount()
+int WebBackForwardListProxy::forwardListCount() const
{
if (!m_page)
return 0;
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h (237156 => 237157)
--- trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -23,8 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebBackForwardListProxy_h
-#define WebBackForwardListProxy_h
+#pragma once
#include <WebCore/BackForwardClient.h>
#include <wtf/HashSet.h>
@@ -39,7 +38,7 @@
class WebBackForwardListProxy : public WebCore::BackForwardClient {
public:
- static Ref<WebBackForwardListProxy> create(WebPage* page) { return adoptRef(*new WebBackForwardListProxy(page)); }
+ static Ref<WebBackForwardListProxy> create(WebPage& page) { return adoptRef(*new WebBackForwardListProxy(page)); }
static WebCore::HistoryItem* itemForID(const WebCore::BackForwardItemIdentifier&);
static void removeItem(const WebCore::BackForwardItemIdentifier&);
@@ -53,7 +52,7 @@
void clear();
private:
- WebBackForwardListProxy(WebPage*);
+ WebBackForwardListProxy(WebPage&);
void addItem(Ref<WebCore::HistoryItem>&&) override;
@@ -60,8 +59,8 @@
void goToItem(WebCore::HistoryItem*) override;
WebCore::HistoryItem* itemAtIndex(int) override;
- int backListCount() override;
- int forwardListCount() override;
+ int backListCount() const override;
+ int forwardListCount() const override;
void close() override;
@@ -69,5 +68,3 @@
};
} // namespace WebKit
-
-#endif // WebBackForwardListProxy_h
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (237156 => 237157)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -408,7 +408,8 @@
makeUniqueRef<WebEditorClient>(this),
WebSocketProvider::create(),
makeUniqueRef<WebKit::LibWebRTCProvider>(),
- WebProcess::singleton().cacheStorageProvider()
+ WebProcess::singleton().cacheStorageProvider(),
+ WebBackForwardListProxy::create(*this)
);
pageConfiguration.chromeClient = new WebChromeClient(*this);
#if ENABLE(CONTEXT_MENUS)
@@ -417,7 +418,6 @@
#if ENABLE(DRAG_SUPPORT)
pageConfiguration.dragClient = new WebDragClient(this);
#endif
- pageConfiguration.backForwardClient = WebBackForwardListProxy::create(this);
pageConfiguration.inspectorClient = new WebInspectorClient(this);
#if USE(AUTOCORRECTION_PANEL)
pageConfiguration.alternativeTextClient = new WebAlternativeTextClient(this);
@@ -2527,7 +2527,7 @@
for (const auto& itemState : itemStates) {
auto historyItem = toHistoryItem(itemState);
historyItem->setWasRestoredFromSession(restoredByAPIRequest == WasRestoredByAPIRequest::Yes);
- static_cast<WebBackForwardListProxy*>(corePage()->backForward().client())->addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID, overwrite);
+ static_cast<WebBackForwardListProxy&>(corePage()->backForward().client()).addItemFromUIProcess(itemState.identifier, WTFMove(historyItem), m_pageID, overwrite);
}
}
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1,3 +1,31 @@
+2018-10-15 Alex Christensen <[email protected]>
+
+ Modernize BackForwardClient.h
+ https://bugs.webkit.org/show_bug.cgi?id=190610
+
+ Reviewed by Chris Dumez.
+
+ * History/BackForwardList.h:
+ * History/BackForwardList.mm:
+ (BackForwardList::backListCount const):
+ (BackForwardList::forwardListCount const):
+ (BackForwardList::backListCount): Deleted.
+ (BackForwardList::forwardListCount): Deleted.
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList init]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::canCachePage const):
+ * WebView/WebFrameView.mm:
+ (-[WebFrameView keyDown:keyDown:]):
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+ (-[WebView _loadBackForwardListFromOtherView:]):
+ (-[WebView initWithCoder:]):
+ (-[WebView encodeWithCoder:]):
+ (-[WebView backForwardList]):
+ (-[WebView setMaintainsBackForwardList:]):
+
2018-10-15 Timothy Hatcher <[email protected]>
Add support for prefers-color-scheme media query
Modified: trunk/Source/WebKitLegacy/mac/History/BackForwardList.h (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/History/BackForwardList.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/History/BackForwardList.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -59,8 +59,8 @@
void setCapacity(int);
bool enabled();
void setEnabled(bool);
- int backListCount() override;
- int forwardListCount() override;
+ int backListCount() const override;
+ int forwardListCount() const override;
bool containsItem(WebCore::HistoryItem&);
void close() override;
Modified: trunk/Source/WebKitLegacy/mac/History/BackForwardList.mm (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/History/BackForwardList.mm 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/History/BackForwardList.mm 2018-10-16 00:14:41 UTC (rev 237157)
@@ -189,14 +189,14 @@
}
}
-int BackForwardList::backListCount()
+int BackForwardList::backListCount() const
{
return m_current == NoCurrentItemIndex ? 0 : m_current;
}
-int BackForwardList::forwardListCount()
+int BackForwardList::forwardListCount() const
{
- return m_current == NoCurrentItemIndex ? 0 : (int)m_entries.size() - (m_current + 1);
+ return m_current == NoCurrentItemIndex ? 0 : static_cast<int>(m_entries.size()) - (m_current + 1);
}
HistoryItem* BackForwardList::itemAtIndex(int index)
Modified: trunk/Source/WebKitLegacy/mac/History/WebBackForwardList.mm (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/History/WebBackForwardList.mm 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/History/WebBackForwardList.mm 2018-10-16 00:14:41 UTC (rev 237157)
@@ -107,7 +107,7 @@
- (id)init
{
- return [self initWithBackForwardList:BackForwardList::create(0)];
+ return [self initWithBackForwardList:BackForwardList::create(nullptr)];
}
- (void)dealloc
Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1604,11 +1604,11 @@
if (!page)
return false;
- BackForwardList *backForwardList = static_cast<BackForwardList*>(page->backForward().client());
- if (!backForwardList->enabled())
+ BackForwardList& backForwardList = static_cast<BackForwardList&>(page->backForward().client());
+ if (!backForwardList.enabled())
return false;
- if (!backForwardList->capacity())
+ if (!backForwardList.capacity())
return false;
return true;
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrameView.mm 2018-10-16 00:14:41 UTC (rev 237157)
@@ -910,7 +910,7 @@
int index, count;
BOOL callSuper = YES;
Frame* coreFrame = [self _web_frame];
- BOOL maintainsBackForwardList = coreFrame && static_cast<BackForwardList*>(coreFrame->page()->backForward().client())->enabled() ? YES : NO;
+ BOOL maintainsBackForwardList = coreFrame && static_cast<BackForwardList&>(coreFrame->page()->backForward().client()).enabled() ? YES : NO;
count = [characters length];
for (index = 0; index < count; ++index) {
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (237156 => 237157)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1437,7 +1437,8 @@
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
LibWebRTCProvider::create(),
- WebCore::CacheStorageProvider::create()
+ WebCore::CacheStorageProvider::create(),
+ BackForwardList::create(self)
);
#if !PLATFORM(IOS)
pageConfiguration.chromeClient = new WebChromeClient(self);
@@ -1454,8 +1455,6 @@
pageConfiguration.dragClient = new WebDragClient(self);
#endif
- pageConfiguration.backForwardClient = BackForwardList::create(self);
-
#if ENABLE(APPLE_PAY)
pageConfiguration.paymentCoordinatorClient = new WebPaymentCoordinatorClient();
#endif
@@ -1703,7 +1702,8 @@
makeUniqueRef<WebEditorClient>(self),
SocketProvider::create(),
LibWebRTCProvider::create(),
- WebCore::CacheStorageProvider::create()
+ WebCore::CacheStorageProvider::create(),
+ makeUniqueRef<BackForwardList>(),
);
pageConfiguration.chromeClient = new WebChromeClientIOS(self);
#if ENABLE(DRAG_SUPPORT)
@@ -1714,7 +1714,6 @@
pageConfiguration.paymentCoordinatorClient = new WebPaymentCoordinatorClient();
#endif
- pageConfiguration.backForwardClient = BackForwardList::create(self);
pageConfiguration.inspectorClient = new WebInspectorClient(self);
pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
@@ -2641,7 +2640,7 @@
Ref<HistoryItem> newItem = otherBackForward.itemAtIndex(i)->copy();
if (i == 0)
newItemToGoTo = newItem.ptr();
- backForward.client()->addItem(WTFMove(newItem));
+ backForward.client().addItem(WTFMove(newItem));
}
ASSERT(newItemToGoTo);
@@ -5876,7 +5875,7 @@
LOG(Encoding, "FrameName = %@, GroupName = %@, useBackForwardList = %d\n", frameName, groupName, (int)useBackForwardList);
[result _commonInitializationWithFrameName:frameName groupName:groupName];
- static_cast<BackForwardList*>([result page]->backForward().client())->setEnabled(useBackForwardList);
+ static_cast<BackForwardList&>([result page]->backForward().client()).setEnabled(useBackForwardList);
result->_private->allowsUndo = allowsUndo;
if (preferences)
[result setPreferences:preferences];
@@ -5904,7 +5903,7 @@
_subviews = originalSubviews;
ALLOW_DEPRECATED_DECLARATIONS_END
- BOOL useBackForwardList = _private->page && static_cast<BackForwardList*>(_private->page->backForward().client())->enabled();
+ BOOL useBackForwardList = _private->page && static_cast<BackForwardList&>(_private->page->backForward().client()).enabled();
if ([encoder allowsKeyedCoding]) {
[encoder encodeObject:[[self mainFrame] name] forKey:@"FrameName"];
[encoder encodeObject:[self groupName] forKey:@"GroupName"];
@@ -6386,10 +6385,10 @@
{
if (!_private->page)
return nil;
- BackForwardList* list = static_cast<BackForwardList*>(_private->page->backForward().client());
- if (!list->enabled())
+ BackForwardList& list = static_cast<BackForwardList&>(_private->page->backForward().client());
+ if (!list.enabled())
return nil;
- return kit(list);
+ return kit(&list);
}
- (void)setMaintainsBackForwardList:(BOOL)flag
@@ -6396,7 +6395,7 @@
{
if (!_private->page)
return;
- static_cast<BackForwardList*>(_private->page->backForward().client())->setEnabled(flag);
+ static_cast<BackForwardList&>(_private->page->backForward().client()).setEnabled(flag);
}
- (BOOL)goBack
Modified: trunk/Source/WebKitLegacy/win/BackForwardList.cpp (237156 => 237157)
--- trunk/Source/WebKitLegacy/win/BackForwardList.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/win/BackForwardList.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -196,12 +196,12 @@
}
}
-int BackForwardList::backListCount()
+int BackForwardList::backListCount() const
{
return m_current == NoCurrentItemIndex ? 0 : m_current;
}
-int BackForwardList::forwardListCount()
+int BackForwardList::forwardListCount() const
{
return m_current == NoCurrentItemIndex ? 0 : (int)m_entries.size() - (m_current + 1);
}
Modified: trunk/Source/WebKitLegacy/win/BackForwardList.h (237156 => 237157)
--- trunk/Source/WebKitLegacy/win/BackForwardList.h 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/win/BackForwardList.h 2018-10-16 00:14:41 UTC (rev 237157)
@@ -56,8 +56,8 @@
void setCapacity(int);
bool enabled();
void setEnabled(bool);
- int backListCount() override;
- int forwardListCount() override;
+ int backListCount() const final;
+ int forwardListCount() const final;
bool containsItem(WebCore::HistoryItem*);
void close() override;
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (237156 => 237157)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2018-10-16 00:14:41 UTC (rev 237157)
@@ -1,5 +1,22 @@
2018-10-15 Alex Christensen <[email protected]>
+ Modernize BackForwardClient.h
+ https://bugs.webkit.org/show_bug.cgi?id=190610
+
+ Reviewed by Chris Dumez.
+
+ * BackForwardList.cpp:
+ (BackForwardList::backListCount const):
+ (BackForwardList::forwardListCount const):
+ (BackForwardList::backListCount): Deleted.
+ (BackForwardList::forwardListCount): Deleted.
+ * BackForwardList.h:
+ * WebView.cpp:
+ (WebView::initWithFrame):
+ (WebView::backForwardList):
+
+2018-10-15 Alex Christensen <[email protected]>
+
Remove unused WebView._globalHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=190601
Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (237156 => 237157)
--- trunk/Source/WebKitLegacy/win/WebView.cpp 2018-10-15 23:43:02 UTC (rev 237156)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp 2018-10-16 00:14:41 UTC (rev 237157)
@@ -3109,9 +3109,9 @@
makeUniqueRef<WebEditorClient>(this),
SocketProvider::create(),
makeUniqueRef<LibWebRTCProvider>(),
- WebCore::CacheStorageProvider::create()
+ WebCore::CacheStorageProvider::create(),
+ BackForwardList::create()
);
- configuration.backForwardClient = BackForwardList::create();
configuration.chromeClient = new WebChromeClient(this);
configuration.contextMenuClient = new WebContextMenuClient(this);
configuration.dragClient = new WebDragClient(this);
@@ -3394,7 +3394,7 @@
if (!m_useBackForwardList)
return E_FAIL;
- *list = WebBackForwardList::createInstance(static_cast<BackForwardList*>(m_page->backForward().client()));
+ *list = WebBackForwardList::createInstance(makeRef(&static_cast<BackForwardList&>(m_page->backForward().client())));
return S_OK;
}