summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/DeviceMotionController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/DeviceMotionController.cpp')
-rw-r--r--Source/WebCore/dom/DeviceMotionController.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/Source/WebCore/dom/DeviceMotionController.cpp b/Source/WebCore/dom/DeviceMotionController.cpp
index 89eb00262..1ca7aa72f 100644
--- a/Source/WebCore/dom/DeviceMotionController.cpp
+++ b/Source/WebCore/dom/DeviceMotionController.cpp
@@ -30,6 +30,7 @@
#include "DeviceMotionClient.h"
#include "DeviceMotionData.h"
#include "DeviceMotionEvent.h"
+#include "EventNames.h"
#include "Page.h"
namespace WebCore {
@@ -41,11 +42,6 @@ DeviceMotionController::DeviceMotionController(DeviceMotionClient* client)
deviceMotionClient()->setController(this);
}
-PassOwnPtr<DeviceMotionController> DeviceMotionController::create(DeviceMotionClient* client)
-{
- return adoptPtr(new DeviceMotionController(client));
-}
-
#if PLATFORM(IOS)
// FIXME: We should look to reconcile the iOS and OpenSource differences with this class
// so that we can either remove these methods or remove the PLATFORM(IOS)-guard.
@@ -77,7 +73,7 @@ bool DeviceMotionController::hasLastData()
return deviceMotionClient()->lastMotion();
}
-PassRefPtr<Event> DeviceMotionController::getLastEvent()
+RefPtr<Event> DeviceMotionController::getLastEvent()
{
return DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionClient()->lastMotion());
}
@@ -101,7 +97,7 @@ bool DeviceMotionController::isActiveAt(Page* page)
void provideDeviceMotionTo(Page* page, DeviceMotionClient* client)
{
- DeviceMotionController::provideTo(page, DeviceMotionController::supplementName(), DeviceMotionController::create(client));
+ DeviceMotionController::provideTo(page, DeviceMotionController::supplementName(), std::make_unique<DeviceMotionController>(client));
}
} // namespace WebCore