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

Unified Diff: third_party/WebKit/Source/modules/sensor/Sensor.cpp

Issue 2524953002: [Sensors] The sensor state changes from "active" to "activated" (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/sensor/Sensor.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
index eba2fe561ec660c853ecb755da4c3effa6826912..f5da38b02f57686fb41ee8875758cc859c39f1a8 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -99,8 +99,8 @@ static String ToString(Sensor::SensorState state) {
return "idle";
case Sensor::SensorState::Activating:
return "activating";
- case Sensor::SensorState::Active:
- return "active";
+ case Sensor::SensorState::Activated:
+ return "activated";
case Sensor::SensorState::Errored:
return "errored";
default:
@@ -115,7 +115,7 @@ String Sensor::state() const {
}
SensorReading* Sensor::reading() const {
- if (m_state != Sensor::SensorState::Active)
+ if (m_state != Sensor::SensorState::Activated)
return nullptr;
DCHECK(m_sensorProxy);
return m_sensorProxy->sensorReading();
@@ -170,7 +170,7 @@ void Sensor::initSensorProxyIfNeeded() {
}
void Sensor::contextDestroyed() {
- if (m_state == Sensor::SensorState::Active ||
+ if (m_state == Sensor::SensorState::Activated ||
m_state == Sensor::SensorState::Activating)
stopListening();
}
@@ -183,7 +183,7 @@ void Sensor::onSensorInitialized() {
}
void Sensor::onSensorReadingChanged() {
- if (m_state == Sensor::SensorState::Active) {
+ if (m_state == Sensor::SensorState::Activated) {
DCHECK(m_sensorUpdateNotifier);
m_sensorUpdateNotifier->onSensorReadingChanged();
}
@@ -215,7 +215,7 @@ void Sensor::onStartRequestCompleted(bool result) {
DCHECK_GT(m_configuration->frequency, 0);
m_sensorUpdateNotifier = SensorUpdateNotificationStrategy::create(
m_configuration->frequency, std::move(updateCallback));
- updateState(Sensor::SensorState::Active);
+ updateState(Sensor::SensorState::Activated);
}
void Sensor::startListening() {
@@ -256,7 +256,7 @@ void Sensor::stopListening() {
}
void Sensor::onSensorUpdateNotification() {
- if (m_state != Sensor::SensorState::Active)
+ if (m_state != Sensor::SensorState::Activated)
return;
DCHECK(m_sensorProxy);
@@ -278,7 +278,7 @@ void Sensor::updateState(Sensor::SensorState newState) {
if (newState == m_state)
return;
- if (newState == SensorState::Active && getExecutionContext()) {
+ if (newState == SensorState::Activated && getExecutionContext()) {
DCHECK_EQ(SensorState::Activating, m_state);
getExecutionContext()->postTask(
BLINK_FROM_HERE, createSameThreadTask(&Sensor::notifyOnActivate,
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698