create iconmanager as singleton class and cleanup code (#1)
* create iconmanager as singleton class and cleanup code
This commit is contained in:
parent
1b3cd87fc9
commit
b25b141642
15 changed files with 275 additions and 216 deletions
|
@ -18,15 +18,14 @@ IconLoader::IconLoader(const base::FilePath& file_path,
|
|||
icon_size_(size),
|
||||
delegate_(delegate) {}
|
||||
|
||||
IconLoader::~IconLoader() {
|
||||
}
|
||||
IconLoader::~IconLoader() {}
|
||||
|
||||
void IconLoader::Start() {
|
||||
target_task_runner_ = base::ThreadTaskRunnerHandle::Get();
|
||||
|
||||
BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE,
|
||||
base::Bind(&IconLoader::ReadGroup, this),
|
||||
base::Bind(&IconLoader::OnReadGroup, this));
|
||||
base::Bind(&IconLoader::ReadGroup, this),
|
||||
base::Bind(&IconLoader::OnReadGroup, this));
|
||||
}
|
||||
|
||||
void IconLoader::ReadGroup() {
|
||||
|
@ -37,7 +36,7 @@ void IconLoader::OnReadGroup() {
|
|||
if (IsIconMutableFromFilepath(file_path_) ||
|
||||
!delegate_->OnGroupLoaded(this, group_)) {
|
||||
BrowserThread::PostTask(ReadIconThreadID(), FROM_HERE,
|
||||
base::Bind(&IconLoader::ReadIcon, this));
|
||||
base::Bind(&IconLoader::ReadIcon, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue