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

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 7847027: DownloadId (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge, move DM Shutdown to ~OTRProfileImpl Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/history_marshaling.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile.h" 5 #include "chrome/browser/profiles/profile.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( 122 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
123 PluginPrefs::GetForProfile(this), &GetResourceContext()); 123 PluginPrefs::GetForProfile(this), &GetResourceContext());
124 124
125 BrowserThread::PostTask( 125 BrowserThread::PostTask(
126 BrowserThread::IO, FROM_HERE, 126 BrowserThread::IO, FROM_HERE,
127 NewRunnableFunction(&NotifyOTRProfileCreatedOnIOThread, profile_, this)); 127 NewRunnableFunction(&NotifyOTRProfileCreatedOnIOThread, profile_, this));
128 } 128 }
129 129
130 virtual ~OffTheRecordProfileImpl() { 130 virtual ~OffTheRecordProfileImpl() {
131 // Shutdown the DownloadManager here in the dtor as ProfileImpl does to
132 // guarantee that it happens before the last scoped_refptr<DM> is reaped.
133 // DownloadManager is lazily created, so check before accessing it.
134 if (download_manager_.get()) {
135 // Drop our download manager so we forget about all the downloads made
136 // in incognito mode.
137 download_manager_->Shutdown();
138 download_manager_ = NULL;
139 }
140
131 NotificationService::current()->Notify( 141 NotificationService::current()->Notify(
132 chrome::NOTIFICATION_PROFILE_DESTROYED, Source<Profile>(this), 142 chrome::NOTIFICATION_PROFILE_DESTROYED, Source<Profile>(this),
133 NotificationService::NoDetails()); 143 NotificationService::NoDetails());
134 144
135 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( 145 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext(
136 &GetResourceContext()); 146 &GetResourceContext());
137 147
138 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); 148 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
139 149
140 BrowserThread::PostTask( 150 BrowserThread::PostTask(
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 virtual void SetupChromeOSEnterpriseExtensionObserver() { 525 virtual void SetupChromeOSEnterpriseExtensionObserver() {
516 profile_->SetupChromeOSEnterpriseExtensionObserver(); 526 profile_->SetupChromeOSEnterpriseExtensionObserver();
517 } 527 }
518 528
519 virtual void InitChromeOSPreferences() { 529 virtual void InitChromeOSPreferences() {
520 // The incognito profile shouldn't have Chrome OS's preferences. 530 // The incognito profile shouldn't have Chrome OS's preferences.
521 // The preferences are associated with the regular user profile. 531 // The preferences are associated with the regular user profile.
522 } 532 }
523 #endif // defined(OS_CHROMEOS) 533 #endif // defined(OS_CHROMEOS)
524 534
525 virtual void ExitedOffTheRecordMode() { 535 virtual void ExitedOffTheRecordMode() {
willchan no longer on Chromium 2011/09/12 22:09:41 Can we get rid of this? Or is it still needed?
benjhayden 2011/09/14 19:25:42 Done.
526 // DownloadManager is lazily created, so check before accessing it.
527 if (download_manager_.get()) {
528 // Drop our download manager so we forget about all the downloads made
529 // in incognito mode.
530 download_manager_->Shutdown();
531 download_manager_ = NULL;
532 }
533 } 536 }
534 537
535 virtual void OnBrowserAdded(const Browser* browser) { 538 virtual void OnBrowserAdded(const Browser* browser) {
536 } 539 }
537 540
538 virtual void OnBrowserRemoved(const Browser* browser) { 541 virtual void OnBrowserRemoved(const Browser* browser) {
539 if (BrowserList::GetBrowserCount(this) == 0) 542 if (BrowserList::GetBrowserCount(this) == 0)
540 ExitedOffTheRecordMode(); 543 ExitedOffTheRecordMode();
541 } 544 }
542 545
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 }; 730 };
728 #endif 731 #endif
729 732
730 Profile* Profile::CreateOffTheRecordProfile() { 733 Profile* Profile::CreateOffTheRecordProfile() {
731 #if defined(OS_CHROMEOS) 734 #if defined(OS_CHROMEOS)
732 if (Profile::IsGuestSession()) 735 if (Profile::IsGuestSession())
733 return new GuestSessionProfile(this); 736 return new GuestSessionProfile(this);
734 #endif 737 #endif
735 return new OffTheRecordProfileImpl(this); 738 return new OffTheRecordProfileImpl(this);
736 } 739 }
OLDNEW
« no previous file with comments | « chrome/browser/history/history_marshaling.h ('k') | chrome/browser/profiles/profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698