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

Unified Diff: chrome/browser/crash_handler_host_linux.cc

Issue 8536055: base::Bind() conversion for crash handler/uploader. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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 | « no previous file | chrome/browser/crash_upload_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/crash_handler_host_linux.cc
diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc
index d3e63fe6bc4ce0693afe04b0e5dd1b934e60a477..2d1ac2f21fcbad3a656cdb8f45c3187bc44d5f2c 100644
--- a/chrome/browser/crash_handler_host_linux.cc
+++ b/chrome/browser/crash_handler_host_linux.cc
@@ -10,6 +10,8 @@
#include <sys/syscall.h>
#include <unistd.h>
+#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/eintr_wrapper.h"
#include "base/file_path.h"
#include "base/format_macros.h"
@@ -21,7 +23,6 @@
#include "base/rand_util.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
-#include "base/task.h"
#include "base/threading/thread.h"
#include "breakpad/src/client/linux/handler/exception_handler.h"
#include "breakpad/src/client/linux/minidump_writer/linux_dumper.h"
@@ -60,8 +61,8 @@ void CrashDumpTask(CrashHandlerHostLinux* handler, BreakpadInfo* info) {
// Since classes derived from CrashHandlerHostLinux are singletons, it's only
// destroyed at the end of the processes lifetime, which is greater in span than
-// the lifetime of the IO message loop.
-DISABLE_RUNNABLE_METHOD_REFCOUNT(CrashHandlerHostLinux);
+// the lifetime of the IO message loop. Thus, all calls to base::Bind() use
+// non-refcounted pointers.
CrashHandlerHostLinux::CrashHandlerHostLinux()
: shutting_down_(false) {
@@ -83,7 +84,7 @@ CrashHandlerHostLinux::CrashHandlerHostLinux()
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this, &CrashHandlerHostLinux::Init));
+ base::Bind(&CrashHandlerHostLinux::Init, base::Unretained(this)));
}
CrashHandlerHostLinux::~CrashHandlerHostLinux() {
@@ -317,12 +318,12 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
- NewRunnableMethod(this,
- &CrashHandlerHostLinux::WriteDumpFile,
- info,
- crashing_pid,
- crash_context,
- signal_fd));
+ base::Bind(&CrashHandlerHostLinux::WriteDumpFile,
+ base::Unretained(this),
+ info,
+ crashing_pid,
+ crash_context,
+ signal_fd));
}
void CrashHandlerHostLinux::WriteDumpFile(BreakpadInfo* info,
@@ -356,10 +357,10 @@ void CrashHandlerHostLinux::WriteDumpFile(BreakpadInfo* info,
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this,
- &CrashHandlerHostLinux::QueueCrashDumpTask,
- info,
- signal_fd));
+ base::Bind(&CrashHandlerHostLinux::QueueCrashDumpTask,
+ base::Unretained(this),
+ info,
+ signal_fd));
}
void CrashHandlerHostLinux::QueueCrashDumpTask(BreakpadInfo* info,
@@ -379,7 +380,7 @@ void CrashHandlerHostLinux::QueueCrashDumpTask(BreakpadInfo* info,
uploader_thread_->message_loop()->PostTask(
FROM_HERE,
- NewRunnableFunction(&CrashDumpTask, this, info));
+ base::Bind(&CrashDumpTask, base::Unretained(this), info));
}
void CrashHandlerHostLinux::WillDestroyCurrentMessageLoop() {
« no previous file with comments | « no previous file | chrome/browser/crash_upload_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698