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

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

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/message_channel.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('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.h
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index 2c7884e7d19ded4b7e2fed60be4f63fbb65532ec..2f6764174054ba45efa69aefc2ad99300a5ac68a 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -149,8 +149,12 @@ class CONTENT_EXPORT PepperPluginInstanceImpl
// the plugin being destroyed.
void MessageChannelDestroyed();
- // Return the v8 context that the plugin is in.
- v8::Local<v8::Context> GetContext();
+ // Return the v8 context for the frame that the plugin is contained in. Care
+ // should be taken to use the correct context for plugin<->JS interactions.
+ // In cases where JS calls into the plugin, the caller's context should
+ // typically be used. When calling from the plugin into JS, this context
+ // should typically used.
+ v8::Local<v8::Context> GetMainWorldContext();
// Does some pre-destructor cleanup on the instance. This is necessary
// because some cleanup depends on the plugin instance still existing (like
« no previous file with comments | « content/renderer/pepper/message_channel.cc ('k') | content/renderer/pepper/pepper_plugin_instance_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698