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

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

Issue 1737443002: Make DeviceOrientationEvent.prototype.absolute non-nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address feedback Created 4 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <GuidDef.h> 7 #include <GuidDef.h>
8 #include <InitGuid.h> 8 #include <InitGuid.h>
9 #include <PortableDeviceTypes.h> 9 #include <PortableDeviceTypes.h>
10 #include <Sensors.h> 10 #include <Sensors.h>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 &has_gamma); 122 &has_gamma);
123 123
124 if (buffer_) { 124 if (buffer_) {
125 buffer_->seqlock.WriteBegin(); 125 buffer_->seqlock.WriteBegin();
126 buffer_->data.alpha = alpha; 126 buffer_->data.alpha = alpha;
127 buffer_->data.hasAlpha = has_alpha; 127 buffer_->data.hasAlpha = has_alpha;
128 buffer_->data.beta = beta; 128 buffer_->data.beta = beta;
129 buffer_->data.hasBeta = has_beta; 129 buffer_->data.hasBeta = has_beta;
130 buffer_->data.gamma = gamma; 130 buffer_->data.gamma = gamma;
131 buffer_->data.hasGamma = has_gamma; 131 buffer_->data.hasGamma = has_gamma;
132 buffer_->data.absolute = true; 132 buffer_->data.absolute = has_alpha || has_beta || has_gamma;
133 buffer_->data.hasAbsolute = has_alpha || has_beta || has_gamma;
134 buffer_->data.allAvailableSensorsAreActive = true; 133 buffer_->data.allAvailableSensorsAreActive = true;
135 buffer_->seqlock.WriteEnd(); 134 buffer_->seqlock.WriteEnd();
136 } 135 }
137 136
138 return true; 137 return true;
139 } 138 }
140 139
141 private: 140 private:
142 DeviceOrientationHardwareBuffer* const buffer_; 141 DeviceOrientationHardwareBuffer* const buffer_;
143 142
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 motion_buffer_->data.allAvailableSensorsAreActive = enabled; 465 motion_buffer_->data.allAvailableSensorsAreActive = enabled;
467 motion_buffer_->seqlock.WriteEnd(); 466 motion_buffer_->seqlock.WriteEnd();
468 } 467 }
469 break; 468 break;
470 default: 469 default:
471 NOTREACHED(); 470 NOTREACHED();
472 } 471 }
473 } 472 }
474 473
475 } // namespace content 474 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698