summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/downloads_dom_handler.cc7
-rw-r--r--chrome/browser/dom_ui/downloads_ui.cc2
-rw-r--r--chrome/browser/dom_ui/filebrowse_ui.cc4
-rw-r--r--chrome/browser/dom_ui/history_ui.cc4
-rw-r--r--chrome/browser/dom_ui/most_visited_handler.cc18
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc16
-rw-r--r--chrome/browser/dom_ui/print_ui.cc2
7 files changed, 20 insertions, 33 deletions
diff --git a/chrome/browser/dom_ui/downloads_dom_handler.cc b/chrome/browser/dom_ui/downloads_dom_handler.cc
index 028b21a..7e8d1a0 100644
--- a/chrome/browser/dom_ui/downloads_dom_handler.cc
+++ b/chrome/browser/dom_ui/downloads_dom_handler.cc
@@ -49,9 +49,10 @@ DownloadsDOMHandler::DownloadsDOMHandler(DownloadManager* dlm)
// Create our fileicon data source.
ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
- NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
- &ChromeURLDataManager::AddDataSource,
- new FileIconSource()));
+ NewRunnableMethod(
+ Singleton<ChromeURLDataManager>::get(),
+ &ChromeURLDataManager::AddDataSource,
+ make_scoped_refptr(new FileIconSource())));
}
DownloadsDOMHandler::~DownloadsDOMHandler() {
diff --git a/chrome/browser/dom_ui/downloads_ui.cc b/chrome/browser/dom_ui/downloads_ui.cc
index e36654f..f12e812 100644
--- a/chrome/browser/dom_ui/downloads_ui.cc
+++ b/chrome/browser/dom_ui/downloads_ui.cc
@@ -133,7 +133,7 @@ DownloadsUI::DownloadsUI(TabContents* contents) : DOMUI(contents) {
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- html_source));
+ make_scoped_refptr(html_source)));
}
// static
diff --git a/chrome/browser/dom_ui/filebrowse_ui.cc b/chrome/browser/dom_ui/filebrowse_ui.cc
index 48ed389..13b6539 100644
--- a/chrome/browser/dom_ui/filebrowse_ui.cc
+++ b/chrome/browser/dom_ui/filebrowse_ui.cc
@@ -157,7 +157,7 @@ DOMMessageHandler* FilebrowseHandler::Attach(DOMUI* dom_ui) {
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- new DOMUIFavIconSource(dom_ui->GetProfile())));
+ make_scoped_refptr(new DOMUIFavIconSource(dom_ui->GetProfile()))));
profile_ = dom_ui->GetProfile();
return DOMMessageHandler::Attach(dom_ui);
}
@@ -323,5 +323,5 @@ FileBrowseUI::FileBrowseUI(TabContents* contents) : DOMUI(contents) {
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- html_source));
+ make_scoped_refptr(html_source)));
}
diff --git a/chrome/browser/dom_ui/history_ui.cc b/chrome/browser/dom_ui/history_ui.cc
index dce9cdb..a97992b 100644
--- a/chrome/browser/dom_ui/history_ui.cc
+++ b/chrome/browser/dom_ui/history_ui.cc
@@ -116,7 +116,7 @@ DOMMessageHandler* BrowsingHistoryHandler::Attach(DOMUI* dom_ui) {
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- new DOMUIFavIconSource(dom_ui->GetProfile())));
+ make_scoped_refptr(new DOMUIFavIconSource(dom_ui->GetProfile()))));
// Get notifications when history is cleared.
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
@@ -371,7 +371,7 @@ HistoryUI::HistoryUI(TabContents* contents) : DOMUI(contents) {
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- html_source));
+ make_scoped_refptr(html_source)));
}
// static
diff --git a/chrome/browser/dom_ui/most_visited_handler.cc b/chrome/browser/dom_ui/most_visited_handler.cc
index 7dc5569..8901d3f9 100644
--- a/chrome/browser/dom_ui/most_visited_handler.cc
+++ b/chrome/browser/dom_ui/most_visited_handler.cc
@@ -59,24 +59,18 @@ DOMMessageHandler* MostVisitedHandler::Attach(DOMUI* dom_ui) {
// Set up our sources for thumbnail and favicon data.
DOMUIThumbnailSource* thumbnail_src =
new DOMUIThumbnailSource(dom_ui->GetProfile());
- bool posted = ChromeThread::PostTask(
+ ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
- &ChromeURLDataManager::AddDataSource, thumbnail_src));
- if (!posted) {
- thumbnail_src->AddRef();
- thumbnail_src->Release(); // Keep Valgrind happy in unit tests.
- }
+ &ChromeURLDataManager::AddDataSource,
+ make_scoped_refptr(thumbnail_src)));
DOMUIFavIconSource* favicon_src = new DOMUIFavIconSource(dom_ui->GetProfile());
- posted = ChromeThread::PostTask(
+ ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(Singleton<ChromeURLDataManager>::get(),
- &ChromeURLDataManager::AddDataSource, favicon_src));
- if (!posted) {
- favicon_src->AddRef();
- favicon_src->Release(); // Keep Valgrind happy in unit tests.
- }
+ &ChromeURLDataManager::AddDataSource,
+ make_scoped_refptr(favicon_src)));
// Get notifications when history is cleared.
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index b11d7b4..a69a4ba 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -483,16 +483,12 @@ NewTabUI::NewTabUI(TabContents* contents)
InitializeCSSCaches();
NewTabHTMLSource* html_source =
new NewTabHTMLSource(GetProfile()->GetOriginalProfile());
- bool posted = ChromeThread::PostTask(
+ ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- html_source));
- if (!posted) {
- html_source->AddRef();
- html_source->Release(); // Keep Valgrind happy in tests.
- }
+ make_scoped_refptr(html_source)));
if (!GetProfile()->IsOffTheRecord()) {
AddMessageHandler((new ShownSectionsHandler())->Attach(this));
@@ -544,16 +540,12 @@ void NewTabUI::Observe(NotificationType type,
void NewTabUI::InitializeCSSCaches() {
DOMUIThemeSource* theme = new DOMUIThemeSource(GetProfile());
- bool posted = ChromeThread::PostTask(
+ ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- theme));
- if (!posted) {
- theme->AddRef();
- theme->Release(); // Keep Valgrind happy in tests.
- }
+ make_scoped_refptr(theme)));
}
// static
diff --git a/chrome/browser/dom_ui/print_ui.cc b/chrome/browser/dom_ui/print_ui.cc
index 31146ab..5aea8d7 100644
--- a/chrome/browser/dom_ui/print_ui.cc
+++ b/chrome/browser/dom_ui/print_ui.cc
@@ -32,7 +32,7 @@ PrintUI::PrintUI(TabContents* contents) : DOMUI(contents) {
NewRunnableMethod(
Singleton<ChromeURLDataManager>::get(),
&ChromeURLDataManager::AddDataSource,
- html_source));
+ make_scoped_refptr(html_source)));
}
////////////////////////////////////////////////////////////////////////////////