| Index: content/browser/webui/url_data_manager.cc
|
| diff --git a/content/browser/webui/url_data_manager.cc b/content/browser/webui/url_data_manager.cc
|
| index a9ec107df4631f18239851dc13f9187d8475abe2..0a482ad8ae00ea890634668dfe676ebc7375e76f 100644
|
| --- a/content/browser/webui/url_data_manager.cc
|
| +++ b/content/browser/webui/url_data_manager.cc
|
| @@ -9,6 +9,7 @@
|
| #include <vector>
|
|
|
| #include "base/bind.h"
|
| +#include "base/bind_helpers.h"
|
| #include "base/lazy_instance.h"
|
| #include "base/memory/ref_counted_memory.h"
|
| #include "base/message_loop/message_loop.h"
|
| @@ -46,6 +47,14 @@ static void AddDataSourceOnIOThread(
|
| data_source.get());
|
| }
|
|
|
| +static void UpdateWebUIDataSourceOnIOThread(
|
| + ResourceContext* resource_context,
|
| + std::string source_name,
|
| + const base::DictionaryValue* update) {
|
| + GetURLDataManagerForResourceContext(resource_context)
|
| + ->UpdateWebUIDataSource(source_name, *update);
|
| +}
|
| +
|
| } // namespace
|
|
|
| // static
|
| @@ -67,6 +76,17 @@ void URLDataManager::AddDataSource(URLDataSourceImpl* source) {
|
| make_scoped_refptr(source)));
|
| }
|
|
|
| +void URLDataManager::UpdateWebUIDataSource(
|
| + const std::string& source_name,
|
| + std::unique_ptr<base::DictionaryValue> update) {
|
| + DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| + BrowserThread::PostTask(
|
| + BrowserThread::IO, FROM_HERE,
|
| + base::Bind(&UpdateWebUIDataSourceOnIOThread,
|
| + browser_context_->GetResourceContext(), source_name,
|
| + base::Owned(update.release())));
|
| +}
|
| +
|
| // static
|
| void URLDataManager::DeleteDataSources() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| @@ -122,6 +142,14 @@ void URLDataManager::AddWebUIDataSource(BrowserContext* browser_context,
|
| GetFromBrowserContext(browser_context)->AddDataSource(impl);
|
| }
|
|
|
| +void URLDataManager::UpdateWebUIDataSource(
|
| + BrowserContext* browser_context,
|
| + const std::string& source_name,
|
| + std::unique_ptr<base::DictionaryValue> update) {
|
| + GetFromBrowserContext(browser_context)
|
| + ->UpdateWebUIDataSource(source_name, std::move(update));
|
| +}
|
| +
|
| // static
|
| bool URLDataManager::IsScheduledForDeletion(
|
| const URLDataSourceImpl* data_source) {
|
|
|