blob: f2fc3bb0daaed9697a899b2e80f5322e1a074fe9 [file] [log] [blame]
jhawkins@chromium.orge194f3d2012-01-05 11:18:18 +09001// Copyright (c) 2012 The Chromium Authors. All rights reserved.
erg@chromium.org493f5f62010-07-16 06:03:54 +09002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
ajwong@chromium.orge4f3dc32012-01-07 07:12:28 +09005#include "base/bind_helpers.h"
6
7#include "base/callback.h"
erg@chromium.org493f5f62010-07-16 06:03:54 +09008
wez@chromium.org6d4ad682011-05-28 04:35:11 +09009namespace base {
10
ajwong@chromium.orge4f3dc32012-01-07 07:12:28 +090011void DoNothing() {
12}
13
sergeyu@chromium.org17c67352011-10-05 00:28:03 +090014ScopedClosureRunner::ScopedClosureRunner(const Closure& closure)
15 : closure_(closure) {
16}
17
18ScopedClosureRunner::~ScopedClosureRunner() {
19 if (!closure_.is_null())
20 closure_.Run();
21}
22
23Closure ScopedClosureRunner::Release() {
24 Closure result = closure_;
25 closure_.Reset();
26 return result;
27}
28
wez@chromium.org6d4ad682011-05-28 04:35:11 +090029} // namespace base