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

Unified Diff: webkit/tools/test_shell/simple_file_writer.cc

Issue 8215002: base::Bind: Cleanup in test_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac build fix. Created 9 years, 2 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: webkit/tools/test_shell/simple_file_writer.cc
diff --git a/webkit/tools/test_shell/simple_file_writer.cc b/webkit/tools/test_shell/simple_file_writer.cc
index 8c07ccd08be004cf52d42686f856ac79a7b28911..595669604a796c5b9d4c7c799c2cb9f18989f042 100644
--- a/webkit/tools/test_shell/simple_file_writer.cc
+++ b/webkit/tools/test_shell/simple_file_writer.cc
@@ -4,6 +4,7 @@
#include "webkit/tools/test_shell/simple_file_writer.h"
+#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop_proxy.h"
#include "net/url_request/url_request_context.h"
@@ -45,8 +46,9 @@ class SimpleFileWriter::IOThreadProxy
void Truncate(const GURL& path, int64 offset) {
if (!io_thread_->BelongsToCurrentThread()) {
- io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::Truncate, path, offset));
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::Truncate, this, path, offset));
return;
}
DCHECK(!operation_);
@@ -56,8 +58,9 @@ class SimpleFileWriter::IOThreadProxy
void Write(const GURL& path, const GURL& blob_url, int64 offset) {
if (!io_thread_->BelongsToCurrentThread()) {
- io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::Write, path, blob_url, offset));
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::Write, this, path, blob_url, offset));
return;
}
DCHECK(request_context_);
@@ -68,8 +71,9 @@ class SimpleFileWriter::IOThreadProxy
void Cancel() {
if (!io_thread_->BelongsToCurrentThread()) {
- io_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::Cancel));
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::Cancel, this));
return;
}
if (!operation_) {
@@ -132,8 +136,9 @@ class SimpleFileWriter::IOThreadProxy
void DidSucceed() {
if (!main_thread_->BelongsToCurrentThread()) {
- main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::DidSucceed));
+ main_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::DidSucceed, this));
return;
}
if (simple_writer_)
@@ -142,8 +147,9 @@ class SimpleFileWriter::IOThreadProxy
void DidFail(base::PlatformFileError error_code) {
if (!main_thread_->BelongsToCurrentThread()) {
- main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::DidFail, error_code));
+ main_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::DidFail, this, error_code));
return;
}
if (simple_writer_)
@@ -152,8 +158,9 @@ class SimpleFileWriter::IOThreadProxy
void DidWrite(int64 bytes, bool complete) {
if (!main_thread_->BelongsToCurrentThread()) {
- main_thread_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &IOThreadProxy::DidWrite, bytes, complete));
+ main_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&IOThreadProxy::DidWrite, this, bytes, complete));
return;
}
if (simple_writer_)

Powered by Google App Engine
This is Rietveld 408576698