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

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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | 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..8cb02d6b15cdd23efd28efd0e4c80a1985c27248 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -672,13 +672,18 @@ void PepperPluginInstanceImpl::MessageChannelDestroyed() {
message_channel_object_.Reset();
}
-v8::Local<v8::Context> PepperPluginInstanceImpl::GetContext() {
- if (!container_ ||
- container_->element().isNull() ||
- container_->element().document().isNull() ||
- !container_->element().document().frame()) {
+v8::Local<v8::Context> PepperPluginInstanceImpl::GetMainWorldContext() {
+ 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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | content/renderer/pepper/pepper_try_catch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698