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

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

Issue 2587733002: Specify TaskType of posted Task explicitly in Sensor API (11) (Closed)
Patch Set: Created 4 years 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/core/dom/TaskRunnerHelper.cpp ('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 6c3ecc113b0d9808d4f9b4e197c446d1a978b5bf..bfc7005d5625c043e136f565603c8a469c3041c8 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -7,6 +7,7 @@
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContextTask.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/inspector/ConsoleMessage.h"
#include "device/generic_sensor/public/interfaces/sensor.mojom-blink.h"
#include "modules/sensor/SensorErrorEvent.h"
@@ -266,7 +267,7 @@ void Sensor::onSensorUpdateNotification() {
if (getExecutionContext() &&
m_sensorProxy->sensorReading()->isReadingUpdated(m_storedData)) {
getExecutionContext()->postTask(
- BLINK_FROM_HERE,
+ TaskType::Sensor, BLINK_FROM_HERE,
createSameThreadTask(&Sensor::notifySensorReadingChanged,
wrapWeakPersistent(this)));
}
@@ -281,8 +282,9 @@ void Sensor::updateState(Sensor::SensorState newState) {
if (newState == SensorState::Activated && getExecutionContext()) {
DCHECK_EQ(SensorState::Activating, m_state);
getExecutionContext()->postTask(
- BLINK_FROM_HERE, createSameThreadTask(&Sensor::notifyOnActivate,
- wrapWeakPersistent(this)));
+ TaskType::Sensor, BLINK_FROM_HERE,
+ createSameThreadTask(&Sensor::notifyOnActivate,
+ wrapWeakPersistent(this)));
}
m_state = newState;
@@ -296,7 +298,7 @@ void Sensor::reportError(ExceptionCode code,
auto error =
DOMException::create(code, sanitizedMessage, unsanitizedMessage);
getExecutionContext()->postTask(
- BLINK_FROM_HERE,
+ TaskType::Sensor, BLINK_FROM_HERE,
createSameThreadTask(&Sensor::notifyError, wrapWeakPersistent(this),
wrapPersistent(error)));
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698