summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 16:58:20 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 16:58:20 +0000
commitf4412a888519d241a603e8a4b7bc36db1fda4851 (patch)
treee1bf08cff915030e3e1a5e0fa3d8ab0658643d7f /base
parentcec72d466fb60bfece4c96c9e88d0a206f01e071 (diff)
downloadchromium_src-f4412a888519d241a603e8a4b7bc36db1fda4851.zip
chromium_src-f4412a888519d241a603e8a4b7bc36db1fda4851.tar.gz
chromium_src-f4412a888519d241a603e8a4b7bc36db1fda4851.tar.bz2
Switch over to base::Bind for base/debug/trace_event_unittests and base/files/*.
Review URL: http://codereview.chromium.org/8115013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/debug/trace_event_unittest.cc11
-rw-r--r--base/files/file_path_watcher_browsertest.cc6
-rw-r--r--base/files/file_path_watcher_linux.cc13
-rw-r--r--base/files/file_path_watcher_mac.cc3
4 files changed, 17 insertions, 16 deletions
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc
index c0c9380..0ccf440 100644
--- a/base/debug/trace_event_unittest.cc
+++ b/base/debug/trace_event_unittest.cc
@@ -682,8 +682,7 @@ TEST_F(TraceEventTestFixture, DataCapturedOnThread) {
thread.Start();
thread.message_loop()->PostTask(
- FROM_HERE, NewRunnableFunction(&TraceWithAllMacroVariants,
- &task_complete_event));
+ FROM_HERE, base::Bind(&TraceWithAllMacroVariants, &task_complete_event));
task_complete_event.Wait();
thread.Stop();
@@ -705,8 +704,8 @@ TEST_F(TraceEventTestFixture, DataCapturedManyThreads) {
task_complete_events[i] = new WaitableEvent(false, false);
threads[i]->Start();
threads[i]->message_loop()->PostTask(
- FROM_HERE, NewRunnableFunction(&TraceManyInstantEvents,
- i, num_events, task_complete_events[i]));
+ FROM_HERE, base::Bind(&TraceManyInstantEvents,
+ i, num_events, task_complete_events[i]));
}
for (int i = 0; i < num_threads; i++) {
@@ -748,8 +747,8 @@ TEST_F(TraceEventTestFixture, ThreadNames) {
threads[i]->Start();
thread_ids[i] = threads[i]->thread_id();
threads[i]->message_loop()->PostTask(
- FROM_HERE, NewRunnableFunction(&TraceManyInstantEvents,
- i, num_events, task_complete_events[i]));
+ FROM_HERE, base::Bind(&TraceManyInstantEvents,
+ i, num_events, task_complete_events[i]));
}
for (int i = 0; i < num_threads; i++) {
task_complete_events[i]->Wait();
diff --git a/base/files/file_path_watcher_browsertest.cc b/base/files/file_path_watcher_browsertest.cc
index e59f702..0dd1b69 100644
--- a/base/files/file_path_watcher_browsertest.cc
+++ b/base/files/file_path_watcher_browsertest.cc
@@ -14,6 +14,7 @@
#endif
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -47,9 +48,8 @@ class NotificationCollector
// Called from the file thread by the delegates.
void OnChange(TestDelegate* delegate) {
loop_->PostTask(FROM_HERE,
- NewRunnableMethod(this,
- &NotificationCollector::RecordChange,
- make_scoped_refptr(delegate)));
+ base::Bind(&NotificationCollector::RecordChange, this,
+ make_scoped_refptr(delegate)));
}
void Register(TestDelegate* delegate) {
diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc
index c85202c..ab4cd41 100644
--- a/base/files/file_path_watcher_linux.cc
+++ b/base/files/file_path_watcher_linux.cc
@@ -16,6 +16,7 @@
#include <utility>
#include <vector>
+#include "base/bind.h"
#include "base/eintr_wrapper.h"
#include "base/file_path.h"
#include "base/file_util.h"
@@ -317,12 +318,12 @@ void FilePathWatcherImpl::OnFilePathChanged(
if (!message_loop()->BelongsToCurrentThread()) {
// Switch to message_loop_ to access watches_ safely.
message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this,
- &FilePathWatcherImpl::OnFilePathChanged,
- fired_watch,
- child,
- created,
- is_directory));
+ base::Bind(&FilePathWatcherImpl::OnFilePathChanged,
+ this,
+ fired_watch,
+ child,
+ created,
+ is_directory));
return;
}
diff --git a/base/files/file_path_watcher_mac.cc b/base/files/file_path_watcher_mac.cc
index c3b9351..3413e8a 100644
--- a/base/files/file_path_watcher_mac.cc
+++ b/base/files/file_path_watcher_mac.cc
@@ -10,6 +10,7 @@
#include <vector>
+#include "base/bind.h"
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/message_loop_proxy.h"
@@ -463,7 +464,7 @@ void FilePathWatcherImpl::Cancel() {
}
if (!proxy->BelongsToCurrentThread()) {
proxy->PostTask(FROM_HERE,
- NewRunnableMethod(this, &FilePathWatcherImpl::Cancel));
+ base::Bind(&FilePathWatcherImpl::Cancel, this));
return;
}
CancelOnMessageLoopThread();