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

Side by Side Diff: content/browser/device_orientation/device_orientation_message_filter.cc

Issue 165333004: Revert "Allow MessageFilters to restrict listening to specific message classes" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/device_orientation/device_orientation_message_filter.h " 5 #include "content/browser/device_orientation/device_orientation_message_filter.h "
6 6
7 #include "content/browser/device_orientation/device_inertial_sensor_service.h" 7 #include "content/browser/device_orientation/device_inertial_sensor_service.h"
8 #include "content/common/device_orientation/device_orientation_messages.h" 8 #include "content/common/device_orientation/device_orientation_messages.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 DeviceOrientationMessageFilter::DeviceOrientationMessageFilter() 12 DeviceOrientationMessageFilter::DeviceOrientationMessageFilter()
13 : BrowserMessageFilter(DeviceOrientationMsgStart), 13 : is_started_(false) {
14 is_started_(false) {
15 } 14 }
16 15
17 DeviceOrientationMessageFilter::~DeviceOrientationMessageFilter() { 16 DeviceOrientationMessageFilter::~DeviceOrientationMessageFilter() {
18 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 17 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
19 if (is_started_) 18 if (is_started_)
20 DeviceInertialSensorService::GetInstance()->RemoveConsumer( 19 DeviceInertialSensorService::GetInstance()->RemoveConsumer(
21 CONSUMER_TYPE_ORIENTATION); 20 CONSUMER_TYPE_ORIENTATION);
22 } 21 }
23 22
24 bool DeviceOrientationMessageFilter::OnMessageReceived( 23 bool DeviceOrientationMessageFilter::OnMessageReceived(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 57
59 void DeviceOrientationMessageFilter::DidStartDeviceOrientationPolling() { 58 void DeviceOrientationMessageFilter::DidStartDeviceOrientationPolling() {
60 Send(new DeviceOrientationMsg_DidStartPolling( 59 Send(new DeviceOrientationMsg_DidStartPolling(
61 DeviceInertialSensorService::GetInstance()-> 60 DeviceInertialSensorService::GetInstance()->
62 GetSharedMemoryHandleForProcess( 61 GetSharedMemoryHandleForProcess(
63 CONSUMER_TYPE_ORIENTATION, 62 CONSUMER_TYPE_ORIENTATION,
64 PeerHandle()))); 63 PeerHandle())));
65 } 64 }
66 65
67 } // namespace content 66 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698