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

Unified Diff: components/plugins/renderer/loadable_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 | « chrome/renderer/plugins/chrome_plugin_placeholder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/loadable_plugin_placeholder.cc
diff --git a/components/plugins/renderer/loadable_plugin_placeholder.cc b/components/plugins/renderer/loadable_plugin_placeholder.cc
index 3406d1a07b99b769fef360006cf0ddfba7d52e1c..dde47c2569ef4cd427d2f2fbef85c78402db1e4b 100644
--- a/components/plugins/renderer/loadable_plugin_placeholder.cc
+++ b/components/plugins/renderer/loadable_plugin_placeholder.cc
@@ -41,6 +41,7 @@ void LoadablePluginPlaceholder::BlockForPowerSaverPoster() {
DCHECK(!is_blocked_for_power_saver_poster_);
is_blocked_for_power_saver_poster_ = true;
+ DCHECK(render_frame());
render_frame()->RegisterPeripheralPlugin(
url::Origin(GURL(GetPluginParams().url)),
base::Bind(&LoadablePluginPlaceholder::MarkPluginEssential,
@@ -181,6 +182,8 @@ v8::Local<v8::Object> LoadablePluginPlaceholder::GetV8ScriptableObject(
void LoadablePluginPlaceholder::OnUnobscuredRectUpdate(
const gfx::Rect& unobscured_rect) {
DCHECK(content::RenderThread::Get());
+ if (!render_frame())
+ return;
if (!plugin() || !finished_loading_)
return;
« no previous file with comments | « chrome/renderer/plugins/chrome_plugin_placeholder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698