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

Unified Diff: chrome/renderer/plugins/chrome_plugin_placeholder.cc

Issue 2845413002: Plugin Power Saver: Add missing RenderFrame null-checks in placeholders (Closed)
Patch Set: add comment Created 3 years, 8 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 | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/plugins/chrome_plugin_placeholder.cc
diff --git a/chrome/renderer/plugins/chrome_plugin_placeholder.cc b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 028a70bfda852f87fee99f427febca3de7fe070e..1ce8165477fdaa385c15073e6c3aeb1e8b081916 100644
--- a/chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ b/chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -233,6 +233,9 @@ void ChromePluginPlaceholder::PluginListChanged() {
if (!GetFrame() || !plugin())
return;
+ // Checking with GetFrame() is equivalent to checking render_frame().
+ DCHECK(render_frame());
+
ChromeViewHostMsg_GetPluginInfo_Output output;
std::string mime_type(GetPluginParams().mime_type.Utf8());
render_frame()->Send(new ChromeViewHostMsg_GetPluginInfo(
@@ -289,6 +292,8 @@ void ChromePluginPlaceholder::ShowContextMenu(
const blink::WebMouseEvent& event) {
if (context_menu_request_id_)
return; // Don't allow nested context menu requests.
+ if (!render_frame())
+ return;
content::ContextMenuParams params;
@@ -361,6 +366,7 @@ blink::WebPlugin* ChromePluginPlaceholder::CreatePlugin() {
}
void ChromePluginPlaceholder::OnBlockedTinyContent() {
+ DCHECK(render_frame());
if (did_send_blocked_content_notification_)
return;
« no previous file with comments | « no previous file | components/plugins/renderer/loadable_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698