Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: base/bind_helpers.h

Issue 23514018: Add Reset to ScopedClosureRunner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/bind_helpers.cc » ('j') | base/bind_helpers.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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().
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 delete obj; 543 delete obj;
544 } 544 }
545 545
546 // ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the 546 // ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the
547 // Closure is executed and deleted no matter how the current scope exits. 547 // Closure is executed and deleted no matter how the current scope exits.
548 class BASE_EXPORT ScopedClosureRunner { 548 class BASE_EXPORT ScopedClosureRunner {
549 public: 549 public:
550 explicit ScopedClosureRunner(const Closure& closure); 550 explicit ScopedClosureRunner(const Closure& closure);
551 ~ScopedClosureRunner(); 551 ~ScopedClosureRunner();
552 552
553 void Reset(const Closure& closure);
553 Closure Release(); 554 Closure Release();
554 555
555 private: 556 private:
556 Closure closure_; 557 Closure closure_;
557 558
558 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedClosureRunner); 559 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedClosureRunner);
559 }; 560 };
560 561
561 } // namespace base 562 } // namespace base
562 563
563 #endif // BASE_BIND_HELPERS_H_ 564 #endif // BASE_BIND_HELPERS_H_
OLDNEW
« no previous file with comments | « no previous file | base/bind_helpers.cc » ('j') | base/bind_helpers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698