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

Unified Diff: content/browser/bluetooth/bluetooth_dispatcher_host.cc

Issue 1601323002: Use GetLastCommittedOrigin instead of GetLastCommittedURL in bluetooth chooser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed bluetooth test at: requestDevice.html Created 4 years, 11 months 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 | « chrome/browser/ui/browser.cc ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bluetooth/bluetooth_dispatcher_host.cc
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.cc b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
index deb626df075cda1a08b08e8fc27ee6164cdd1dbf..0d3385e268333cafdf71c8ee7d7138f8c60a88dd 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc
@@ -634,6 +634,14 @@ void BluetoothDispatcherHost::OnRequestDevice(
return;
}
+ if (render_frame_host->GetLastCommittedOrigin().unique()) {
+ VLOG(1) << "Request device with unique origin.";
+ Send(new BluetoothMsg_RequestDeviceError(
+ thread_id, request_id,
+ WebBluetoothError::RequestDeviceWithUniqueOrigin));
+ return;
+ }
+
if (!adapter_) {
VLOG(1) << "No BluetoothAdapter. Can't serve requestDevice.";
RecordRequestDeviceOutcome(UMARequestDeviceOutcome::NO_BLUETOOTH_ADAPTER);
@@ -673,9 +681,7 @@ void BluetoothDispatcherHost::OnRequestDevice(
if (WebContentsDelegate* delegate = web_contents->GetDelegate()) {
session->chooser = delegate->RunBluetoothChooser(
web_contents, chooser_event_handler,
- // TODO(ortuno): Replace with GetLastCommittedOrigin.
- // http://crbug.com/577451
- render_frame_host->GetLastCommittedURL().GetOrigin());
+ render_frame_host->GetLastCommittedOrigin());
}
}
if (!session->chooser) {
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698