| Index: base/memory/weak_ptr_unittest.cc
|
| diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc
|
| index f9f8b3e916a27bcbfaf7a72a28ae311b9ac08313..4b73d1791646b176254147dc4c8ac3aceb479255 100644
|
| --- a/base/memory/weak_ptr_unittest.cc
|
| +++ b/base/memory/weak_ptr_unittest.cc
|
| @@ -2,6 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "base/bind.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -22,7 +23,7 @@ class OffThreadObjectCreator {
|
| creator_thread.Start();
|
| creator_thread.message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(OffThreadObjectCreator::CreateObject, &result));
|
| + base::Bind(OffThreadObjectCreator::CreateObject, &result));
|
| }
|
| DCHECK(result); // We synchronized on thread destruction above.
|
| return result;
|
| @@ -55,10 +56,8 @@ class BackgroundThread : public Thread {
|
| WaitableEvent completion(true, false);
|
| message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(&BackgroundThread::DoCreateFromProducer,
|
| - consumer,
|
| - producer,
|
| - &completion));
|
| + base::Bind(&BackgroundThread::DoCreateFromProducer, consumer, producer,
|
| + &completion));
|
| completion.Wait();
|
| }
|
|
|
| @@ -66,10 +65,8 @@ class BackgroundThread : public Thread {
|
| WaitableEvent completion(true, false);
|
| message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(&BackgroundThread::DoCreateFromConsumer,
|
| - consumer,
|
| - other,
|
| - &completion));
|
| + base::Bind(&BackgroundThread::DoCreateFromConsumer, consumer, other,
|
| + &completion));
|
| completion.Wait();
|
| }
|
|
|
| @@ -77,9 +74,7 @@ class BackgroundThread : public Thread {
|
| WaitableEvent completion(true, false);
|
| message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(&BackgroundThread::DoDeleteProducer,
|
| - object,
|
| - &completion));
|
| + base::Bind(&BackgroundThread::DoDeleteProducer, object, &completion));
|
| completion.Wait();
|
| }
|
|
|
| @@ -87,9 +82,7 @@ class BackgroundThread : public Thread {
|
| WaitableEvent completion(true, false);
|
| message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(&BackgroundThread::DoDeleteConsumer,
|
| - object,
|
| - &completion));
|
| + base::Bind(&BackgroundThread::DoDeleteConsumer, object, &completion));
|
| completion.Wait();
|
| }
|
|
|
| @@ -98,10 +91,7 @@ class BackgroundThread : public Thread {
|
| Producer* result = NULL;
|
| message_loop()->PostTask(
|
| FROM_HERE,
|
| - NewRunnableFunction(&BackgroundThread::DoDeRef,
|
| - consumer,
|
| - &result,
|
| - &completion));
|
| + base::Bind(&BackgroundThread::DoDeRef, consumer, &result, &completion));
|
| completion.Wait();
|
| return result;
|
| }
|
|
|