Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: chrome/browser/dom_ui/most_visited_handler.cc

Issue 342020: First of several patches to get rid of MessageLoop caching now that we have C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/most_visited_handler.cc
===================================================================
--- chrome/browser/dom_ui/most_visited_handler.cc (revision 30289)
+++ chrome/browser/dom_ui/most_visited_handler.cc (working copy)
@@ -9,11 +9,11 @@
#include "base/string_util.h"
#include "base/thread.h"
#include "base/values.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
#include "chrome/browser/dom_ui/dom_ui_favicon_source.h"
#include "chrome/browser/dom_ui/dom_ui_thumbnail_source.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/page_usage_data.h"
#include "chrome/browser/history/history.h"
#include "chrome/browser/profile.h"
@@ -55,19 +55,17 @@
GetMutableDictionary(prefs::kNTPMostVisitedURLsBlacklist);
pinned_urls_ = dom_ui->GetProfile()->GetPrefs()->
GetMutableDictionary(prefs::kNTPMostVisitedPinnedURLs);
- // Set up our sources for thumbnail and favicon data. Since we may be in
- // testing mode with no I/O thread, only add our handler when an I/O thread
- // exists. Ownership is passed to the ChromeURLDataManager.
- if (g_browser_process->io_thread()) {
- g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(&chrome_url_data_manager,
- &ChromeURLDataManager::AddDataSource,
- new DOMUIThumbnailSource(dom_ui->GetProfile())));
- g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(&chrome_url_data_manager,
- &ChromeURLDataManager::AddDataSource,
- new DOMUIFavIconSource(dom_ui->GetProfile())));
- }
+ // Set up our sources for thumbnail and favicon data.
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(&chrome_url_data_manager,
+ &ChromeURLDataManager::AddDataSource,
+ new DOMUIThumbnailSource(dom_ui->GetProfile())));
+ ChromeThread::PostTask(
+ ChromeThread::IO, FROM_HERE,
+ NewRunnableMethod(&chrome_url_data_manager,
+ &ChromeURLDataManager::AddDataSource,
+ new DOMUIFavIconSource(dom_ui->GetProfile())));
// Get notifications when history is cleared.
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,

Powered by Google App Engine
This is Rietveld 408576698