Commit 55ce3c4d authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa Committed by Commit Bot

sensors: Always assume Sensor::InitSensorProxyIfNeeded() succeeds.

r762075 ("ExecutionContext post-migration cleanup - mdoules/ q-s"), part
of the changes that moved ExecutionContext from Document to
LocalDOMWindow, removed the condition in InitSensorProxyIfNeeded() that
would cause it to have a nullptr |sensor_proxy_|.

Remove the check in Sensor::Activate(), but add a DCHECK to avoid
regressions.

Change-Id: If29238fb7772599a3a4636e25535c51669d5da11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421448
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809666}
parent 546bb0db
...@@ -263,11 +263,7 @@ void Sensor::Activate() { ...@@ -263,11 +263,7 @@ void Sensor::Activate() {
DCHECK_EQ(state_, SensorState::kActivating); DCHECK_EQ(state_, SensorState::kActivating);
InitSensorProxyIfNeeded(); InitSensorProxyIfNeeded();
if (!sensor_proxy_) { DCHECK(sensor_proxy_);
HandleError(DOMExceptionCode::kInvalidStateError,
"The Sensor is no longer associated to a frame.");
return;
}
if (sensor_proxy_->IsInitialized()) if (sensor_proxy_->IsInitialized())
RequestAddConfiguration(); RequestAddConfiguration();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment