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)
commit0013fdff344d8fa65616f2629d8f003b380d663e
tree2f1d6c59b320db50dd2f8d147d29ff042d60392c
parent22c232561e4d9a55ff6915e2bb0494c6f8d92283
Clean up EditorClient lifetime
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