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

Unified Diff: content/renderer/pepper/pepper_media_stream_audio_track_host.h

Issue 430943004: Return from |Configure()| asynchronously, and allow |InitBuffers()| to return errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pepper-mediastream-duration
Patch Set: Created 6 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: content/renderer/pepper/pepper_media_stream_audio_track_host.h
diff --git a/content/renderer/pepper/pepper_media_stream_audio_track_host.h b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
index 4104128839a292b41cafe48f4c5059cdf7068333..81fd8112dbc99c0c3290719b6eb25c6fb5ceab2d 100644
--- a/content/renderer/pepper/pepper_media_stream_audio_track_host.h
+++ b/content/renderer/pepper/pepper_media_stream_audio_track_host.h
@@ -15,6 +15,7 @@
#include "content/public/renderer/media_stream_audio_sink.h"
#include "content/renderer/pepper/pepper_media_stream_track_host_base.h"
#include "media/audio/audio_parameters.h"
+#include "ppapi/host/host_message_context.h"
#include "ppapi/shared_impl/media_stream_audio_track_shared.h"
#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
@@ -45,7 +46,8 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
void EnqueueBuffer(int32_t index);
// This function is called on the main thread.
- void Configure(int32_t number_of_buffers, int32_t duration);
+ int32_t Configure(int32_t number_of_buffers, int32_t duration,
+ const ppapi::host::ReplyMessageContext& context);
private:
// Initializes buffers on the main thread.
@@ -57,6 +59,9 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
void SendEnqueueBufferMessageOnMainThread(int32_t index,
int32_t buffers_generation);
+ // Send a reply to the currently pending |Configure()| request.
+ void SendConfigureReply(int32_t result);
+
// MediaStreamAudioSink overrides:
// These two functions should be called on the audio thread.
virtual void OnData(const int16* audio_data,
@@ -137,6 +142,9 @@ class PepperMediaStreamAudioTrackHost : public PepperMediaStreamTrackHostBase {
// User-configured buffer duration, in milliseconds.
int32_t user_buffer_duration_;
+ // Pending |Configure()| reply context.
+ ppapi::host::ReplyMessageContext pending_configure_reply_;
+
DISALLOW_COPY_AND_ASSIGN(AudioSink);
};

Powered by Google App Engine
This is Rietveld 408576698