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

Unified Diff: Source/platform/audio/HRTFDatabaseLoader.cpp

Issue 1303153005: Introduce WebTaskRunner Patch 3/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
Index: Source/platform/audio/HRTFDatabaseLoader.cpp
diff --git a/Source/platform/audio/HRTFDatabaseLoader.cpp b/Source/platform/audio/HRTFDatabaseLoader.cpp
index dc1e083e0538398731e9c91d54db583114f23549..2ad9871a8b3bbda0a9d48eb945cb63f962ef5c98 100644
--- a/Source/platform/audio/HRTFDatabaseLoader.cpp
+++ b/Source/platform/audio/HRTFDatabaseLoader.cpp
@@ -99,7 +99,8 @@ void HRTFDatabaseLoader::loadAsynchronously()
if (!m_hrtfDatabase && !m_thread) {
// Start the asynchronous database loading process.
m_thread = adoptPtr(Platform::current()->createThread("HRTF database loader"));
- m_thread->postTask(FROM_HERE, new Task(threadSafeBind(&HRTFDatabaseLoader::loadTask, AllowCrossThreadAccess(this))));
+ // TODO(alexclarke): Should this be posted as a loading task?
+ m_thread->defaultTaskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&HRTFDatabaseLoader::loadTask, AllowCrossThreadAccess(this))));
}
}
@@ -122,7 +123,8 @@ void HRTFDatabaseLoader::waitForLoaderThreadCompletion()
return;
TaskSynchronizer sync;
- m_thread->postTask(FROM_HERE, new Task(threadSafeBind(&HRTFDatabaseLoader::cleanupTask, AllowCrossThreadAccess(this), AllowCrossThreadAccess(&sync))));
+ // TODO(alexclarke): Should this be posted as a loading task?
+ m_thread->defaultTaskRunner()->postTask(FROM_HERE, new Task(threadSafeBind(&HRTFDatabaseLoader::cleanupTask, AllowCrossThreadAccess(this), AllowCrossThreadAccess(&sync))));
sync.waitForTaskCompletion();
m_thread.clear();
}

Powered by Google App Engine
This is Rietveld 408576698