summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/history2_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui/history2_ui.cc')
-rw-r--r--chrome/browser/dom_ui/history2_ui.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/history2_ui.cc b/chrome/browser/dom_ui/history2_ui.cc
index aaf7fdc..bdfe536 100644
--- a/chrome/browser/dom_ui/history2_ui.cc
+++ b/chrome/browser/dom_ui/history2_ui.cc
@@ -129,9 +129,12 @@ BrowsingHistoryHandler2::~BrowsingHistoryHandler2() {
WebUIMessageHandler* BrowsingHistoryHandler2::Attach(DOMUI* dom_ui) {
// Create our favicon data source.
- Profile* profile = dom_ui->GetProfile();
- profile->GetChromeURLDataManager()->AddDataSource(
- new WebUIFavIconSource(profile));
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ ChromeURLDataManager::GetInstance(),
+ &ChromeURLDataManager::AddDataSource,
+ make_scoped_refptr(new WebUIFavIconSource(dom_ui->GetProfile()))));
// Get notifications when history is cleared.
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
@@ -397,7 +400,12 @@ HistoryUI2::HistoryUI2(TabContents* contents) : DOMUI(contents) {
HistoryUIHTMLSource2* html_source = new HistoryUIHTMLSource2();
// Set up the chrome://history2/ source.
- contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ NewRunnableMethod(
+ ChromeURLDataManager::GetInstance(),
+ &ChromeURLDataManager::AddDataSource,
+ make_scoped_refptr(html_source)));
}
// static