diff options
author | skyostil <skyostil@chromium.org> | 2015-06-05 12:53:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-05 19:53:37 +0000 |
commit | 95082a6a47108c4e20a77cc224172a293065ab05 (patch) | |
tree | c34e72f82cf4742097c92a500fabd9af0f251cef /content/browser/plugin_service_impl.cc | |
parent | 4e95f763c7f52664c94373b7d9fcc0ed96c7f019 (diff) | |
download | chromium_src-95082a6a47108c4e20a77cc224172a293065ab05.zip chromium_src-95082a6a47108c4e20a77cc224172a293065ab05.tar.gz chromium_src-95082a6a47108c4e20a77cc224172a293065ab05.tar.bz2 |
content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs
This patch was mostly autogenerated with
https://codereview.chromium.org/1010073002/.
BUG=465354
TBR=nick@chromium.org
Committed: https://crrev.com/422456f9d53f0bf936a64f21a1463fd0abd3df84
Cr-Commit-Position: refs/heads/master@{#333081}
Review URL: https://codereview.chromium.org/1159623009
Cr-Commit-Position: refs/heads/master@{#333112}
Diffstat (limited to 'content/browser/plugin_service_impl.cc')
-rw-r--r-- | content/browser/plugin_service_impl.cc | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index ed7f64c..678171c 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -8,9 +8,9 @@ #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/files/file_path.h" -#include "base/message_loop/message_loop.h" -#include "base/message_loop/message_loop_proxy.h" +#include "base/location.h" #include "base/metrics/histogram.h" +#include "base/single_thread_task_runner.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/waitable_event.h" @@ -125,10 +125,10 @@ void NotifyPluginDirChanged(const base::FilePath& path, bool error) { } #endif -void ForwardCallback(base::MessageLoopProxy* target_loop, +void ForwardCallback(base::SingleThreadTaskRunner* target_task_runner, const PluginService::GetPluginsCallback& callback, const std::vector<WebPluginInfo>& plugins) { - target_loop->PostTask(FROM_HERE, base::Bind(callback, plugins)); + target_task_runner->PostTask(FROM_HERE, base::Bind(callback, plugins)); } } // namespace @@ -589,45 +589,43 @@ base::string16 PluginServiceImpl::GetPluginDisplayNameByPath( } void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) { - scoped_refptr<base::MessageLoopProxy> target_loop( - base::MessageLoop::current()->message_loop_proxy()); + scoped_refptr<base::SingleThreadTaskRunner> target_task_runner( + base::ThreadTaskRunnerHandle::Get()); if (LoadPluginListInProcess()) { - BrowserThread::GetBlockingPool()-> - PostSequencedWorkerTaskWithShutdownBehavior( - plugin_list_token_, - FROM_HERE, + BrowserThread::GetBlockingPool() + ->PostSequencedWorkerTaskWithShutdownBehavior( + plugin_list_token_, FROM_HERE, base::Bind(&PluginServiceImpl::GetPluginsInternal, - base::Unretained(this), - target_loop, callback), - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); + base::Unretained(this), target_task_runner, callback), + base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); return; } #if defined(OS_POSIX) - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, base::Bind(&PluginServiceImpl::GetPluginsOnIOThread, - base::Unretained(this), target_loop, callback)); + base::Unretained(this), target_task_runner, callback)); #else NOTREACHED(); #endif } void PluginServiceImpl::GetPluginsInternal( - base::MessageLoopProxy* target_loop, - const PluginService::GetPluginsCallback& callback) { + base::SingleThreadTaskRunner* target_task_runner, + const PluginService::GetPluginsCallback& callback) { DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( plugin_list_token_)); std::vector<WebPluginInfo> plugins; PluginList::Singleton()->GetPlugins(&plugins, NPAPIPluginsSupported()); - target_loop->PostTask(FROM_HERE, - base::Bind(callback, plugins)); + target_task_runner->PostTask(FROM_HERE, base::Bind(callback, plugins)); } #if defined(OS_POSIX) void PluginServiceImpl::GetPluginsOnIOThread( - base::MessageLoopProxy* target_loop, + base::SingleThreadTaskRunner* target_task_runner, const GetPluginsCallback& callback) { DCHECK_CURRENTLY_ON(BrowserThread::IO); @@ -637,8 +635,8 @@ void PluginServiceImpl::GetPluginsOnIOThread( if (!plugin_loader_.get()) plugin_loader_ = new PluginLoaderPosix; - plugin_loader_->GetPlugins( - base::Bind(&ForwardCallback, make_scoped_refptr(target_loop), callback)); + plugin_loader_->GetPlugins(base::Bind( + &ForwardCallback, make_scoped_refptr(target_task_runner), callback)); } #endif |