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

Unified Diff: chrome/browser/chromeos/login/ui/preloaded_web_view.cc

Issue 2659853005: cros: Fix crash after killing preloaded lock screen in task manager. (Closed)
Patch Set: Created 3 years, 11 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/login/ui/preloaded_web_view.cc
diff --git a/chrome/browser/chromeos/login/ui/preloaded_web_view.cc b/chrome/browser/chromeos/login/ui/preloaded_web_view.cc
index 7fd39ebc4007f0b13d79152a723d22f77e029738..a34f2c5e7640cd6080023b9b39cea963b8187bb3 100644
--- a/chrome/browser/chromeos/login/ui/preloaded_web_view.cc
+++ b/chrome/browser/chromeos/login/ui/preloaded_web_view.cc
@@ -43,6 +43,17 @@ void PreloadedWebView::PreloadOnIdle(PreloadCallback preload) {
std::unique_ptr<views::WebView> PreloadedWebView::TryTake() {
idle_detector_.reset();
+
+ // Clear cached reference if it is no longer valid (ie, destroyed in task
+ // manager).
+ if (preloaded_instance_ &&
+ !preloaded_instance_->GetWebContents()
+ ->GetRenderViewHost()
+ ->GetWidget()
+ ->GetView()) {
+ preloaded_instance_.reset();
+ }
+
return std::move(preloaded_instance_);
}
« 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