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

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

Issue 2038843003: bluetooth: Don't call methods of WebContentsImpl while it's being destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix dcheck Created 4 years, 6 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
Index: content/browser/bluetooth/frame_connected_bluetooth_devices.cc
diff --git a/content/browser/bluetooth/frame_connected_bluetooth_devices.cc b/content/browser/bluetooth/frame_connected_bluetooth_devices.cc
index 164579237b6effafeca34e8bc7e1296ca12b4133..d0b1c694e243e6acdae72433c9d6960f262d7992 100644
--- a/content/browser/bluetooth/frame_connected_bluetooth_devices.cc
+++ b/content/browser/bluetooth/frame_connected_bluetooth_devices.cc
@@ -99,10 +99,16 @@ std::string FrameConnectedBluetoothDevices::CloseConnectionToDeviceWithAddress(
}
void FrameConnectedBluetoothDevices::IncrementDevicesConnectedCount() {
+ // There are no cases in which IncrementDevicesConnectedCount could be
+ // called while WebContentsImpl's destructor is running.
+ DCHECK(!web_contents_impl_->IsBeingDestroyed());
Jeffrey Yasskin 2016/06/06 16:55:36 Because this has security implications, make it a
ortuno 2016/06/06 18:25:16 Done.
web_contents_impl_->IncrementBluetoothConnectedDeviceCount();
}
void FrameConnectedBluetoothDevices::DecrementDevicesConnectedCount() {
+ if (web_contents_impl_->IsBeingDestroyed()) {
Jeffrey Yasskin 2016/06/06 16:55:36 Would it make more sense to put this check in WebC
ortuno 2016/06/06 18:25:16 I think so. Done.
+ return;
+ }
web_contents_impl_->DecrementBluetoothConnectedDeviceCount();
}

Powered by Google App Engine
This is Rietveld 408576698