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

Unified Diff: chrome/browser/chromeos/power/renderer_freezer.cc

Issue 2910733002: cros: Fix potential null-deref when sleeping system on views-lock. (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/power/renderer_freezer.cc
diff --git a/chrome/browser/chromeos/power/renderer_freezer.cc b/chrome/browser/chromeos/power/renderer_freezer.cc
index 05d4314bf7d3f1e038a831020e49f7e6e507fa8c..9b402eef3462b54de73765e18d8a9703988823b6 100644
--- a/chrome/browser/chromeos/power/renderer_freezer.cc
+++ b/chrome/browser/chromeos/power/renderer_freezer.cc
@@ -148,11 +148,11 @@ void RendererFreezer::OnScreenLockStateChanged(chromeos::ScreenLocker* locker,
// RendererFreezer::SuspendImminent(), it is guaranteed that the screen locker
// renderer will not be frozen at any point.
if (is_locked) {
- delegate_->SetShouldFreezeRenderer(locker->delegate()
- ->GetWebContents()
- ->GetRenderProcessHost()
- ->GetHandle(),
- false);
+ content::WebContents* web_contents = locker->delegate()->GetWebContents();
+ if (web_contents) {
Daniel Erat 2017/05/26 22:10:06 nit: mind adding a comment here mentioning why thi
jdufault 2017/05/26 23:15:20 Done.
+ delegate_->SetShouldFreezeRenderer(
+ web_contents->GetRenderProcessHost()->GetHandle(), false);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698