| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This defines a set of argument wrappers and related factory methods that | 5 // This defines a set of argument wrappers and related factory methods that |
| 6 // can be used specify the refcounting and reference semantics of arguments | 6 // can be used specify the refcounting and reference semantics of arguments |
| 7 // that are bound by the Bind() function in base/bind.h. | 7 // that are bound by the Bind() function in base/bind.h. |
| 8 // | 8 // |
| 9 // It also defines a set of simple functions and utilities that people want | 9 // It also defines a set of simple functions and utilities that people want |
| 10 // when using Callback<> and Bind(). | 10 // when using Callback<> and Bind(). |
| 11 // | 11 // |
| 12 // | 12 // |
| 13 // ARGUMENT BINDING WRAPPERS | 13 // ARGUMENT BINDING WRAPPERS |
| 14 // | 14 // |
| 15 // The wrapper functions are base::Unretained(), base::Owned(), bass::Passed(), | 15 // The wrapper functions are base::Unretained(), base::Owned(), base::Passed(), |
| 16 // base::ConstRef(), and base::IgnoreResult(). | 16 // base::ConstRef(), and base::IgnoreResult(). |
| 17 // | 17 // |
| 18 // Unretained() allows Bind() to bind a non-refcounted class, and to disable | 18 // Unretained() allows Bind() to bind a non-refcounted class, and to disable |
| 19 // refcounting on arguments that are refcounted objects. | 19 // refcounting on arguments that are refcounted objects. |
| 20 // | 20 // |
| 21 // Owned() transfers ownership of an object to the Callback resulting from | 21 // Owned() transfers ownership of an object to the Callback resulting from |
| 22 // bind; the object will be deleted when the Callback is deleted. | 22 // bind; the object will be deleted when the Callback is deleted. |
| 23 // | 23 // |
| 24 // Passed() is for transferring movable-but-not-copyable types (eg. scoped_ptr) | 24 // Passed() is for transferring movable-but-not-copyable types (eg. scoped_ptr) |
| 25 // through a Callback. Logically, this signifies a destructive transfer of | 25 // through a Callback. Logically, this signifies a destructive transfer of |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 BASE_EXPORT void DoNothing(); | 535 BASE_EXPORT void DoNothing(); |
| 536 | 536 |
| 537 template<typename T> | 537 template<typename T> |
| 538 void DeletePointer(T* obj) { | 538 void DeletePointer(T* obj) { |
| 539 delete obj; | 539 delete obj; |
| 540 } | 540 } |
| 541 | 541 |
| 542 } // namespace base | 542 } // namespace base |
| 543 | 543 |
| 544 #endif // BASE_BIND_HELPERS_H_ | 544 #endif // BASE_BIND_HELPERS_H_ |
| OLD | NEW |