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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h

Issue 2268403006: Use background thread for AsyncAudioDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing nits after l-g-t-m Created 4 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 | third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h
diff --git a/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h b/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h
index 2d2c301d912a7a31a69b1684dee33353bbeb20f6..490b0a7bc47f3c93e38a1586d0ab22ac0e8c2c80 100644
--- a/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h
+++ b/third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.h
@@ -26,7 +26,6 @@
#define AsyncAudioDecoder_h
#include "platform/heap/Handle.h"
-#include "public/platform/WebThread.h"
#include "wtf/build_config.h"
#include <memory>
@@ -39,15 +38,17 @@ class AudioBus;
class DOMArrayBuffer;
class ScriptPromiseResolver;
-// AsyncAudioDecoder asynchronously decodes audio file data from a DOMArrayBuffer in a worker thread.
-// Upon successful decoding, a completion callback will be invoked with the decoded PCM data in an AudioBuffer.
+// AsyncAudioDecoder asynchronously decodes audio file data from a
+// DOMArrayBuffer in the background thread. Upon successful decoding, a
+// completion callback will be invoked with the decoded PCM data in an
+// AudioBuffer.
class AsyncAudioDecoder {
DISALLOW_NEW();
WTF_MAKE_NONCOPYABLE(AsyncAudioDecoder);
public:
- AsyncAudioDecoder();
- ~AsyncAudioDecoder();
+ AsyncAudioDecoder() { };
+ ~AsyncAudioDecoder() { };
// Must be called on the main thread. |decodeAsync| and callees must not modify any of the
// parameters except |audioData|. They are used to associate this decoding instance with the
@@ -56,10 +57,8 @@ public:
private:
AudioBuffer* createAudioBufferFromAudioBus(AudioBus*);
- static void decode(DOMArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResolver*, BaseAudioContext*);
+ static void decodeOnBackgroundThread(DOMArrayBuffer* audioData, float sampleRate, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback, ScriptPromiseResolver*, BaseAudioContext*);
static void notifyComplete(DOMArrayBuffer* audioData, AudioBufferCallback* successCallback, AudioBufferCallback* errorCallback, AudioBus*, ScriptPromiseResolver*, BaseAudioContext*);
-
- std::unique_ptr<WebThread> m_thread;
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AsyncAudioDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698