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

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

Issue 1389553002: bluetooth: Detect and fix incorrect thread usage of BluetoothDispatcherHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/bluetooth_dispatcher_host.h
diff --git a/content/browser/bluetooth/bluetooth_dispatcher_host.h b/content/browser/bluetooth/bluetooth_dispatcher_host.h
index cc6cd9d5cb21ad43b4cfe9e008f373a6053b5fd7..7ab6ce30f5b2908f8ace55941194270882143c46 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -187,6 +187,10 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
// sessions when other sessions are active.
base::Timer discovery_session_timer_;
+ // At least one WeakPtr must always exist to enforce all factoried WeakPtr
+ // objects are bound to UI thread.
+ base::WeakPtr<BluetoothDispatcherHost> weak_ptr_on_ui_thread_;
+
// Must be last member, see base/memory/weak_ptr.h documentation
base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698