summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser.cc
diff options
context:
space:
mode:
authoridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 19:50:59 +0000
committeridanan@chromium.org <idanan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 19:50:59 +0000
commit860f55497abe0123f3c4a6a139ccd84f13d892be (patch)
tree0da2d275be23012e8f4cb603e677b01db9e6646f /chrome/browser/browser.cc
parentc3ef3429eba3f39db64176ab7a2d722fde388725 (diff)
downloadchromium_src-860f55497abe0123f3c4a6a139ccd84f13d892be.zip
chromium_src-860f55497abe0123f3c4a6a139ccd84f13d892be.tar.gz
chromium_src-860f55497abe0123f3c4a6a139ccd84f13d892be.tar.bz2
Issue 348: can view old incognito cache if main process left running
Same place we clear cookies when the last incognito window is closed, destroy the entire incognito profile which by implication destoys the incognito cache. BUG=348 Review URL: http://codereview.chromium.org/53101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r--chrome/browser/browser.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 59b8157..410411e 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -232,13 +232,9 @@ Browser::~Browser() {
if (profile_->IsOffTheRecord() &&
!BrowserList::IsOffTheRecordSessionActive()) {
- // We reuse the OTR cookie store across OTR windows. If the last OTR
- // window is closed, then we want to wipe the cookie store clean, so when
- // an OTR window is open again, it starts with an empty cookie store. This
- // also frees up the memory that the OTR cookies were using. OTR never
- // loads or writes persistent cookies (there is no backing store), so we
- // can just delete all of the cookies in the store.
- profile_->GetRequestContext()->cookie_store()->DeleteAll(false);
+ // An off-the-record profile is no longer needed, this indirectly
+ // frees its cache and cookies.
+ profile_->GetOriginalProfile()->DestroyOffTheRecordProfile();
}
// There may be pending file dialogs, we need to tell them that we've gone