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

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: DCHECK_CURRENTLY_ON(BrowserThread::UI); 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
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8a8714f17bf49c1a84d065a7ba5dfe001ec64d03 100644
--- a/content/browser/bluetooth/bluetooth_dispatcher_host.h
+++ b/content/browser/bluetooth/bluetooth_dispatcher_host.h
@@ -187,7 +187,10 @@ class CONTENT_EXPORT BluetoothDispatcherHost final
// sessions when other sessions are active.
base::Timer discovery_session_timer_;
- // Must be last member, see base/memory/weak_ptr.h documentation
+ // |weak_ptr_on_ui_thread_| provides weak pointers, e.g. for callbacks, and
+ // because it exists and has been bound to the UI thread enforces that all
+ // copies verify they are also used on the UI thread.
+ base::WeakPtr<BluetoothDispatcherHost> weak_ptr_on_ui_thread_;
base::WeakPtrFactory<BluetoothDispatcherHost> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(BluetoothDispatcherHost);
« no previous file with comments | « no previous file | content/browser/bluetooth/bluetooth_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698