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 decbede43c15dfcb8ab6af0e74e5d6360fa158d9..0d6cdea41cf0de1d9def37d7def28f264882b1c4 100644 |
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.cc |
@@ -171,6 +171,11 @@ BluetoothDispatcherHost::BluetoothDispatcherHost(int render_process_id) |
/*is_repeating=*/false), |
weak_ptr_factory_(this) { |
DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ // Bind all future weak pointers to the UI thread. |
+ weak_ptr_on_ui_thread_ = weak_ptr_factory_.GetWeakPtr(); |
+ weak_ptr_on_ui_thread_.get(); |
+ |
if (BluetoothAdapterFactory::IsBluetoothAdapterAvailable()) |
BluetoothAdapterFactory::GetAdapter( |
base::Bind(&BluetoothDispatcherHost::set_adapter, |