Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Unified Diff: extensions/browser/api/runtime/runtime_api.cc

Issue 2036863002: Remove use of deprecated MessageLoop methods in extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: extensions/browser/api/runtime/runtime_api.cc
diff --git a/extensions/browser/api/runtime/runtime_api.cc b/extensions/browser/api/runtime/runtime_api.cc
index 08eed6ef157af9bf9a74ac3cbd0d81e9e60dd71c..79e7c97e48c2a502739687c5e90c07e38c54e166 100644
--- a/extensions/browser/api/runtime/runtime_api.cc
+++ b/extensions/browser/api/runtime/runtime_api.cc
@@ -8,9 +8,12 @@
#include <utility>
#include "base/lazy_instance.h"
+#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "base/version.h"
#include "content/public/browser/browser_context.h"
@@ -194,7 +197,7 @@ void RuntimeAPI::OnExtensionLoaded(content::BrowserContext* browser_context,
const Extension* extension) {
base::Version previous_version;
if (ReadPendingOnInstallInfoFromPref(extension->id(), &previous_version)) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&RuntimeEventRouter::DispatchOnInstalledEvent,
browser_context_, extension->id(), previous_version, false));
@@ -205,13 +208,10 @@ void RuntimeAPI::OnExtensionLoaded(content::BrowserContext* browser_context,
return;
// Dispatch the onInstalled event with reason "chrome_update".
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&RuntimeEventRouter::DispatchOnInstalledEvent,
- browser_context_,
- extension->id(),
- Version(),
- true));
+ browser_context_, extension->id(), Version(), true));
}
void RuntimeAPI::OnExtensionWillBeInstalled(
« no previous file with comments | « extensions/browser/api/management/management_api.cc ('k') | extensions/browser/api/serial/serial_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698