Index: chrome/browser/profiles/profile_io_data.cc |
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
index 3b7e943bf469373a538d441e57b258381d59e18d..ed8662d8e24bc1a1fa72a1eaa95a40529c9657ba 100644 |
--- a/chrome/browser/profiles/profile_io_data.cc |
+++ b/chrome/browser/profiles/profile_io_data.cc |
@@ -18,6 +18,7 @@ |
#include "chrome/browser/net/pref_proxy_config_service.h" |
#include "chrome/browser/net/proxy_service_factory.h" |
#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/prefs/pref_member.h" |
#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_switches.h" |
@@ -187,9 +188,17 @@ ProfileIOData::ProfileParams::ProfileParams() |
profile_id(Profile::kInvalidProfileId) {} |
ProfileIOData::ProfileParams::~ProfileParams() {} |
-ProfileIOData::ProfileIOData(bool is_incognito) |
- : initialized_(false) { |
+ProfileIOData::ProfileIOData(Profile* profile, bool is_incognito) |
+ : enable_referrers_(new BooleanPrefMember()), |
+ initialized_(false) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ // We can't lazily initialize |enable_referrers_| because it is used on the UI |
+ // thread as well as the IO thread, which might lead to race conditions |
+ // otherwise. |
+ enable_referrers_->Init(prefs::kEnableReferrers, |
+ profile->GetPrefs(), |
+ NULL); |
+ enable_referrers_->MoveToThread(BrowserThread::IO); |
} |
ProfileIOData::~ProfileIOData() { |
@@ -271,3 +280,7 @@ void ProfileIOData::ApplyProfileParamsToContext( |
context->set_extension_info_map(profile_params.extension_info_map); |
context->set_prerender_manager(profile_params.prerender_manager); |
} |
+ |
+void ProfileIOData::Shutdown() { |
willchan no longer on Chromium
2011/04/12 16:34:18
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::U
Bernhard Bauer
2011/04/13 11:17:20
Done.
|
+ enable_referrers_->Destroy(); |
+} |