OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/profile.h" | 5 #include "chrome/browser/profile.h" |
6 | 6 |
7 #include "app/theme_provider.h" | 7 #include "app/theme_provider.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 // HistoryService. | 720 // HistoryService. |
721 if (thumbnail_store_.get()) | 721 if (thumbnail_store_.get()) |
722 thumbnail_store_->Shutdown(); | 722 thumbnail_store_->Shutdown(); |
723 | 723 |
724 // Remove pref observers. | 724 // Remove pref observers. |
725 PrefService* prefs = GetPrefs(); | 725 PrefService* prefs = GetPrefs(); |
726 prefs->RemovePrefObserver(prefs::kSpellCheckDictionary, this); | 726 prefs->RemovePrefObserver(prefs::kSpellCheckDictionary, this); |
727 prefs->RemovePrefObserver(prefs::kEnableSpellCheck, this); | 727 prefs->RemovePrefObserver(prefs::kEnableSpellCheck, this); |
728 prefs->RemovePrefObserver(prefs::kEnableAutoSpellCorrect, this); | 728 prefs->RemovePrefObserver(prefs::kEnableAutoSpellCorrect, this); |
729 | 729 |
730 #if defined(BROWSER_SYNC) | |
731 sync_service_.reset(); | 730 sync_service_.reset(); |
732 #endif | |
733 | 731 |
734 // Both HistoryService and WebDataService maintain threads for background | 732 // Both HistoryService and WebDataService maintain threads for background |
735 // processing. Its possible each thread still has tasks on it that have | 733 // processing. Its possible each thread still has tasks on it that have |
736 // increased the ref count of the service. In such a situation, when we | 734 // increased the ref count of the service. In such a situation, when we |
737 // decrement the refcount, it won't be 0, and the threads/databases aren't | 735 // decrement the refcount, it won't be 0, and the threads/databases aren't |
738 // properly shut down. By explicitly calling Cleanup/Shutdown we ensure the | 736 // properly shut down. By explicitly calling Cleanup/Shutdown we ensure the |
739 // databases are properly closed. | 737 // databases are properly closed. |
740 if (web_data_service_.get()) | 738 if (web_data_service_.get()) |
741 web_data_service_->Shutdown(); | 739 web_data_service_->Shutdown(); |
742 | 740 |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, | 1346 registrar_.Remove(this, NotificationType::BOOKMARK_MODEL_LOADED, |
1349 Source<Profile>(this)); | 1347 Source<Profile>(this)); |
1350 } | 1348 } |
1351 } | 1349 } |
1352 | 1350 |
1353 void ProfileImpl::StopCreateSessionServiceTimer() { | 1351 void ProfileImpl::StopCreateSessionServiceTimer() { |
1354 create_session_service_timer_.Stop(); | 1352 create_session_service_timer_.Stop(); |
1355 } | 1353 } |
1356 | 1354 |
1357 ProfileSyncService* ProfileImpl::GetProfileSyncService() { | 1355 ProfileSyncService* ProfileImpl::GetProfileSyncService() { |
1358 #if defined(BROWSER_SYNC) && !defined(OS_POSIX) | 1356 #if !defined(OS_POSIX) |
1359 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { | 1357 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableSync)) { |
1360 if (!sync_service_.get()) | 1358 if (!sync_service_.get()) |
1361 InitSyncService(); | 1359 InitSyncService(); |
1362 return sync_service_.get(); | 1360 return sync_service_.get(); |
1363 } | 1361 } |
1364 #endif | 1362 #endif |
1365 return NULL; | 1363 return NULL; |
1366 } | 1364 } |
1367 | 1365 |
1368 void ProfileImpl::InitSyncService() { | 1366 void ProfileImpl::InitSyncService() { |
1369 #if defined(BROWSER_SYNC) | |
1370 sync_service_.reset(new ProfileSyncService(this)); | 1367 sync_service_.reset(new ProfileSyncService(this)); |
1371 sync_service_->Initialize(); | 1368 sync_service_->Initialize(); |
1372 #endif | |
1373 } | 1369 } |
OLD | NEW |