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

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

Issue 588083002: Use the correct v8 context for conversions when calling into the plugin from JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_try_catch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 98ca698ed56415c5ab34ced2dbebc7737345efd6..2c6ad552d74bd85211e68562ab5b3832702cde53 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -673,12 +673,17 @@ void PepperPluginInstanceImpl::MessageChannelDestroyed() {
}
v8::Local<v8::Context> PepperPluginInstanceImpl::GetContext() {
dmichael (off chromium) 2014/09/23 16:16:54 Maybe we should rename this to "GetMainWorldContex
raymes 2014/09/24 00:19:45 Done.
- if (!container_ ||
- container_->element().isNull() ||
- container_->element().document().isNull() ||
- !container_->element().document().frame()) {
+ if (!container_)
+ return v8::Handle<v8::Context>();
+
+ if (container_->element().isNull())
+ return v8::Handle<v8::Context>();
+
+ if (container_->element().document().isNull())
+ return v8::Handle<v8::Context>();
+
+ if (!container_->element().document().frame())
return v8::Handle<v8::Context>();
- }
v8::Local<v8::Context> context =
container_->element().document().frame()->mainWorldScriptContext();
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_try_catch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698