summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp19
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h4
2 files changed, 16 insertions, 7 deletions
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index fb4a91232..13fbe88d3 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -215,6 +215,8 @@ QWebPageAdapter::QWebPageAdapter()
, m_totalBytes(0)
, m_bytesReceived()
, networkManager(0)
+ , m_deviceOrientationClient(0)
+ , m_deviceMotionClient(0)
{
WebCore::initializeWebCoreQt();
}
@@ -247,18 +249,17 @@ void QWebPageAdapter::initializeWebCorePage()
#if ENABLE(DEVICE_ORIENTATION)
if (useMock) {
- DeviceOrientationClientMock* mockOrientationClient = new DeviceOrientationClientMock;
- WebCore::provideDeviceOrientationTo(page, mockOrientationClient);
-
- DeviceMotionClientMock* mockMotionClient= new DeviceMotionClientMock;
- WebCore::provideDeviceMotionTo(page, mockMotionClient);
+ m_deviceOrientationClient = new DeviceOrientationClientMock;
+ m_deviceMotionClient = new DeviceMotionClientMock;
}
#if HAVE(QTSENSORS)
else {
- WebCore::provideDeviceOrientationTo(page, new DeviceOrientationClientQt);
- WebCore::provideDeviceMotionTo(page, new DeviceMotionClientQt);
+ m_deviceOrientationClient = new DeviceOrientationClientQt;
+ m_deviceMotionClient = new DeviceMotionClientQt;
}
#endif
+ WebCore::provideDeviceOrientationTo(page, m_deviceOrientationClient);
+ WebCore::provideDeviceMotionTo(page, m_deviceMotionClient);
#endif
// By default each page is put into their own unique page group, which affects popup windows
@@ -289,6 +290,10 @@ QWebPageAdapter::~QWebPageAdapter()
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
NotificationPresenterClientQt::notificationPresenter()->removeClient();
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ delete m_deviceMotionClient;
+ delete m_deviceOrientationClient;
+#endif
}
void QWebPageAdapter::deletePage()
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
index 3629e906d..5e6efa697 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.h
@@ -47,6 +47,8 @@ QT_END_NAMESPACE
namespace WebCore {
class ChromeClientQt;
+class DeviceOrientationClient;
+class DeviceMotionClient;
class GeolocationClientQt;
class Page;
class UndoStep;
@@ -374,6 +376,8 @@ public:
private:
QNetworkAccessManager *networkManager;
+ WebCore::DeviceOrientationClient* m_deviceOrientationClient;
+ WebCore::DeviceMotionClient* m_deviceMotionClient;
public:
static bool drtRun;