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

Unified Diff: ipc/ipc_logging.cc

Issue 2080423002: Remove calls to MessageLoop::current() in ipc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « ipc/ipc_logging.h ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_logging.cc
diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc
index 693c71d072b2e5b4aaaf4037cee4940e5b9de089..faf4a4341847edaef1db22633f29f015b3c075f1 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -16,11 +16,11 @@
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
-#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "ipc/ipc_message_utils.h"
@@ -50,7 +50,7 @@ Logging::Logging()
enabled_color_(false),
queue_invoke_later_pending_(false),
sender_(NULL),
- main_thread_(base::MessageLoop::current()),
+ main_thread_(base::ThreadTaskRunnerHandle::Get()),
consumer_(NULL) {
#if defined(OS_WIN)
// getenv triggers an unsafe warning. Simply check how big of a buffer
@@ -163,10 +163,10 @@ void Logging::OnPostDispatchMessage(const Message& message,
LogData data;
GenerateLogData(channel_id, message, &data, true);
- if (base::MessageLoop::current() == main_thread_) {
+ if (main_thread_->BelongsToCurrentThread()) {
Log(data);
} else {
- main_thread_->task_runner()->PostTask(
+ main_thread_->PostTask(
FROM_HERE, base::Bind(&Logging::Log, base::Unretained(this), data));
}
}
« no previous file with comments | « ipc/ipc_logging.h ('k') | ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698