| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index a765509ab267c2910635e57728031b46d1b37006..4e2628b2098388566b48958c0728165ece8280a2 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -1221,23 +1221,6 @@ void WebContentsImpl::SetAudioMuted(bool mute) {
|
| NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| }
|
|
|
| -void WebContentsImpl::IncrementBluetoothConnectedDeviceCount() {
|
| - // Notify for UI updates if the state changes.
|
| - bluetooth_connected_device_count_++;
|
| - if (bluetooth_connected_device_count_ == 1) {
|
| - NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| - }
|
| -}
|
| -
|
| -void WebContentsImpl::DecrementBluetoothConnectedDeviceCount() {
|
| - // Notify for UI updates if the state changes.
|
| - DCHECK(bluetooth_connected_device_count_ != 0);
|
| - bluetooth_connected_device_count_--;
|
| - if (bluetooth_connected_device_count_ == 0) {
|
| - NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| - }
|
| -}
|
| -
|
| bool WebContentsImpl::IsConnectedToBluetoothDevice() const {
|
| return bluetooth_connected_device_count_ > 0;
|
| }
|
| @@ -5056,6 +5039,33 @@ void WebContentsImpl::NotifyFindReply(int request_id,
|
| }
|
| }
|
|
|
| +void WebContentsImpl::IncrementBluetoothConnectedDeviceCount() {
|
| + // Trying to invalidate the tab state while being destroyed could result in a
|
| + // use after free.
|
| + if (IsBeingDestroyed()) {
|
| + return;
|
| + }
|
| + // Notify for UI updates if the state changes.
|
| + bluetooth_connected_device_count_++;
|
| + if (bluetooth_connected_device_count_ == 1) {
|
| + NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| + }
|
| +}
|
| +
|
| +void WebContentsImpl::DecrementBluetoothConnectedDeviceCount() {
|
| + // Trying to invalidate the tab state while being destroyed could result in a
|
| + // use after free.
|
| + if (IsBeingDestroyed()) {
|
| + return;
|
| + }
|
| + // Notify for UI updates if the state changes.
|
| + DCHECK(bluetooth_connected_device_count_ != 0);
|
| + bluetooth_connected_device_count_--;
|
| + if (bluetooth_connected_device_count_ == 0) {
|
| + NotifyNavigationStateChanged(INVALIDATE_TYPE_TAB);
|
| + }
|
| +}
|
| +
|
| #if defined(OS_ANDROID)
|
| void WebContentsImpl::NotifyFindMatchRectsReply(
|
| int version,
|
|
|