| Index: chrome/browser/profiles/profile_impl.cc
|
| diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
|
| index e01a3401368fbcb6b3f1508295897083180ab69e..a18b96b3a00c50f259e6bcb9cffb262c58acefb9 100644
|
| --- a/chrome/browser/profiles/profile_impl.cc
|
| +++ b/chrome/browser/profiles/profile_impl.cc
|
| @@ -58,8 +58,7 @@
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/search_engines/template_url_fetcher.h"
|
| #include "chrome/browser/search_engines/template_url_model.h"
|
| -#include "chrome/browser/sessions/session_service.h"
|
| -#include "chrome/browser/sessions/tab_restore_service.h"
|
| +#include "chrome/browser/sessions/session_service_factory.h"
|
| #include "chrome/browser/spellcheck_host.h"
|
| #include "chrome/browser/ssl/ssl_host_state.h"
|
| #include "chrome/browser/status_icons/status_tray.h"
|
| @@ -278,7 +277,6 @@ ProfileImpl::ProfileImpl(const FilePath& path,
|
| #if defined(OS_WIN)
|
| checked_instant_promo_(false),
|
| #endif
|
| - shutdown_session_service_(false),
|
| delegate_(delegate) {
|
| DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
|
| "profile files to the root directory!";
|
| @@ -590,11 +588,10 @@ ProfileImpl::~ProfileImpl() {
|
|
|
| GetPolicyConnector()->Shutdown();
|
|
|
| - ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
|
| + StopCreateSessionServiceTimer();
|
|
|
| - tab_restore_service_.reset();
|
| + ProfileDependencyManager::GetInstance()->DestroyProfileServices(this);
|
|
|
| - StopCreateSessionServiceTimer();
|
| // TemplateURLModel schedules a task on the WebDataService from its
|
| // destructor. Delete it first to ensure the task gets scheduled before we
|
| // shut down the database.
|
| @@ -1166,30 +1163,6 @@ fileapi::FileSystemContext* ProfileImpl::GetFileSystemContext() {
|
| return file_system_context_.get();
|
| }
|
|
|
| -SessionService* ProfileImpl::GetSessionService() {
|
| - if (!session_service_.get() && !shutdown_session_service_) {
|
| - session_service_.reset(new SessionService(this));
|
| - session_service_->ResetFromCurrentBrowsers();
|
| - }
|
| - return session_service_.get();
|
| -}
|
| -
|
| -void ProfileImpl::ShutdownSessionService() {
|
| - if (shutdown_session_service_)
|
| - return;
|
| -
|
| - // We're about to exit, force creation of the session service if it hasn't
|
| - // been created yet. We do this to ensure session state matches the point in
|
| - // time the user exited.
|
| - GetSessionService();
|
| - shutdown_session_service_ = true;
|
| - session_service_.reset();
|
| -}
|
| -
|
| -bool ProfileImpl::HasSessionService() const {
|
| - return (session_service_.get() != NULL);
|
| -}
|
| -
|
| bool ProfileImpl::HasProfileSyncService() const {
|
| return (sync_service_.get() != NULL);
|
| }
|
| @@ -1224,12 +1197,6 @@ Time ProfileImpl::GetStartTime() const {
|
| return start_time_;
|
| }
|
|
|
| -TabRestoreService* ProfileImpl::GetTabRestoreService() {
|
| - if (!tab_restore_service_.get())
|
| - tab_restore_service_.reset(new TabRestoreService(this));
|
| - return tab_restore_service_.get();
|
| -}
|
| -
|
| history::TopSites* ProfileImpl::GetTopSites() {
|
| if (!top_sites_.get()) {
|
| top_sites_ = new history::TopSites(this);
|
| @@ -1242,10 +1209,6 @@ history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() {
|
| return top_sites_;
|
| }
|
|
|
| -void ProfileImpl::ResetTabRestoreService() {
|
| - tab_restore_service_.reset();
|
| -}
|
| -
|
| SpellCheckHost* ProfileImpl::GetSpellCheckHost() {
|
| return spellcheck_host_ready_ ? spellcheck_host_.get() : NULL;
|
| }
|
| @@ -1351,6 +1314,10 @@ void ProfileImpl::StopCreateSessionServiceTimer() {
|
| create_session_service_timer_.Stop();
|
| }
|
|
|
| +void ProfileImpl::EnsureSessionServiceCreated() {
|
| + SessionServiceFactory::GetForProfile(this);
|
| +}
|
| +
|
| TokenService* ProfileImpl::GetTokenService() {
|
| if (!token_service_.get()) {
|
| token_service_.reset(new TokenService());
|
|
|