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

Unified Diff: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp

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, 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp
diff --git a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp
index c65b21a9fce927b42b4f3bff511c056b7df85362..4583e190db37a5e800c956f8fb196b361d3013fb 100644
--- a/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp
+++ b/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp
@@ -33,7 +33,7 @@ DeviceOrientationData* DeviceOrientationData::create()
return new DeviceOrientationData;
}
-DeviceOrientationData* DeviceOrientationData::create(const Nullable<double>& alpha, const Nullable<double>& beta, const Nullable<double>& gamma, const Nullable<bool>& absolute)
+DeviceOrientationData* DeviceOrientationData::create(const Nullable<double>& alpha, const Nullable<double>& beta, const Nullable<double>& gamma, bool absolute)
{
return new DeviceOrientationData(alpha, beta, gamma, absolute);
}
@@ -43,23 +43,20 @@ DeviceOrientationData* DeviceOrientationData::create(const WebDeviceOrientationD
Nullable<double> alpha;
Nullable<double> beta;
Nullable<double> gamma;
- Nullable<bool> absolute;
if (data.hasAlpha)
alpha = data.alpha;
if (data.hasBeta)
beta = data.beta;
if (data.hasGamma)
gamma = data.gamma;
- if (data.hasAbsolute)
- absolute = data.absolute;
- return DeviceOrientationData::create(alpha, beta, gamma, absolute);
+ return DeviceOrientationData::create(alpha, beta, gamma, data.absolute);
}
DeviceOrientationData::DeviceOrientationData()
{
}
-DeviceOrientationData::DeviceOrientationData(const Nullable<double>& alpha, const Nullable<double>& beta, const Nullable<double>& gamma, const Nullable<bool>& absolute)
+DeviceOrientationData::DeviceOrientationData(const Nullable<double>& alpha, const Nullable<double>& beta, const Nullable<double>& gamma, bool absolute)
: m_alpha(alpha)
, m_beta(beta)
, m_gamma(gamma)
@@ -84,7 +81,7 @@ double DeviceOrientationData::gamma() const
bool DeviceOrientationData::absolute() const
{
- return m_absolute.get();
+ return m_absolute;
}
bool DeviceOrientationData::canProvideAlpha() const
@@ -102,11 +99,6 @@ bool DeviceOrientationData::canProvideGamma() const
return !m_gamma.isNull();
}
-bool DeviceOrientationData::canProvideAbsolute() const
-{
- return !m_absolute.isNull();
-}
-
bool DeviceOrientationData::canProvideEventData() const
{
return canProvideAlpha() || canProvideBeta() || canProvideGamma();

Powered by Google App Engine
This is Rietveld 408576698