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

Unified Diff: ipc/ipc_logging.cc

Issue 8539036: base:Bind: Convert ipc/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 9 years, 1 month 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_channel_win.cc ('k') | ipc/ipc_sync_channel.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 f6e91c44f65bfaa7ee491231e03edb668b2ee005..9f615bd7a38c24fc1d9f47256a3ca5fef99e9468 100644
--- a/ipc/ipc_logging.cc
+++ b/ipc/ipc_logging.cc
@@ -8,6 +8,8 @@
#define IPC_MESSAGE_MACROS_LOG_ENABLED
#endif
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/location.h"
#include "base/logging.h"
@@ -29,10 +31,6 @@
using base::Time;
-// IPC::Logging is allocated as a singleton, so we don't need any kind of
-// special retention program.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(IPC::Logging);
-
namespace IPC {
const int kLogSendDelayMs = 100;
@@ -163,8 +161,8 @@ void Logging::OnPostDispatchMessage(const Message& message,
if (MessageLoop::current() == main_thread_) {
Log(data);
} else {
- main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &Logging::Log, data));
+ main_thread_->PostTask(
+ FROM_HERE, base::Bind(&Logging::Log, base::Unretained(this), data));
}
}
@@ -233,8 +231,9 @@ void Logging::Log(const LogData& data) {
queued_logs_.push_back(data);
if (!queue_invoke_later_pending_) {
queue_invoke_later_pending_ = true;
- MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod(
- this, &Logging::OnSendLogs), kLogSendDelayMs);
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE, base::Bind(&Logging::OnSendLogs, base::Unretained(this)),
+ kLogSendDelayMs);
}
}
}
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_sync_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698