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

Unified Diff: chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h

Issue 24325002: Fix threading bug in the brlapi braille controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 7 years, 3 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 | chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
diff --git a/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h b/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
index ff8cf3add78768a216a2c833de7882b03882b208..20fbf9d9aec57a60d97d79dfecaecd3882764f86 100644
--- a/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
+++ b/chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.h
@@ -52,7 +52,9 @@ class BrailleControllerImpl : public BrailleController {
// Tries to connect and starts watching for new brlapi servers.
// No-op if already called.
void StartConnecting();
- void OnSocketDirChanged(const base::FilePath& path, bool error);
+ void StartWatchingSocketDirOnFileThread();
+ void OnSocketDirChangedOnFileThread(const base::FilePath& path, bool error);
+ void OnSocketDirChangedOnIOThread();
void TryToConnect();
void ResetRetryConnectHorizon();
void ScheduleTryToConnect();
@@ -63,12 +65,11 @@ class BrailleControllerImpl : public BrailleController {
void DispatchKeyEvent(scoped_ptr<KeyEvent> event);
void DispatchOnDisplayStateChanged(scoped_ptr<DisplayState> new_state);
- LibBrlapiLoader libbrlapi_loader_;
CreateBrlapiConnectionFunction create_brlapi_connection_function_;
// Manipulated on the IO thread.
+ LibBrlapiLoader libbrlapi_loader_;
scoped_ptr<BrlapiConnection> connection_;
- base::FilePathWatcher file_path_watcher_;
bool started_connecting_;
bool connect_scheduled_;
base::Time retry_connect_horizon_;
@@ -76,6 +77,9 @@ class BrailleControllerImpl : public BrailleController {
// Manipulated on the UI thread.
ObserverList<BrailleObserver> observers_;
+ // Manipulated on the FILE thread.
+ base::FilePathWatcher file_path_watcher_;
+
friend struct DefaultSingletonTraits<BrailleControllerImpl>;
DISALLOW_COPY_AND_ASSIGN(BrailleControllerImpl);
« no previous file with comments | « no previous file | chrome/browser/extensions/api/braille_display_private/braille_controller_brlapi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698