Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(717)

Unified Diff: content/renderer/device_sensors/device_motion_event_pump.cc

Issue 2037513002: Convert device_sensors to use mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@conversion--mime-registry
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/device_sensors/device_motion_event_pump.cc
diff --git a/content/renderer/device_sensors/device_motion_event_pump.cc b/content/renderer/device_sensors/device_motion_event_pump.cc
index 860cf68e2f16fb18b13f6d794e047f229991d468..d8b4f1790575ec0f35b4dad5bfcde05a31c73290 100644
--- a/content/renderer/device_sensors/device_motion_event_pump.cc
+++ b/content/renderer/device_sensors/device_motion_event_pump.cc
@@ -4,29 +4,19 @@
#include "device_motion_event_pump.h"
-#include "content/common/device_sensors/device_motion_messages.h"
#include "content/public/renderer/render_thread.h"
#include "third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionListener.h"
namespace content {
DeviceMotionEventPump::DeviceMotionEventPump(RenderThread* thread)
- : DeviceSensorEventPump<blink::WebDeviceMotionListener>(thread) {
-}
+ : DeviceSensorMojoClientMixin<
+ DeviceSensorEventPump<blink::WebDeviceMotionListener>,
+ device::mojom::MotionSensor>(thread) {}
DeviceMotionEventPump::~DeviceMotionEventPump() {
}
-bool DeviceMotionEventPump::OnControlMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(DeviceMotionEventPump, message)
- IPC_MESSAGE_HANDLER(DeviceMotionMsg_DidStartPolling, OnDidStart)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
void DeviceMotionEventPump::FireEvent() {
DCHECK(listener());
blink::WebDeviceMotionData data;
@@ -40,14 +30,6 @@ bool DeviceMotionEventPump::InitializeReader(base::SharedMemoryHandle handle) {
return reader_->Initialize(handle);
}
-void DeviceMotionEventPump::SendStartMessage() {
- RenderThread::Get()->Send(new DeviceMotionHostMsg_StartPolling());
-}
-
-void DeviceMotionEventPump::SendStopMessage() {
- RenderThread::Get()->Send(new DeviceMotionHostMsg_StopPolling());
-}
-
void DeviceMotionEventPump::SendFakeDataForTesting(void* fake_data) {
blink::WebDeviceMotionData data =
*static_cast<blink::WebDeviceMotionData*>(fake_data);

Powered by Google App Engine
This is Rietveld 408576698