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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 2693513002: ash: Fix clusterfuzz crash in AddShelfOptionsMenu (Closed)
Patch Set: Created 3 years, 10 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/ui/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 69d32abc624ee35ef8fc95a03ecbcf37877552e8..e6017cf9956bbf40e93d118bdf1c83cf30d7e1a8 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -479,11 +479,17 @@ ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate(
ui::MenuModel* ChromeShellDelegate::CreateContextMenu(
ash::WmShelf* wm_shelf,
const ash::ShelfItem* item) {
- DCHECK(shelf_delegate_);
// Don't show context menu for exclusive app runtime mode.
if (chrome::IsRunningInAppMode())
return nullptr;
+ // No context menu before |shelf_delegate_| is created. This is possible
+ // now because CreateShelfDelegate is called by session state change
+ // via mojo asynchronously. Context menu could be triggered when the
+ // mojo message is still in-fly and crashes.
+ if (!shelf_delegate_)
+ return nullptr;
+
return LauncherContextMenu::Create(shelf_delegate_, item, wm_shelf);
}
« 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