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

Side by Side Diff: content/browser/device_sensors/data_fetcher_shared_memory_chromeos.cc

Issue 1947963003: Make deviceorientationabsolute confrom with spec on Chromium OS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_sensors/data_fetcher_shared_memory.h" 5 #include "content/browser/device_sensors/data_fetcher_shared_memory.h"
6 6
7 #include "content/browser/device_sensors/sensor_manager_chromeos.h" 7 #include "content/browser/device_sensors/sensor_manager_chromeos.h"
8 8
9 namespace content { 9 namespace content {
10 10
(...skipping 10 matching lines...) Expand all
21 21
22 switch (consumer_type) { 22 switch (consumer_type) {
23 case CONSUMER_TYPE_MOTION: 23 case CONSUMER_TYPE_MOTION:
24 sensor_manager_->StartFetchingDeviceMotionData( 24 sensor_manager_->StartFetchingDeviceMotionData(
25 static_cast<DeviceMotionHardwareBuffer*>(buffer)); 25 static_cast<DeviceMotionHardwareBuffer*>(buffer));
26 return true; 26 return true;
27 case CONSUMER_TYPE_ORIENTATION: 27 case CONSUMER_TYPE_ORIENTATION:
28 sensor_manager_->StartFetchingDeviceOrientationData( 28 sensor_manager_->StartFetchingDeviceOrientationData(
29 static_cast<DeviceOrientationHardwareBuffer*>(buffer)); 29 static_cast<DeviceOrientationHardwareBuffer*>(buffer));
30 return true; 30 return true;
31 case CONSUMER_TYPE_ORIENTATION_ABSOLUTE: 31 case CONSUMER_TYPE_ORIENTATION_ABSOLUTE: {
32 DeviceOrientationHardwareBuffer* orientation_absolute_buffer =
33 static_cast<DeviceOrientationHardwareBuffer*>(buffer);
34 // Absolute device orientation not available on Chrome OS, let the
35 // implementation fire an all-null event to signal this to blink.
36 orientation_absolute_buffer->seqlock.WriteBegin();
timvolodine 2016/05/06 15:10:41 think it would be good to also set data.absolute =
jonross 2016/05/06 17:57:43 Done.
37 orientation_absolute_buffer->data.allAvailableSensorsAreActive = true;
38 orientation_absolute_buffer->seqlock.WriteEnd();
39 return false;
40 }
32 case CONSUMER_TYPE_LIGHT: 41 case CONSUMER_TYPE_LIGHT:
33 NOTIMPLEMENTED(); 42 NOTIMPLEMENTED();
34 return false; 43 return false;
35 } 44 }
36 NOTREACHED(); 45 NOTREACHED();
37 return false; 46 return false;
38 } 47 }
39 48
40 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) { 49 bool DataFetcherSharedMemory::Stop(ConsumerType consumer_type) {
41 switch (consumer_type) { 50 switch (consumer_type) {
42 case CONSUMER_TYPE_MOTION: 51 case CONSUMER_TYPE_MOTION:
43 return sensor_manager_->StopFetchingDeviceMotionData(); 52 return sensor_manager_->StopFetchingDeviceMotionData();
44 case CONSUMER_TYPE_ORIENTATION: 53 case CONSUMER_TYPE_ORIENTATION:
45 return sensor_manager_->StopFetchingDeviceOrientationData(); 54 return sensor_manager_->StopFetchingDeviceOrientationData();
46 case CONSUMER_TYPE_ORIENTATION_ABSOLUTE: 55 case CONSUMER_TYPE_ORIENTATION_ABSOLUTE:
timvolodine 2016/05/06 15:10:41 best to have some 'clean-up' code here as well
jonross 2016/05/06 17:57:43 Good call. Done.
47 case CONSUMER_TYPE_LIGHT: 56 case CONSUMER_TYPE_LIGHT:
48 NOTIMPLEMENTED(); 57 NOTIMPLEMENTED();
49 return false; 58 return false;
50 } 59 }
51 NOTREACHED(); 60 NOTREACHED();
52 return false; 61 return false;
53 } 62 }
54 63
55 } // namespace content 64 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698