diff options
-rw-r--r-- | chromium/content/browser/bluetooth/web_bluetooth_service_impl.cc | 10 | ||||
-rw-r--r-- | chromium/content/browser/bluetooth/web_bluetooth_service_impl.h | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/chromium/content/browser/bluetooth/web_bluetooth_service_impl.cc b/chromium/content/browser/bluetooth/web_bluetooth_service_impl.cc index b26cdf38400..edb28b7b3e7 100644 --- a/chromium/content/browser/bluetooth/web_bluetooth_service_impl.cc +++ b/chromium/content/browser/bluetooth/web_bluetooth_service_impl.cc @@ -84,7 +84,7 @@ constexpr char kScanClientNameRequestLeScan[] = "Web Bluetooth requestLeScan()"; // The renderer performs its own checks so a request that gets to the browser // process indicates some failure to check for fenced frames. const char kFencedFrameError[] = - "Use Web Bluetooth API is blocked in a fenced frame tree."; + "Use of Web Bluetooth API is blocked in a <fencedframe> tree."; blink::mojom::WebBluetoothResult TranslateGATTErrorAndRecord( GattErrorCode error_code, @@ -529,6 +529,14 @@ WebBluetoothServiceImpl* WebBluetoothServiceImpl::Create( return nullptr; } + if (render_frame_host->GetOutermostMainFrame() + ->GetLastCommittedOrigin() + .opaque()) { + mojo::ReportBadMessage( + "Web Bluetooth is not allowed from an opaque origin."); + return nullptr; + } + return new WebBluetoothServiceImpl(*render_frame_host, std::move(receiver)); } diff --git a/chromium/content/browser/bluetooth/web_bluetooth_service_impl.h b/chromium/content/browser/bluetooth/web_bluetooth_service_impl.h index 8cbb9ac0bf9..9d6a90d1c3c 100644 --- a/chromium/content/browser/bluetooth/web_bluetooth_service_impl.h +++ b/chromium/content/browser/bluetooth/web_bluetooth_service_impl.h @@ -57,7 +57,7 @@ bool HasValidFilter( std::vector<blink::mojom::WebBluetoothLeScanFilterPtr>>& filters); // Implementation of Mojo WebBluetoothService located in -// third_party/WebKit/public/platform/modules/bluetooth. +// third_party/blink/renderer/modules/bluetooth. // It handles Web Bluetooth API requests coming from Blink / renderer // process and uses the platform abstraction of device/bluetooth. // WebBluetoothServiceImpl is not thread-safe and should be created on the |