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

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

Issue 853743002: First pass at fixing guest browser cookies issue. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete the Profile Manager. Guest Profile doesn't write to autocomplete/history. Views still needs … 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
« no previous file with comments | « chrome/browser/ui/app_list/model_pref_updater.cc ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index f438efd2273adeda29b552ea373597101c6020ed..ff3ac9cf1721a0c23b8635252150c4c8866a5453 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -65,6 +65,7 @@
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_destroyer.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile_metrics.h"
#include "chrome/browser/repost_form_warning_controller.h"
#include "chrome/browser/search/search.h"
@@ -511,9 +512,17 @@ Browser::~Browser() {
if (profile_->IsOffTheRecord() &&
!BrowserList::IsOffTheRecordSessionActiveForProfile(profile_)) {
- // An incognito profile is no longer needed, this indirectly frees
- // its cache and cookies once it gets destroyed at the appropriate time.
- ProfileDestroyer::DestroyProfileWhenAppropriate(profile_);
+ if (profile_->IsGuestSession()) {
+ // The profile's BCKS's need to shutdown after Views shuts down.
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&ProfileManager::DeleteProfile,
+ base::Unretained(g_browser_process->profile_manager()),
+ profile_));
+ } else {
+ // An incognito profile is no longer needed, this indirectly frees
+ // its cache and cookies once it gets destroyed at the appropriate time.
+ ProfileDestroyer::DestroyProfileWhenAppropriate(profile_);
+ }
}
// There may be pending file dialogs, we need to tell them that we've gone
« no previous file with comments | « chrome/browser/ui/app_list/model_pref_updater.cc ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698