diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 16:56:23 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-09 16:56:23 +0000 |
commit | 71f381a8807aa40b5076d51f091528dac467ea09 (patch) | |
tree | 8ca1618dcf2a80f1e67717513a66757b21714108 /chrome/browser/dom_ui/history_ui.cc | |
parent | e84925d3e94486d97ba4c477b830ef2249cffff7 (diff) | |
download | chromium_src-71f381a8807aa40b5076d51f091528dac467ea09.zip chromium_src-71f381a8807aa40b5076d51f091528dac467ea09.tar.gz chromium_src-71f381a8807aa40b5076d51f091528dac467ea09.tar.bz2 |
Revert 74292 - Splits ChromeURLDataManager into 2 chunks:
. ChromeURLDataManager is no longer a singleton and is always used on
the UI thread. ChromeURLDataManager is now profile specific (you get
from the profile).
. ChromeURLDataManagerBackend handles the URLRequests and the
DataSources. ChromeURLDataManagerBackend is created by
ChromeURLRequestContext.
All DataSources are now profile specific. There were two that wanted
to be global, but have been converted.
BUG=52022 71868
TEST=none
Review URL: http://codereview.chromium.org/6286131
TBR=sky@chromium.org
Review URL: http://codereview.chromium.org/6461024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74294 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/history_ui.cc')
-rw-r--r-- | chrome/browser/dom_ui/history_ui.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc index 80be7d3..2013256 100644 --- a/chrome/browser/dom_ui/history_ui.cc +++ b/chrome/browser/dom_ui/history_ui.cc @@ -129,13 +129,16 @@ BrowsingHistoryHandler::~BrowsingHistoryHandler() { WebUIMessageHandler* BrowsingHistoryHandler::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, - Source<Profile>(profile->GetOriginalProfile())); + Source<Profile>(dom_ui->GetProfile()->GetOriginalProfile())); return WebUIMessageHandler::Attach(dom_ui); } @@ -385,7 +388,12 @@ HistoryUI::HistoryUI(TabContents* contents) : DOMUI(contents) { HistoryUIHTMLSource* html_source = new HistoryUIHTMLSource(); // Set up the chrome://history/ source. - contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + NewRunnableMethod( + ChromeURLDataManager::GetInstance(), + &ChromeURLDataManager::AddDataSource, + make_scoped_refptr(html_source))); } // static |