Clean up EditorClient lifetime
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jun 2016 23:53:36 +0000 (23:53 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Jun 2016 23:53:36 +0000 (23:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158588

Reviewed by Anders Carlsson.

Source/WebCore:

No new tests.  This patch does two things, all of which do not change behavior:
1. Use a std::unique_ptr<EditorClient> owned by the Page instead of allocating
with new in WebKit/WebKit2 and deleting in WebEditorClient::pageDestroyed.
2. Give the Page a PageConfiguration&& instead of a PageConfiguration& in its constructor.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
* loader/EmptyClients.h:
(WebCore::EmptyEditorClient::EmptyEditorClient):
(WebCore::EmptyEditorClient::~EmptyEditorClient):
* page/EditorClient.h:
(WebCore::EditorClient::~EditorClient):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
(WebCore::Page::setViewMode):
(WebCore::Page::clearUndoRedoOperations):
(WebCore::Page::inLowQualityImageInterpolationMode):
(WebCore::Page::invalidateStylesForAllLinks):
(WebCore::Page::invalidateStylesForLink):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
(WebCore::Page::setDebugger):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::setAllowsMediaDocumentInlinePlayback):
* page/Page.h:
(WebCore::Page::canStartMedia):
(WebCore::Page::editorClient):
(WebCore::Page::plugInClient):
(WebCore::Page::mainFrame):
(WebCore::Page::group):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* page/mac/PageMac.mm:
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/mac:

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::WebEditorClient):
(WebEditorClient::pageDestroyed): Deleted.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit2:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::generateTextCheckingRequestID):
(WebKit::WebEditorClient::shouldDeleteRange):
(WebKit::WebEditorClient::pageDestroyed): Deleted.
* WebProcess/WebCoreSupport/WebEditorClient.h:
(WebKit::WebEditorClient::WebEditorClient):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldDispatchFakeMouseMoveEvents):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201894 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/loader/EmptyClients.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/EditorClient.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageConfiguration.cpp
Source/WebCore/page/PageConfiguration.h
Source/WebCore/page/mac/PageMac.mm
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebEditorClient.h
Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 92ce203..423fb96 100644 (file)
@@ -1,3 +1,50 @@
+2016-06-09  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up EditorClient lifetime
+        https://bugs.webkit.org/show_bug.cgi?id=158588
+
+        Reviewed by Anders Carlsson.
+
+        No new tests.  This patch does two things, all of which do not change behavior:
+        1. Use a std::unique_ptr<EditorClient> owned by the Page instead of allocating
+        with new in WebKit/WebKit2 and deleting in WebEditorClient::pageDestroyed.
+        2. Give the Page a PageConfiguration&& instead of a PageConfiguration& in its constructor.
+
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::overlayPage):
+        * loader/EmptyClients.cpp:
+        (WebCore::fillWithEmptyClients):
+        * loader/EmptyClients.h:
+        (WebCore::EmptyEditorClient::EmptyEditorClient):
+        (WebCore::EmptyEditorClient::~EmptyEditorClient):
+        * page/EditorClient.h:
+        (WebCore::EditorClient::~EditorClient):
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::~Page):
+        (WebCore::Page::setViewMode):
+        (WebCore::Page::clearUndoRedoOperations):
+        (WebCore::Page::inLowQualityImageInterpolationMode):
+        (WebCore::Page::invalidateStylesForAllLinks):
+        (WebCore::Page::invalidateStylesForLink):
+        (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
+        (WebCore::Page::setDebugger):
+        (WebCore::Page::setIsVisibleInternal):
+        (WebCore::Page::setAllowsMediaDocumentInlinePlayback):
+        * page/Page.h:
+        (WebCore::Page::canStartMedia):
+        (WebCore::Page::editorClient):
+        (WebCore::Page::plugInClient):
+        (WebCore::Page::mainFrame):
+        (WebCore::Page::group):
+        * page/PageConfiguration.cpp:
+        * page/PageConfiguration.h:
+        * page/mac/PageMac.mm:
+        (WebCore::Page::addSchedulePair):
+        (WebCore::Page::removeSchedulePair):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
 2016-06-09  Joseph Pecoraro  <pecoraro@apple.com>
 
         REGRESSION: Web Inspector: IndexedDB does not show ObjectStore data
index 8e98933..28f7ac0 100644 (file)
@@ -866,7 +866,7 @@ Page* InspectorOverlay::overlayPage()
 
     PageConfiguration pageConfiguration;
     fillWithEmptyClients(pageConfiguration);
-    m_overlayPage = std::make_unique<Page>(pageConfiguration);
+    m_overlayPage = std::make_unique<Page>(WTFMove(pageConfiguration));
 
     Settings& settings = m_page.settings();
     Settings& overlaySettings = m_overlayPage->settings();
index f0cdacb..95c20a9 100644 (file)
@@ -129,9 +129,8 @@ void fillWithEmptyClients(PageConfiguration& pageConfiguration)
     pageConfiguration.dragClient = &dummyDragClient.get();
 #endif
 
-    static NeverDestroyed<EmptyEditorClient> dummyEditorClient;
-    pageConfiguration.editorClient = &dummyEditorClient.get();
-
+    pageConfiguration.editorClient = std::make_unique<EmptyEditorClient>();
+    
     static NeverDestroyed<EmptyInspectorClient> dummyInspectorClient;
     pageConfiguration.inspectorClient = &dummyInspectorClient.get();
 
index 4139283..10e7ee8 100644 (file)
@@ -40,7 +40,6 @@
 #include "FocusDirection.h"
 #include "FrameLoaderClient.h"
 #include "InspectorClient.h"
-#include "Page.h"
 #include "ProgressTrackerClient.h"
 #include "ResourceError.h"
 #include "TextCheckerClient.h"
@@ -71,6 +70,7 @@
 namespace WebCore {
 
 class GraphicsContext3D;
+class Page;
 
 class EmptyChromeClient : public ChromeClient {
     WTF_MAKE_FAST_ALLOCATED;
@@ -436,7 +436,6 @@ class EmptyEditorClient : public EditorClient {
 public:
     EmptyEditorClient() { }
     virtual ~EmptyEditorClient() { }
-    void pageDestroyed() override { }
 
     bool shouldDeleteRange(Range*) override { return false; }
     bool smartInsertDeleteEnabled() override { return false; }
index 0b43a6b..05b080a 100644 (file)
@@ -70,7 +70,6 @@ struct GrammarDetail;
 class EditorClient {
 public:
     virtual ~EditorClient() {  }
-    virtual void pageDestroyed() = 0;
 
     virtual bool shouldDeleteRange(Range*) = 0;
     virtual bool smartInsertDeleteEnabled() = 0; 
index 710e8e1..a80453e 100644 (file)
@@ -156,7 +156,7 @@ static void networkStateChanged(bool isOnLine)
 
 static const ViewState::Flags PageInitialViewState = ViewState::IsVisible | ViewState::IsInWindow;
 
-Page::Page(PageConfiguration& pageConfiguration)
+Page::Page(PageConfiguration&& pageConfiguration)
     : m_chrome(std::make_unique<Chrome>(*this, *pageConfiguration.chromeClient))
     , m_dragCaretController(std::make_unique<DragCaretController>())
 #if ENABLE(DRAG_SUPPORT)
@@ -179,7 +179,7 @@ Page::Page(PageConfiguration& pageConfiguration)
     , m_backForwardController(std::make_unique<BackForwardController>(*this, WTFMove(pageConfiguration.backForwardClient)))
     , m_mainFrame(MainFrame::create(*this, pageConfiguration))
     , m_theme(RenderTheme::themeForPage(this))
-    , m_editorClient(*pageConfiguration.editorClient)
+    , m_editorClient(WTFMove(pageConfiguration.editorClient))
     , m_plugInClient(pageConfiguration.plugInClient)
     , m_validationMessageClient(pageConfiguration.validationMessageClient)
     , m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
@@ -238,6 +238,7 @@ Page::Page(PageConfiguration& pageConfiguration)
     , m_sessionID(SessionID::defaultSessionID())
     , m_isClosing(false)
 {
+    ASSERT(m_editorClient);
     updateTimerThrottlingState();
 
     m_storageNamespaceProvider->addPage(*this);
@@ -283,7 +284,6 @@ Page::~Page()
         frame->detachFromPage();
     }
 
-    m_editorClient.pageDestroyed();
     if (m_plugInClient)
         m_plugInClient->pageDestroyed();
     if (m_alternativeTextClient)
@@ -412,8 +412,6 @@ void Page::setViewMode(ViewMode viewMode)
 
     m_viewMode = viewMode;
 
-    if (!m_mainFrame)
-        return;
 
     if (m_mainFrame->view())
         m_mainFrame->view()->forceLayout();
@@ -750,7 +748,7 @@ void Page::setDefersLoading(bool defers)
 
 void Page::clearUndoRedoOperations()
 {
-    m_editorClient.clearUndoRedoOperations();
+    m_editorClient->clearUndoRedoOperations();
 }
 
 bool Page::inLowQualityImageInterpolationMode() const
@@ -1122,7 +1120,7 @@ const String& Page::userStyleSheet() const
 
 void Page::invalidateStylesForAllLinks()
 {
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->document())
             continue;
         frame->document()->visitedLinkState().invalidateStyleForAllLinks();
@@ -1131,7 +1129,7 @@ void Page::invalidateStylesForAllLinks()
 
 void Page::invalidateStylesForLink(LinkHash linkHash)
 {
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->document())
             continue;
         frame->document()->visitedLinkState().invalidateStyleForLink(linkHash);
@@ -1140,7 +1138,7 @@ void Page::invalidateStylesForLink(LinkHash linkHash)
 
 void Page::invalidateInjectedStyleSheetCacheInAllFrames()
 {
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         Document* document = frame->document();
         if (!document)
             continue;
@@ -1156,7 +1154,7 @@ void Page::setDebugger(JSC::Debugger* debugger)
 
     m_debugger = debugger;
 
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
         frame->script().attachDebugger(m_debugger);
 }
 
@@ -1487,7 +1485,7 @@ void Page::setIsVisibleInternal(bool isVisible)
     }
 
     Vector<Ref<Document>> documents;
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
         documents.append(*frame->document());
 
     for (auto& document : documents)
@@ -1985,7 +1983,7 @@ void Page::setAllowsMediaDocumentInlinePlayback(bool flag)
     m_allowsMediaDocumentInlinePlayback = flag;
 
     Vector<Ref<Document>> documents;
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
         documents.append(*frame->document());
 
     for (auto& document : documents)
index c569840..f940a3d 100644 (file)
@@ -18,8 +18,7 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef Page_h
-#define Page_h
+#pragma once
 
 #include "FindOptions.h"
 #include "FrameLoaderTypes.h"
@@ -141,7 +140,7 @@ public:
     WEBCORE_EXPORT static void updateStyleForAllPagesAfterGlobalChangeInEnvironment();
     WEBCORE_EXPORT static void clearPreviousItemFromAllPages(HistoryItem*);
 
-    WEBCORE_EXPORT explicit Page(PageConfiguration&);
+    WEBCORE_EXPORT explicit Page(PageConfiguration&&);
     WEBCORE_EXPORT ~Page();
 
     WEBCORE_EXPORT uint64_t renderTreeSize() const;
@@ -158,11 +157,11 @@ public:
     WEBCORE_EXPORT void setCanStartMedia(bool);
     bool canStartMedia() const { return m_canStartMedia; }
 
-    EditorClient& editorClient() { return m_editorClient; }
+    EditorClient& editorClient() const { return *m_editorClient; }
     PlugInClient* plugInClient() const { return m_plugInClient; }
 
-    MainFrame& mainFrame() { ASSERT(m_mainFrame); return *m_mainFrame; }
-    const MainFrame& mainFrame() const { ASSERT(m_mainFrame); return *m_mainFrame; }
+    MainFrame& mainFrame() { return m_mainFrame.get(); }
+    const MainFrame& mainFrame() const { return m_mainFrame.get(); }
 
     bool inPageCache() const;
 
@@ -578,13 +577,13 @@ private:
     const std::unique_ptr<ProgressTracker> m_progress;
 
     const std::unique_ptr<BackForwardController> m_backForwardController;
-    const RefPtr<MainFrame> m_mainFrame;
+    Ref<MainFrame> m_mainFrame;
 
     mutable RefPtr<PluginData> m_pluginData;
 
     RefPtr<RenderTheme> m_theme;
 
-    EditorClient& m_editorClient;
+    std::unique_ptr<EditorClient> m_editorClient;
     PlugInClient* m_plugInClient;
     ValidationMessageClient* m_validationMessageClient;
     std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient;
@@ -724,5 +723,3 @@ inline PageGroup& Page::group()
 }
 
 } // namespace WebCore
-    
-#endif // Page_h
index 8fe7799..6c117dc 100644 (file)
@@ -30,6 +30,7 @@
 #include "BackForwardClient.h"
 #include "DatabaseProvider.h"
 #include "DiagnosticLoggingClient.h"
+#include "EditorClient.h"
 #include "StorageNamespaceProvider.h"
 #include "UserContentController.h"
 #include "VisitedLinkStore.h"
index e607b47..458ec3d 100644 (file)
@@ -67,7 +67,7 @@ public:
 #if ENABLE(CONTEXT_MENUS)
     ContextMenuClient* contextMenuClient { nullptr };
 #endif
-    EditorClient* editorClient { nullptr };
+    std::unique_ptr<EditorClient> editorClient;
     DragClient* dragClient { nullptr };
     InspectorClient* inspectorClient { nullptr };
     PlugInClient* plugInClient { nullptr };
index f49cdeb..aa49d9f 100644 (file)
@@ -70,7 +70,7 @@ void Page::addSchedulePair(Ref<SchedulePair>&& pair)
     m_scheduledRunLoopPairs->add(pair.ptr());
 
 #if !USE(CFNETWORK)
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (DocumentLoader* documentLoader = frame->loader().documentLoader())
             documentLoader->schedule(pair);
         if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
@@ -90,7 +90,7 @@ void Page::removeSchedulePair(Ref<SchedulePair>&& pair)
     m_scheduledRunLoopPairs->remove(pair.ptr());
 
 #if !USE(CFNETWORK)
-    for (Frame* frame = m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
+    for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext()) {
         if (DocumentLoader* documentLoader = frame->loader().documentLoader())
             documentLoader->unschedule(pair);
         if (DocumentLoader* documentLoader = frame->loader().provisionalDocumentLoader())
index 4e81808..d3e47ac 100644 (file)
@@ -390,7 +390,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
         // This will become an issue when SVGImage will be able to load other
         // SVGImage objects, but we're safe now, because SVGImage can only be
         // loaded by a top-level document.
-        m_page = std::make_unique<Page>(pageConfiguration);
+        m_page = std::make_unique<Page>(WTFMove(pageConfiguration));
         m_page->settings().setMediaEnabled(false);
         m_page->settings().setScriptEnabled(false);
         m_page->settings().setPluginsEnabled(false);
index b52ed79..86cd455 100644 (file)
@@ -1,3 +1,18 @@
+2016-06-09  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up EditorClient lifetime
+        https://bugs.webkit.org/show_bug.cgi?id=158588
+
+        Reviewed by Anders Carlsson.
+
+        * WebCoreSupport/WebEditorClient.h:
+        * WebCoreSupport/WebEditorClient.mm:
+        (WebEditorClient::WebEditorClient):
+        (WebEditorClient::pageDestroyed): Deleted.
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
 2016-06-09  Andy Estes  <aestes@apple.com>
 
         Define printing{Minimum,Maximum}ShrinkFactor in only one place
index c72b5f7..9970eb4 100644 (file)
@@ -51,8 +51,6 @@ public:
     void didCheckSucceed(int sequence, NSArray *results);
 
 private:
-    void pageDestroyed() override;
-
     bool isGrammarCheckingEnabled() override;
     void toggleGrammarChecking() override;
     bool isContinuousSpellCheckingEnabled() override;
index 5eb6ab5..30a305f 100644 (file)
@@ -183,11 +183,6 @@ static WebViewInsertAction kit(EditorInsertAction coreAction)
 
 @end
 
-void WebEditorClient::pageDestroyed()
-{
-    delete this;
-}
-
 WebEditorClient::WebEditorClient(WebView *webView)
     : m_webView(webView)
     , m_undoTarget(adoptNS([[WebEditorUndoTarget alloc] init]))
index b014b6b..11707d6 100644 (file)
@@ -1004,7 +1004,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 #import <WebKitAdditions/WebViewInitialization.mm>
 #endif
 
-    pageConfiguration.editorClient = new WebEditorClient(self);
+    pageConfiguration.editorClient = std::make_unique<WebEditorClient>(self);
     pageConfiguration.alternativeTextClient = new WebAlternativeTextClient(self);
     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
@@ -1013,7 +1013,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     pageConfiguration.storageNamespaceProvider = &_private->group->storageNamespaceProvider();
     pageConfiguration.userContentProvider = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
-    _private->page = new Page(pageConfiguration);
+    _private->page = new Page(WTFMove(pageConfiguration));
 
     _private->page->setGroupName(groupName);
 
@@ -1248,7 +1248,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 #import <WebKitAdditions/WebViewInitialization.mm>
 #endif
 
-    pageConfiguration.editorClient = new WebEditorClient(self);
+    pageConfiguration.editorClient = std::make_unique<WebEditorClient>(self);
     pageConfiguration.inspectorClient = new WebInspectorClient(self);
     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
@@ -1258,7 +1258,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     pageConfiguration.userContentProvider = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
 
-    _private->page = new Page(pageConfiguration);
+    _private->page = new Page(WTFMove(pageConfiguration));
     
     [self setSmartInsertDeleteEnabled:YES];
     
index 0135dd2..ec68f37 100644 (file)
@@ -1,3 +1,19 @@
+2016-06-09  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up EditorClient lifetime
+        https://bugs.webkit.org/show_bug.cgi?id=158588
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::generateTextCheckingRequestID):
+        (WebKit::WebEditorClient::shouldDeleteRange):
+        (WebKit::WebEditorClient::pageDestroyed): Deleted.
+        * WebProcess/WebCoreSupport/WebEditorClient.h:
+        (WebKit::WebEditorClient::WebEditorClient):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_shouldDispatchFakeMouseMoveEvents):
+
 2016-06-09  Andy Estes  <aestes@apple.com>
 
         WKWebView does not render PDF pages in AirPrint
index e100220..42fc248 100644 (file)
@@ -70,11 +70,6 @@ static uint64_t generateTextCheckingRequestID()
     return uniqueTextCheckingRequestID++;
 }
 
-void WebEditorClient::pageDestroyed()
-{
-    delete this;
-}
-
 bool WebEditorClient::shouldDeleteRange(Range* range)
 {
     bool result = m_page->injectedBundleEditorClient().shouldDeleteRange(m_page, range);
index 7626168..61f0a81 100644 (file)
@@ -41,8 +41,6 @@ public:
     }
 
 private:
-    void pageDestroyed() override;
-
     bool shouldDeleteRange(WebCore::Range*) override;
     bool smartInsertDeleteEnabled() override;
     bool isSelectTrailingWhitespaceEnabled() override;
index d10da6e..a79df0f 100644 (file)
@@ -389,7 +389,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 #if ENABLE(CONTEXT_MENUS)
     pageConfiguration.contextMenuClient = new WebContextMenuClient(this);
 #endif
-    pageConfiguration.editorClient = new WebEditorClient(this);
+    pageConfiguration.editorClient = std::make_unique<WebEditorClient>(this);
 #if ENABLE(DRAG_SUPPORT)
     pageConfiguration.dragClient = new WebDragClient(this);
 #endif
@@ -414,7 +414,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 #include <WebKitAdditions/WebPageInitialization.h>
 #endif
 
-    m_page = std::make_unique<Page>(pageConfiguration);
+    m_page = std::make_unique<Page>(WTFMove(pageConfiguration));
     updatePreferences(parameters.store);
 
     m_drawingArea = DrawingArea::create(*this, parameters);