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

Unified Diff: content/browser/device_sensors/device_sensor_message_filter.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/browser/device_sensors/device_sensor_message_filter.cc
diff --git a/content/browser/device_sensors/device_sensor_message_filter.cc b/content/browser/device_sensors/device_sensor_message_filter.cc
deleted file mode 100644
index cb9e9e592a44005de2fe5110721dcfafa44cfb45..0000000000000000000000000000000000000000
--- a/content/browser/device_sensors/device_sensor_message_filter.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/device_sensors/device_sensor_message_filter.h"
-
-#include "content/browser/device_sensors/device_inertial_sensor_service.h"
-
-namespace content {
-
-DeviceSensorMessageFilter::DeviceSensorMessageFilter(
- ConsumerType consumer_type, uint32_t message_class_to_filter)
- : BrowserMessageFilter(message_class_to_filter),
- consumer_type_(consumer_type),
- is_started_(false) {
-}
-
-DeviceSensorMessageFilter::~DeviceSensorMessageFilter() {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- if (is_started_)
- DeviceInertialSensorService::GetInstance()->RemoveConsumer(consumer_type_);
-}
-
-void DeviceSensorMessageFilter::OnStartPolling() {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- DCHECK(!is_started_);
- if (is_started_)
- return;
- is_started_ = true;
- DeviceInertialSensorService::GetInstance()->AddConsumer(consumer_type_);
- DidStartPolling(DeviceInertialSensorService::GetInstance()->
- GetSharedMemoryHandleForProcess(consumer_type_, PeerHandle()));
-}
-
-void DeviceSensorMessageFilter::OnStopPolling() {
- DCHECK_CURRENTLY_ON(BrowserThread::IO);
- DCHECK(is_started_);
- if (!is_started_)
- return;
- is_started_ = false;
- DeviceInertialSensorService::GetInstance()->RemoveConsumer(consumer_type_);
-}
-
-} // namespace content

Powered by Google App Engine
This is Rietveld 408576698