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

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

Issue 1172143004: Block scripting in plugin teardown during Document unload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restrict the legacy PP_Var too Created 5 years, 6 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/ppb_var_deprecated_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.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 85449bacf5bb1da057bc660f59ce8d98df8acedc..a5662bcebea43a4beef5da37f47b36ad03b8b13f 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -110,6 +110,7 @@
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebPluginContainer.h"
+#include "third_party/WebKit/public/web/WebPluginScriptForbiddenScope.h"
#include "third_party/WebKit/public/web/WebPrintParams.h"
#include "third_party/WebKit/public/web/WebPrintPresetOptions.h"
#include "third_party/WebKit/public/web/WebPrintScalingOption.h"
@@ -2371,6 +2372,8 @@ PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance,
PP_Var* exception) {
if (!container_)
return PP_MakeUndefined();
+ if (is_deleted_ && blink::WebPluginScriptForbiddenScope::isForbidden())
+ return PP_MakeUndefined();
RecordFlashJavaScriptUse();
// Executing the script may remove the plugin from the DOM, so we need to keep
« no previous file with comments | « no previous file | content/renderer/pepper/ppb_var_deprecated_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698