Index: webkit/media/webmediaplayer_impl.cc |
diff --git a/webkit/media/webmediaplayer_impl.cc b/webkit/media/webmediaplayer_impl.cc |
index 0281177e3c29e82de9de98d645c47a2270774835..566091eadf13cd663749f94710e06a44094b9e71 100644 |
--- a/webkit/media/webmediaplayer_impl.cc |
+++ b/webkit/media/webmediaplayer_impl.cc |
@@ -37,6 +37,7 @@ |
#include "webkit/media/webmediaplayer_proxy.h" |
#include "webkit/media/webmediaplayer_util.h" |
#include "webkit/media/webvideoframe_impl.h" |
+#include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
using WebKit::WebCanvas; |
using WebKit::WebMediaPlayer; |
@@ -129,7 +130,9 @@ WebMediaPlayerImpl::WebMediaPlayerImpl( |
incremented_externally_allocated_memory_(false), |
audio_source_provider_(audio_source_provider), |
is_local_source_(false), |
- decryptor_(proxy_.get()) { |
+ decryptor_(proxy_.get(), |
+ base::Bind(&WebMediaPlayerImpl::CreatePluginInstance, |
+ base::Unretained(this))) { |
xhwang
2012/07/17 00:57:23
This "Unretained" is ugly but should work. The cal
|
media_log_->AddEvent( |
media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
@@ -1043,6 +1046,17 @@ WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
return client_; |
} |
+scoped_refptr<webkit::ppapi::PluginInstance> |
+ WebMediaPlayerImpl::CreatePluginInstance(const std::string& plugin_type) { |
xhwang
2012/07/17 00:57:23
We can replace this function with something like
ddorwin
2012/07/17 21:31:28
If we replaced it, where would the checks and cast
xhwang
2012/07/18 19:43:17
All of these are done in PpapiDecryptor::Init() no
|
+ WebKit::WebPlugin* plugin = GetClient()->createHelperPlugin( |
+ WebString::fromUTF8(plugin_type), frame_); |
+ DCHECK(!plugin->isPlaceholder()); // Prevented by WebKit. |
+ // Only Pepper plugins are supported, so it must be a ppapi object. |
+ webkit::ppapi::WebPluginImpl* ppapi_plugin = |
+ static_cast<webkit::ppapi::WebPluginImpl*>(plugin); |
+ return scoped_refptr<webkit::ppapi::PluginInstance>(ppapi_plugin->instance()); |
+} |
+ |
WebKit::WebAudioSourceProvider* WebMediaPlayerImpl::audioSourceProvider() { |
return audio_source_provider_; |
} |