jhawkins@chromium.org | e194f3d | 2012-01-05 11:18:18 +0900 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
erg@chromium.org | 493f5f6 | 2010-07-16 06:03:54 +0900 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
ajwong@chromium.org | e4f3dc3 | 2012-01-07 07:12:28 +0900 | [diff] [blame^] | 5 | #include "base/bind_helpers.h" |
| 6 | |
| 7 | #include "base/callback.h" |
erg@chromium.org | 493f5f6 | 2010-07-16 06:03:54 +0900 | [diff] [blame] | 8 | |
wez@chromium.org | 6d4ad68 | 2011-05-28 04:35:11 +0900 | [diff] [blame] | 9 | namespace base { |
| 10 | |
ajwong@chromium.org | e4f3dc3 | 2012-01-07 07:12:28 +0900 | [diff] [blame^] | 11 | void DoNothing() { |
| 12 | } |
| 13 | |
sergeyu@chromium.org | 17c6735 | 2011-10-05 00:28:03 +0900 | [diff] [blame] | 14 | ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) |
| 15 | : closure_(closure) { |
| 16 | } |
| 17 | |
| 18 | ScopedClosureRunner::~ScopedClosureRunner() { |
| 19 | if (!closure_.is_null()) |
| 20 | closure_.Run(); |
| 21 | } |
| 22 | |
| 23 | Closure ScopedClosureRunner::Release() { |
| 24 | Closure result = closure_; |
| 25 | closure_.Reset(); |
| 26 | return result; |
| 27 | } |
| 28 | |
wez@chromium.org | 6d4ad68 | 2011-05-28 04:35:11 +0900 | [diff] [blame] | 29 | } // namespace base |