OLD | NEW |
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 259 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
260 | 260 |
261 BrowserThread::PostTask( | 261 BrowserThread::PostTask( |
262 BrowserThread::IO, FROM_HERE, | 262 BrowserThread::IO, FROM_HERE, |
263 NewRunnableFunction( | 263 NewRunnableFunction( |
264 &NotifyOTRProfileDestroyedOnIOThread, | 264 &NotifyOTRProfileDestroyedOnIOThread, |
265 profile_->GetRuntimeId(), GetRuntimeId())); | 265 profile_->GetRuntimeId(), GetRuntimeId())); |
266 | 266 |
267 // Clean up all DB files/directories | 267 // Clean up all DB files/directories |
268 if (db_tracker_) | 268 if (db_tracker_) { |
269 BrowserThread::PostTask( | 269 BrowserThread::PostTask( |
270 BrowserThread::FILE, FROM_HERE, | 270 BrowserThread::FILE, FROM_HERE, |
271 NewRunnableMethod( | 271 NewRunnableMethod( |
272 db_tracker_.get(), | 272 db_tracker_.get(), |
273 &webkit_database::DatabaseTracker::DeleteIncognitoDBDirectory)); | 273 &webkit_database::DatabaseTracker::Shutdown)); |
| 274 } |
274 | 275 |
275 BrowserList::RemoveObserver(this); | 276 BrowserList::RemoveObserver(this); |
276 | 277 |
277 if (pref_proxy_config_tracker_) | 278 if (pref_proxy_config_tracker_) |
278 pref_proxy_config_tracker_->DetachFromPrefService(); | 279 pref_proxy_config_tracker_->DetachFromPrefService(); |
279 | 280 |
280 ExtensionService* extension_service = GetExtensionService(); | 281 ExtensionService* extension_service = GetExtensionService(); |
281 if (extension_service) { | 282 if (extension_service) { |
282 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); | 283 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); |
283 extension_prefs->ClearIncognitoSessionOnlyContentSettings(); | 284 extension_prefs->ClearIncognitoSessionOnlyContentSettings(); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), | 732 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB), |
732 GetExtensionSpecialStoragePolicy()); | 733 GetExtensionSpecialStoragePolicy()); |
733 | 734 |
734 // Each consumer is responsible for registering its QuotaClient during | 735 // Each consumer is responsible for registering its QuotaClient during |
735 // its construction. | 736 // its construction. |
736 file_system_context_ = CreateFileSystemContext( | 737 file_system_context_ = CreateFileSystemContext( |
737 GetPath(), IsOffTheRecord(), | 738 GetPath(), IsOffTheRecord(), |
738 GetExtensionSpecialStoragePolicy(), | 739 GetExtensionSpecialStoragePolicy(), |
739 quota_manager_->proxy()); | 740 quota_manager_->proxy()); |
740 db_tracker_ = new webkit_database::DatabaseTracker( | 741 db_tracker_ = new webkit_database::DatabaseTracker( |
741 GetPath(), IsOffTheRecord(), GetExtensionSpecialStoragePolicy(), | 742 GetPath(), IsOffTheRecord(), false, GetExtensionSpecialStoragePolicy(), |
742 quota_manager_->proxy(), | 743 quota_manager_->proxy(), |
743 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 744 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
744 webkit_context_ = new WebKitContext( | 745 webkit_context_ = new WebKitContext( |
745 IsOffTheRecord(), GetPath(), GetExtensionSpecialStoragePolicy(), | 746 IsOffTheRecord(), GetPath(), GetExtensionSpecialStoragePolicy(), |
746 false, quota_manager_->proxy(), | 747 false, quota_manager_->proxy(), |
747 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); | 748 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); |
748 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); | 749 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); |
749 BrowserThread::PostTask( | 750 BrowserThread::PostTask( |
750 BrowserThread::IO, FROM_HERE, | 751 BrowserThread::IO, FROM_HERE, |
751 NewRunnableMethod( | 752 NewRunnableMethod( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 }; | 848 }; |
848 #endif | 849 #endif |
849 | 850 |
850 Profile* Profile::CreateOffTheRecordProfile() { | 851 Profile* Profile::CreateOffTheRecordProfile() { |
851 #if defined(OS_CHROMEOS) | 852 #if defined(OS_CHROMEOS) |
852 if (Profile::IsGuestSession()) | 853 if (Profile::IsGuestSession()) |
853 return new GuestSessionProfile(this); | 854 return new GuestSessionProfile(this); |
854 #endif | 855 #endif |
855 return new OffTheRecordProfileImpl(this); | 856 return new OffTheRecordProfileImpl(this); |
856 } | 857 } |
OLD | NEW |