Move the IconLoader to use the task scheduler.

This follows https://codereview.chromium.org/2953633002
This commit is contained in:
Yury Solovyov 2018-01-08 13:21:22 +03:00
parent b3743058c0
commit 49844b6e5b
5 changed files with 33 additions and 20 deletions

View file

@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/display/win/dpi.h"
@ -30,8 +31,10 @@ IconLoader::IconGroup IconLoader::GroupForFilepath(
}
// static
content::BrowserThread::ID IconLoader::ReadIconThreadID() {
return content::BrowserThread::FILE;
scoped_refptr<base::TaskRunner> IconLoader::GetReadIconTaskRunner() {
// Technically speaking, only a thread with COM is needed, not one that has
// a COM STA. However, this is what is available for now.
return base::CreateCOMSTATaskRunnerWithTraits(traits());
}
void IconLoader::ReadIcon() {