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

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: Add TODO 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..187618c15a1af26c982c4932ce6de4369bca0407 100644
--- a/chrome/browser/chromeos/power/renderer_freezer.cc
+++ b/chrome/browser/chromeos/power/renderer_freezer.cc
@@ -148,11 +148,14 @@ 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);
+ // |web_contents| is null when using views-based login/lock screen.
+ // TODO(jdufault): Remove this code after webui login/lock is gone. See
+ // crbug.com/719015.
+ content::WebContents* web_contents = locker->delegate()->GetWebContents();
+ if (web_contents) {
+ 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