| Index: base/executor_helpers.h
|
| diff --git a/base/message_loop_helpers.h b/base/executor_helpers.h
|
| similarity index 69%
|
| copy from base/message_loop_helpers.h
|
| copy to base/executor_helpers.h
|
| index 9aeaad72fb05822b8a708aa6f5ca926f63f9d48f..b2cf30eca5084e91baa09b089501f5e0c714463d 100644
|
| --- a/base/message_loop_helpers.h
|
| +++ b/base/executor_helpers.h
|
| @@ -1,9 +1,9 @@
|
| -// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef BASE_MESSAGE_LOOP_HELPERS_H_
|
| -#define BASE_MESSAGE_LOOP_HELPERS_H_
|
| +#ifndef BASE_EXECUTOR_HELPERS_H_
|
| +#define BASE_EXECUTOR_HELPERS_H_
|
| #pragma once
|
|
|
| #include "base/basictypes.h"
|
| @@ -23,7 +23,7 @@ template <class T, class R> class ReleaseHelperInternal;
|
| // function signature while still remembering it so we can call the correct
|
| // destructor/release function.
|
| // We use this trick so we don't need to include bind.h in a header file like
|
| -// message_loop.h. We also wrap the helpers in a templated class to make it
|
| +// executor.h. We also wrap the helpers in a templated class to make it
|
| // easier for users of DeleteSoon to declare the helper as a friend.
|
| template <class T>
|
| class DeleteHelper {
|
| @@ -51,11 +51,11 @@ class ReleaseHelper {
|
|
|
| namespace subtle {
|
|
|
| -// An internal MessageLoop-like class helper for DeleteHelper and ReleaseHelper.
|
| +// An internal Executor-like class helper for DeleteHelper and ReleaseHelper.
|
| // We don't want to expose the Do*() functions directly directly since the void*
|
| // argument makes it possible to pass/ an object of the wrong type to delete.
|
| // Instead, we force callers to go through these internal helpers for type
|
| -// safety. MessageLoop-like classes which expose DeleteSoon or ReleaseSoon
|
| +// safety. Executor-like classes which expose DeleteSoon or ReleaseSoon
|
| // methods should friend the appropriate helper and implement a corresponding
|
| // *Internal method with the following signature:
|
| // bool(const tracked_objects::Location&,
|
| @@ -66,14 +66,14 @@ namespace subtle {
|
| template <class T, class ReturnType>
|
| class DeleteHelperInternal {
|
| public:
|
| - template <class MessageLoopType>
|
| - static ReturnType DeleteOnMessageLoop(
|
| - MessageLoopType* message_loop,
|
| + template <class ExecutorType>
|
| + static ReturnType DeleteViaExecutor(
|
| + ExecutorType* executor,
|
| const tracked_objects::Location& from_here,
|
| const T* object) {
|
| - return message_loop->DeleteSoonInternal(from_here,
|
| - &DeleteHelper<T>::DoDelete,
|
| - object);
|
| + return executor->DeleteSoonInternal(from_here,
|
| + &DeleteHelper<T>::DoDelete,
|
| + object);
|
| }
|
|
|
| private:
|
| @@ -83,14 +83,14 @@ class DeleteHelperInternal {
|
| template <class T, class ReturnType>
|
| class ReleaseHelperInternal {
|
| public:
|
| - template <class MessageLoopType>
|
| - static ReturnType ReleaseOnMessageLoop(
|
| - MessageLoopType* message_loop,
|
| + template <class ExecutorType>
|
| + static ReturnType ReleaseViaExecutor(
|
| + ExecutorType* executor,
|
| const tracked_objects::Location& from_here,
|
| const T* object) {
|
| - return message_loop->ReleaseSoonInternal(from_here,
|
| - &ReleaseHelper<T>::DoRelease,
|
| - object);
|
| + return executor->ReleaseSoonInternal(from_here,
|
| + &ReleaseHelper<T>::DoRelease,
|
| + object);
|
| }
|
|
|
| private:
|
| @@ -101,4 +101,4 @@ class ReleaseHelperInternal {
|
|
|
| } // namespace base
|
|
|
| -#endif // BASE_MESSAGE_LOOP_HELPERS_H_
|
| +#endif // BASE_EXECUTOR_HELPERS_H_
|
|
|