| Index: components/translate/content/browser/content_translate_driver.cc
|
| diff --git a/components/translate/content/browser/content_translate_driver.cc b/components/translate/content/browser/content_translate_driver.cc
|
| index f2db0fb305491e7228a03634bf21800bb5c352ee..b650f31f7abefc2705ec87416cc24951128f096d 100644
|
| --- a/components/translate/content/browser/content_translate_driver.cc
|
| +++ b/components/translate/content/browser/content_translate_driver.cc
|
| @@ -5,7 +5,10 @@
|
| #include "components/translate/content/browser/content_translate_driver.h"
|
|
|
| #include "base/bind.h"
|
| +#include "base/location.h"
|
| #include "base/logging.h"
|
| +#include "base/single_thread_task_runner.h"
|
| +#include "base/thread_task_runner_handle.h"
|
| #include "components/translate/content/common/translate_messages.h"
|
| #include "components/translate/core/browser/translate_download_manager.h"
|
| #include "components/translate/core/browser/translate_manager.h"
|
| @@ -61,12 +64,10 @@ void ContentTranslateDriver::InitiateTranslation(const std::string& page_lang,
|
| // has finished.
|
| if (web_contents()->IsLoading() && attempt < max_reload_check_attempts_) {
|
| int backoff = attempt * kMaxTranslateLoadCheckAttempts;
|
| - base::MessageLoop::current()->PostDelayedTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
|
| FROM_HERE,
|
| base::Bind(&ContentTranslateDriver::InitiateTranslation,
|
| - weak_pointer_factory_.GetWeakPtr(),
|
| - page_lang,
|
| - attempt + 1),
|
| + weak_pointer_factory_.GetWeakPtr(), page_lang, attempt + 1),
|
| base::TimeDelta::FromMilliseconds(backoff));
|
| return;
|
| }
|
| @@ -197,7 +198,7 @@ void ContentTranslateDriver::NavigationEntryCommitted(
|
| // by WebContentsObservers is undefined and might result in the current
|
| // infobars being removed. Since the translation initiation process might add
|
| // an infobar, it must be done after that.
|
| - base::MessageLoop::current()->PostTask(
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&ContentTranslateDriver::InitiateTranslation,
|
| weak_pointer_factory_.GetWeakPtr(),
|
|
|