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

Unified Diff: third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h

Issue 2154473003: Simplify locking in HRTFDatabaseLoader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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: third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h
diff --git a/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h b/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h
index bf8ec64e0df305027dde98a880216f757f247a7f..b57798c9b302e23ff56a05f596813a2130b133ac 100644
--- a/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h
+++ b/third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.h
@@ -53,13 +53,16 @@ public:
// Both constructor and destructor must be called from the main thread.
~HRTFDatabaseLoader();
- // Returns true once the default database has been completely loaded.
- bool isLoaded();
+ // Returns true once the default database has been completely loaded. This
+ // must be called from the audio thread.
+ bool isLoaded() { return database(); }
// waitForLoaderThreadCompletion() may be called more than once and is thread-safe.
void waitForLoaderThreadCompletion();
- HRTFDatabase* database() { return m_hrtfDatabase.get(); }
+ // Returns the database or nullptr if the database doesn't yet exist. Must
+ // be called from the audio thread.
+ HRTFDatabase* database() const;
float databaseSampleRate() const { return m_databaseSampleRate; }

Powered by Google App Engine
This is Rietveld 408576698