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

Unified Diff: content/renderer/device_sensors/device_light_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: 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_light_event_pump.cc
diff --git a/content/renderer/device_sensors/device_light_event_pump.cc b/content/renderer/device_sensors/device_light_event_pump.cc
index 53567441df879f54439b7b8d5527e6b12f2df0f8..d001048635379af140e74ddb9405a14c041d36e0 100644
--- a/content/renderer/device_sensors/device_light_event_pump.cc
+++ b/content/renderer/device_sensors/device_light_event_pump.cc
@@ -5,7 +5,6 @@
#include "content/renderer/device_sensors/device_light_event_pump.h"
#include "base/time/time.h"
-#include "content/common/device_sensors/device_light_messages.h"
#include "content/public/renderer/render_thread.h"
#include "third_party/WebKit/public/platform/WebDeviceLightListener.h"
@@ -19,7 +18,9 @@ const int kDefaultLightPumpDelayMicroseconds =
namespace content {
DeviceLightEventPump::DeviceLightEventPump(RenderThread* thread)
- : DeviceSensorEventPump<blink::WebDeviceLightListener>(thread),
+ : DeviceMojoClientMixin<
+ DeviceSensorEventPump<blink::WebDeviceLightListener>,
+ device::mojom::LightSensor>(thread),
last_seen_data_(-1) {
pump_delay_microseconds_ = kDefaultLightPumpDelayMicroseconds;
}
@@ -27,16 +28,6 @@ DeviceLightEventPump::DeviceLightEventPump(RenderThread* thread)
DeviceLightEventPump::~DeviceLightEventPump() {
}
-bool DeviceLightEventPump::OnControlMessageReceived(
- const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(DeviceLightEventPump, message)
- IPC_MESSAGE_HANDLER(DeviceLightMsg_DidStartPolling, OnDidStart)
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
void DeviceLightEventPump::FireEvent() {
DCHECK(listener());
DeviceLightData data;
@@ -64,15 +55,6 @@ bool DeviceLightEventPump::InitializeReader(base::SharedMemoryHandle handle) {
return reader_->Initialize(handle);
}
-void DeviceLightEventPump::SendStartMessage() {
- RenderThread::Get()->Send(new DeviceLightHostMsg_StartPolling());
-}
-
-void DeviceLightEventPump::SendStopMessage() {
- last_seen_data_ = -1;
- RenderThread::Get()->Send(new DeviceLightHostMsg_StopPolling());
-}
-
void DeviceLightEventPump::SendFakeDataForTesting(void* fake_data) {
double data = *static_cast<double*>(fake_data);

Powered by Google App Engine
This is Rietveld 408576698