| Index: chrome/browser/ui/webui/chrome_url_data_manager.cc
|
| diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.cc b/chrome/browser/ui/webui/chrome_url_data_manager.cc
|
| index 16f8647ad4be79cc7ad163f400cb22ff972c93a9..43ede09d0d6543b05d41e0ca53e80e83383045cc 100644
|
| --- a/chrome/browser/ui/webui/chrome_url_data_manager.cc
|
| +++ b/chrome/browser/ui/webui/chrome_url_data_manager.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/i18n/rtl.h"
|
| #include "base/memory/ref_counted_memory.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop.h"
|
| #include "base/string_util.h"
|
| #include "base/synchronization/lock.h"
|
| @@ -31,16 +32,15 @@ ChromeURLDataManager::DataSources* ChromeURLDataManager::data_sources_ = NULL;
|
|
|
| // Invoked on the IO thread to do the actual adding of the DataSource.
|
| static void AddDataSourceOnIOThread(
|
| - scoped_refptr<net::URLRequestContextGetter> context_getter,
|
| + const base::Callback<ChromeURLDataManagerBackend*(void)>& backend,
|
| scoped_refptr<ChromeURLDataManager::DataSource> data_source) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - static_cast<ChromeURLRequestContext*>(
|
| - context_getter->GetURLRequestContext())->
|
| - chrome_url_data_manager_backend()->AddDataSource(data_source.get());
|
| + backend.Run()->AddDataSource(data_source.get());
|
| }
|
|
|
| -ChromeURLDataManager::ChromeURLDataManager(Profile* profile)
|
| - : profile_(profile) {
|
| +ChromeURLDataManager::ChromeURLDataManager(
|
| + const base::Callback<ChromeURLDataManagerBackend*(void)>& backend)
|
| + : backend_(backend) {
|
| }
|
|
|
| ChromeURLDataManager::~ChromeURLDataManager() {
|
| @@ -51,7 +51,7 @@ void ChromeURLDataManager::AddDataSource(DataSource* source) {
|
| BrowserThread::PostTask(
|
| BrowserThread::IO, FROM_HERE,
|
| NewRunnableFunction(AddDataSourceOnIOThread,
|
| - make_scoped_refptr(profile_->GetRequestContext()),
|
| + backend_,
|
| make_scoped_refptr(source)));
|
| }
|
|
|
|
|