OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // initialized that we might be reading from the IO thread. | 407 // initialized that we might be reading from the IO thread. |
408 | 408 |
409 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path, | 409 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path, |
410 cache_max_size, media_cache_path, media_cache_max_size, | 410 cache_max_size, media_cache_path, media_cache_max_size, |
411 extensions_cookie_path, app_path, predictor_, | 411 extensions_cookie_path, app_path, predictor_, |
412 g_browser_process->local_state(), | 412 g_browser_process->local_state(), |
413 g_browser_process->io_thread(), | 413 g_browser_process->io_thread(), |
414 restore_old_session_cookies); | 414 restore_old_session_cookies); |
415 | 415 |
416 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( | 416 ChromePluginServiceFilter::GetInstance()->RegisterResourceContext( |
417 PluginPrefs::GetForProfile(this), &GetResourceContext()); | 417 PluginPrefs::GetForProfile(this), |
| 418 &io_data_.GetResourceContextNoInit()); |
418 | 419 |
419 // Creation has been finished. | 420 // Creation has been finished. |
420 if (delegate_) | 421 if (delegate_) |
421 delegate_->OnProfileCreated(this, true); | 422 delegate_->OnProfileCreated(this, true); |
422 | 423 |
423 content::NotificationService::current()->Notify( | 424 content::NotificationService::current()->Notify( |
424 chrome::NOTIFICATION_PROFILE_CREATED, | 425 chrome::NOTIFICATION_PROFILE_CREATED, |
425 content::Source<Profile>(this), | 426 content::Source<Profile>(this), |
426 content::NotificationService::NoDetails()); | 427 content::NotificationService::NoDetails()); |
427 } | 428 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 565 |
565 // Remove pref observers | 566 // Remove pref observers |
566 pref_change_registrar_.RemoveAll(); | 567 pref_change_registrar_.RemoveAll(); |
567 | 568 |
568 // The sync service needs to be deleted before the services it calls. | 569 // The sync service needs to be deleted before the services it calls. |
569 // TODO(stevet): Make ProfileSyncService into a PKS and let the PDM take care | 570 // TODO(stevet): Make ProfileSyncService into a PKS and let the PDM take care |
570 // of the cleanup below. | 571 // of the cleanup below. |
571 sync_service_.reset(); | 572 sync_service_.reset(); |
572 | 573 |
573 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( | 574 ChromePluginServiceFilter::GetInstance()->UnregisterResourceContext( |
574 &GetResourceContext()); | 575 &io_data_.GetResourceContextNoInit()); |
575 | 576 |
576 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 577 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
577 | 578 |
578 if (db_tracker_) { | 579 if (db_tracker_) { |
579 BrowserThread::PostTask( | 580 BrowserThread::PostTask( |
580 BrowserThread::FILE, FROM_HERE, | 581 BrowserThread::FILE, FROM_HERE, |
581 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 582 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
582 db_tracker_.get())); | 583 db_tracker_.get())); |
583 } | 584 } |
584 | 585 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 clear_local_state_on_exit_, quota_manager_->proxy(), | 1279 clear_local_state_on_exit_, quota_manager_->proxy(), |
1279 BrowserThread::GetMessageLoopProxyForThread( | 1280 BrowserThread::GetMessageLoopProxyForThread( |
1280 BrowserThread::WEBKIT_DEPRECATED)); | 1281 BrowserThread::WEBKIT_DEPRECATED)); |
1281 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); | 1282 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); |
1282 BrowserThread::PostTask( | 1283 BrowserThread::PostTask( |
1283 BrowserThread::IO, FROM_HERE, | 1284 BrowserThread::IO, FROM_HERE, |
1284 base::Bind(&ChromeAppCacheService::InitializeOnIOThread, | 1285 base::Bind(&ChromeAppCacheService::InitializeOnIOThread, |
1285 appcache_service_.get(), | 1286 appcache_service_.get(), |
1286 IsOffTheRecord() | 1287 IsOffTheRecord() |
1287 ? FilePath() : GetPath().Append(chrome::kAppCacheDirname), | 1288 ? FilePath() : GetPath().Append(chrome::kAppCacheDirname), |
1288 &GetResourceContext(), | 1289 &io_data_.GetResourceContextNoInit(), |
1289 make_scoped_refptr(GetExtensionSpecialStoragePolicy()))); | 1290 make_scoped_refptr(GetExtensionSpecialStoragePolicy()))); |
1290 } | 1291 } |
1291 | 1292 |
1292 WebKitContext* ProfileImpl::GetWebKitContext() { | 1293 WebKitContext* ProfileImpl::GetWebKitContext() { |
1293 CreateQuotaManagerAndClients(); | 1294 CreateQuotaManagerAndClients(); |
1294 return webkit_context_.get(); | 1295 return webkit_context_.get(); |
1295 } | 1296 } |
1296 | 1297 |
1297 void ProfileImpl::MarkAsCleanShutdown() { | 1298 void ProfileImpl::MarkAsCleanShutdown() { |
1298 if (prefs_.get()) { | 1299 if (prefs_.get()) { |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 FilePath* cache_path, | 1678 FilePath* cache_path, |
1678 int* max_size) { | 1679 int* max_size) { |
1679 DCHECK(cache_path); | 1680 DCHECK(cache_path); |
1680 DCHECK(max_size); | 1681 DCHECK(max_size); |
1681 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1682 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1682 if (!path.empty()) | 1683 if (!path.empty()) |
1683 *cache_path = path; | 1684 *cache_path = path; |
1684 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1685 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1685 prefs_->GetInteger(prefs::kDiskCacheSize); | 1686 prefs_->GetInteger(prefs::kDiskCacheSize); |
1686 } | 1687 } |
OLD | NEW |