Page should have less intrusive way to associate API implementation objects.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 01:18:28 +0000 (01:18 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2012 01:18:28 +0000 (01:18 +0000)
commit913088925735d340004c43881c0b83d859a17e50
treedbd617b920c36389d957da48aadaecd2bb624b47
parentad746ff4c4411b68b05d958e4f554b77c868d7b1
Page should have less intrusive way to associate API implementation objects.
https://bugs.webkit.org/show_bug.cgi?id=78085

Patch by Hajime Morrita <morrita@chromium.org> on 2012-02-12
Reviewed by Adam Barth.

Source/WebCore:

Introducing PageSupplement interface to attach behind-the-flag-ish
objects to Page instances.

This change aims to improve modularity of Modules/ entries. With
PageSupplement mechinary, we can eliminate ifdef conditionals from
Page.h/Page.cpp and are able to add Modules/ entries without
touching non-Module WebCore files. WebKit API classes like WebPage
can "provide" these objects dynamically during the Page setup phase.

In this change, DeviceMotionController and
DeviceOrientationController is updated to adopt PageSupplement
inteface for an illustrative purpose because they are going to
move into Modules/ shortly. Other Page associated API backing
objects also should be transformed to PageSupplement family.

Reviewed by Adam Barth.

No new tests. No behavior change.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DeviceMotionClient.h:
(WebCore):
* dom/DeviceMotionController.cpp:
(WebCore::DeviceMotionController::supplementName):
(WebCore):
(WebCore::DeviceMotionController::isActiveAt):
(WebCore::provideDeviceMotionTo):
* dom/DeviceMotionController.h:
(DeviceMotionController):
(WebCore::DeviceMotionController::from):
* dom/DeviceOrientationClient.h:
(WebCore):
* dom/DeviceOrientationController.cpp:
(WebCore::DeviceOrientationController::supplementName):
(WebCore):
(WebCore::DeviceOrientationController::isActiveAt):
(WebCore::provideDeviceOrientationTo):
* dom/DeviceOrientationController.h:
(DeviceOrientationController):
(WebCore::DeviceOrientationController::from):
* dom/Document.cpp:
(WebCore::Document::suspendActiveDOMObjects):
(WebCore::Document::resumeActiveDOMObjects):
* history/PageCache.cpp:
(WebCore::logCanCachePageDecision):
(WebCore::PageCache::canCache):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/PageSupplement.cpp:
(WebCore::PageSupplement::~PageSupplement):
(WebCore::PageSupplement::provideTo):
(WebCore::PageSupplement::from):
* page/PageSupplement.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
(WebCore::Page::provideSupplement):
(WebCore):
(WebCore::Page::requireSupplement):
(WebCore::Page::notifyDestroyedToSupplements):
(WebCore::Page::PageClients::PageClients):
* page/Page.h:
(WebCore):
(PageClients):
(Page):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/chromium:

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WebKit/qt:

* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::setMockDeviceOrientation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@107518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/DeviceMotionClient.h
Source/WebCore/dom/DeviceMotionController.cpp
Source/WebCore/dom/DeviceMotionController.h
Source/WebCore/dom/DeviceOrientationClient.h
Source/WebCore/dom/DeviceOrientationController.cpp
Source/WebCore/dom/DeviceOrientationController.h
Source/WebCore/dom/Document.cpp
Source/WebCore/history/PageCache.cpp
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/PageSupplement.cpp [new file with mode: 0644]
Source/WebCore/page/PageSupplement.h [new file with mode: 0644]
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp