Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(695)

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 421963008: Add PepperTryCatch and V8ObjectVar classes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698