diff options
author | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-24 00:50:07 +0000 |
---|---|---|
committer | nick@chromium.org <nick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-24 00:50:07 +0000 |
commit | 57d3d0a7f11b0042c9cd01c9124107ffd281cfe3 (patch) | |
tree | e821d4d42ec4fd15ab3378f70eb28a01b89cab93 /chrome | |
parent | 29463878184e9377f900771f7a05c4ed57288d6e (diff) | |
download | chromium_src-57d3d0a7f11b0042c9cd01c9124107ffd281cfe3.zip chromium_src-57d3d0a7f11b0042c9cd01c9124107ffd281cfe3.tar.gz chromium_src-57d3d0a7f11b0042c9cd01c9124107ffd281cfe3.tar.bz2 |
Personalization pointer tweak.
Review URL: http://codereview.chromium.org/4238
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/profile.cc | 14 | ||||
-rw-r--r-- | chrome/browser/profile.h | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 745b1a8..9ed5496 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -460,7 +460,7 @@ class OffTheRecordProfileImpl : public Profile, } #ifdef CHROME_PERSONALIZATION - virtual ProfilePersonalization GetProfilePersonalization() { + virtual ProfilePersonalization* GetProfilePersonalization() { return profile_->GetProfilePersonalization(); } #endif @@ -560,8 +560,7 @@ ProfileImpl::~ProfileImpl() { download_manager_ = NULL; #ifdef CHROME_PERSONALIZATION - Personalization::CleanupProfilePersonalization(personalization_); - personalization_ = NULL; + personalization_.reset(); #endif // Both HistoryService and WebDataService maintain threads for background @@ -875,9 +874,10 @@ void ProfileImpl::StopCreateSessionServiceTimer() { } #ifdef CHROME_PERSONALIZATION -ProfilePersonalization ProfileImpl::GetProfilePersonalization() { - if (!personalization_) - personalization_ = Personalization::CreateProfilePersonalization(this); - return personalization_; +ProfilePersonalization* ProfileImpl::GetProfilePersonalization() { + if (!personalization_.get()) + personalization_.reset( + Personalization::CreateProfilePersonalization(this)); + return personalization_.get(); } #endif diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index de7044e..09b0baf 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -174,7 +174,7 @@ class Profile { virtual BookmarkModel* GetBookmarkModel() = 0; #ifdef CHROME_PERSONALIZATION - virtual ProfilePersonalization GetProfilePersonalization() = 0; + virtual ProfilePersonalization* GetProfilePersonalization() = 0; #endif // Return whether 2 profiles are the same. 2 profiles are the same if they @@ -253,7 +253,7 @@ class ProfileImpl : public Profile { virtual SpellChecker* GetSpellChecker(); virtual void MarkAsCleanShutdown(); #ifdef CHROME_PERSONALIZATION - virtual ProfilePersonalization GetProfilePersonalization(); + virtual ProfilePersonalization* GetProfilePersonalization(); #endif private: @@ -261,7 +261,7 @@ class ProfileImpl : public Profile { friend class Profile; - ProfileImpl(const std::wstring& path); + explicit ProfileImpl(const std::wstring& path); void CreateWebDataService(); std::wstring GetPrefFilePath(); @@ -281,7 +281,7 @@ class ProfileImpl : public Profile { scoped_ptr<BookmarkModel> bookmark_bar_model_; #ifdef CHROME_PERSONALIZATION - ProfilePersonalization personalization_; + scoped_ptr<ProfilePersonalization> personalization_; #endif RequestContext* request_context_; |