Commit c677e6c6 authored by Doug Turner's avatar Doug Turner Committed by Commit Bot

WebBluetooth Scanning - DCHECK if ExecutionContext is null.

Bug: 897312
Change-Id: I3f156092b1d5687fce06ef05b2f6cf4db1d9ba32
Reviewed-on: https://chromium-review.googlesource.com/c/1388809
Commit-Queue: Doug Turner <dougt@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619741}
parent f0875d12
...@@ -246,6 +246,7 @@ ScriptPromise Bluetooth::requestLEScan(ScriptState* script_state, ...@@ -246,6 +246,7 @@ ScriptPromise Bluetooth::requestLEScan(ScriptState* script_state,
const BluetoothLEScanOptions* options, const BluetoothLEScanOptions* options,
ExceptionState& exception_state) { ExceptionState& exception_state) {
ExecutionContext* context = ExecutionContext::From(script_state); ExecutionContext* context = ExecutionContext::From(script_state);
DCHECK(context);
// Remind developers when they are using Web Bluetooth on unsupported // Remind developers when they are using Web Bluetooth on unsupported
// platforms. // platforms.
...@@ -303,9 +304,11 @@ ScriptPromise Bluetooth::requestLEScan(ScriptState* script_state, ...@@ -303,9 +304,11 @@ ScriptPromise Bluetooth::requestLEScan(ScriptState* script_state,
} }
void Bluetooth::ScanEvent(mojom::blink::WebBluetoothScanResultPtr result) { void Bluetooth::ScanEvent(mojom::blink::WebBluetoothScanResultPtr result) {
ExecutionContext* content = ContextLifecycleObserver::GetExecutionContext(); ExecutionContext* context = ContextLifecycleObserver::GetExecutionContext();
DCHECK(context);
BluetoothDevice* bluetooth_device = BluetoothDevice* bluetooth_device =
GetBluetoothDeviceRepresentingDevice(std::move(result->device), content); GetBluetoothDeviceRepresentingDevice(std::move(result->device), context);
HeapVector<blink::StringOrUnsignedLong> uuids; HeapVector<blink::StringOrUnsignedLong> uuids;
for (const String& uuid : result->uuids) { for (const String& uuid : result->uuids) {
......
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