| 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 ee80874efade973aec26c1e39712c0202f3e6e18..52e02f6848e5adae5a0e45d22d80279e28983629 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();
|
| }
|
| @@ -208,7 +211,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;
|
|
|
| @@ -220,6 +224,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;
|
| }
|
|
|
| @@ -382,6 +388,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
|
|
|
|
|