Index: content/renderer/pepper/pepper_plugin_instance_impl.cc |
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
index a1116811924e0ad9789ef791752b8a1de7341d0c..3457cff6626113d235f3e77fc9f67882e513af77 100644 |
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc |
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc |
@@ -661,6 +661,15 @@ PepperPluginInstanceImpl::~PepperPluginInstanceImpl() { |
// If a method needs to access a member of the instance after the call has |
// returned, then it needs to keep its own reference on the stack. |
+v8::Local<v8::Context> PepperPluginInstanceImpl::GetContext() { |
+ if (!container_) |
+ return v8::Handle<v8::Context>(); |
+ v8::Handle<v8::Context> context = |
+ container_->element().document().frame()->mainWorldScriptContext(); |
dmichael (off chromium)
2014/07/30 19:34:13
The frame can be NULL in rare cases, so please che
raymes
2014/08/06 03:22:52
Done.
|
+ DCHECK(context->GetIsolate() == isolate_); |
+ return context; |
+} |
+ |
void PepperPluginInstanceImpl::Delete() { |
is_deleted_ = true; |