| Index: webkit/plugins/ppapi/ppb_video_decoder_impl.cc
|
| diff --git a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
|
| index 76edf084db209379bf17774c1c78363fe2f3ac12..7cc37ba0c3b8767904f58a8af139d1a907699f9a 100644
|
| --- a/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
|
| +++ b/webkit/plugins/ppapi/ppb_video_decoder_impl.cc
|
| @@ -44,7 +44,8 @@ PP_Bool GetConfigs(PP_Instance instance_id,
|
| }
|
|
|
| PP_Resource Create(PP_Instance instance_id,
|
| - PP_VideoConfigElement* decoder_config) {
|
| + PP_VideoConfigElement* decoder_config,
|
| + PP_CompletionCallback callback) {
|
| PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id);
|
| if (!instance)
|
| return 0;
|
| @@ -52,8 +53,10 @@ PP_Resource Create(PP_Instance instance_id,
|
| scoped_refptr<PPB_VideoDecoder_Impl> decoder(
|
| new PPB_VideoDecoder_Impl(instance));
|
|
|
| - if (!decoder->Init(const_cast<PP_VideoConfigElement*>(decoder_config)))
|
| + if (!decoder->Init(
|
| + const_cast<PP_VideoConfigElement*>(decoder_config), callback)) {
|
| return 0;
|
| + }
|
|
|
| return decoder->GetReference();
|
| }
|
| @@ -212,7 +215,8 @@ bool PPB_VideoDecoder_Impl::GetConfigs(
|
| return true;
|
| }
|
|
|
| -bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config) {
|
| +bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config,
|
| + PP_CompletionCallback callback) {
|
| if (!instance())
|
| return false;
|
|
|
| @@ -224,6 +228,8 @@ bool PPB_VideoDecoder_Impl::Init(PP_VideoConfigElement* decoder_config) {
|
| CopyToConfigList(decoder_config, &copied);
|
| platform_video_decoder_->Initialize(copied);
|
|
|
| + initialization_callback_ = callback;
|
| +
|
| return platform_video_decoder_.get()? true : false;
|
| }
|
|
|
| @@ -392,6 +398,15 @@ void PPB_VideoDecoder_Impl::NotifyFlushDone() {
|
| PP_RunCompletionCallback(&callback, PP_OK);
|
| }
|
|
|
| +void PPB_VideoDecoder_Impl::NotifyInitializeDone() {
|
| + if (initialization_callback_.func == NULL)
|
| + return;
|
| +
|
| + PP_CompletionCallback callback = PP_BlockUntilComplete();
|
| + std::swap(callback, initialization_callback_);
|
| + PP_RunCompletionCallback(&callback, PP_OK);
|
| +}
|
| +
|
| } // namespace ppapi
|
| } // namespace webkit
|
|
|
|
|