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

Unified Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 976553003: Fix Launcher crash in ChromeOS guest mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to tapted comments. Created 5 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
Index: chrome/browser/ui/app_list/start_page_service.cc
diff --git a/chrome/browser/ui/app_list/start_page_service.cc b/chrome/browser/ui/app_list/start_page_service.cc
index 068bdafee57d17f27955f3635b5934534854752e..3e25e236db5603f87d217a07ba1354cf9a14eff6 100644
--- a/chrome/browser/ui/app_list/start_page_service.cc
+++ b/chrome/browser/ui/app_list/start_page_service.cc
@@ -86,6 +86,15 @@ class StartPageService::ProfileDestroyObserver
public:
explicit ProfileDestroyObserver(StartPageService* service)
: service_(service) {
+ if (service_->profile()->IsOffTheRecord()) {
+ // We need to be notified when the original profile gets destroyed as well
+ // as the OTR profile, because the original profile will be destroyed
+ // first, and a DCHECK at that time ensures that the OTR profile has 0
+ // hosts. See http://crbug.com/463419.
+ registrar_.Add(
+ this, chrome::NOTIFICATION_PROFILE_DESTROYED,
+ content::Source<Profile>(service_->profile()->GetOriginalProfile()));
+ }
registrar_.Add(this,
chrome::NOTIFICATION_PROFILE_DESTROYED,
content::Source<Profile>(service_->profile()));
@@ -98,7 +107,9 @@ class StartPageService::ProfileDestroyObserver
const content::NotificationSource& source,
const content::NotificationDetails& details) override {
DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
- DCHECK_EQ(service_->profile(), content::Source<Profile>(source).ptr());
+ DCHECK(service_->profile()->IsSameProfile(
+ content::Source<Profile>(source).ptr()));
+ registrar_.RemoveAll();
service_->Shutdown();
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | chrome/browser/ui/app_list/start_page_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698