#include "content/renderer/pepper/pepper_webplugin_impl.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDocument.h"
+#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebHelperPlugin.h"
#include "third_party/WebKit/public/web/WebPlugin.h"
+#include "third_party/WebKit/public/web/WebPluginContainer.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace content {
}
scoped_ptr<PepperCdmWrapper> PepperCdmWrapperImpl::Create(
- blink::WebFrame* frame,
- const std::string& pluginType) {
-
- // TODO(jrummell): Convert to DCHECK(frame) once Blink starts passing the
- // WebFrame to WebContentDecryptionModuleImpl.
- if (!frame)
- return scoped_ptr<PepperCdmWrapper>();
-
+ blink::WebLocalFrame* frame,
+ const std::string& pluginType,
+ const GURL& security_origin) {
+ DCHECK(frame);
ScopedHelperPlugin helper_plugin(blink::WebHelperPlugin::create(
blink::WebString::fromUTF8(pluginType), frame));
if (!helper_plugin)
if (!plugin_instance)
return scoped_ptr<PepperCdmWrapper>();
+ GURL url(plugin_instance->container()->element().document().url());
+ CHECK_EQ(security_origin.GetOrigin(), url.GetOrigin())
+ << "Pepper instance has a different origin than the EME call.";
+
if (!plugin_instance->GetContentDecryptorDelegate())
return scoped_ptr<PepperCdmWrapper>();