summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 02:20:02 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-28 02:20:02 +0000
commitc9dfa2cd5b2214e2d9df9c345038a28010bbceac (patch)
treebe5c20371e59dd55c741a6b3d470d3947d779bd3 /base
parent912934e8f17083dc5c82cc36a5153b87a768d3f7 (diff)
downloadchromium_src-c9dfa2cd5b2214e2d9df9c345038a28010bbceac.zip
chromium_src-c9dfa2cd5b2214e2d9df9c345038a28010bbceac.tar.gz
chromium_src-c9dfa2cd5b2214e2d9df9c345038a28010bbceac.tar.bz2
Fix comment in base/auto_reset.h to refer to AutoReset instead of
AutoResetValue. This inconsistency was introduced in r48644. The review history for that change, http://codereview.chromium.org/2394001, indicates that AutoResetValue was initially used in this file but not at any of the use sites. When it changed to AutoReset in patch set 2, matching the use sites, the comment still was not updated. BUG=none, cleanup TEST=none Review URL: http://codereview.chromium.org/7253032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/auto_reset.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/base/auto_reset.h b/base/auto_reset.h
index 8638045..b9b0e1d 100644
--- a/base/auto_reset.h
+++ b/base/auto_reset.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -8,15 +8,14 @@
#include "base/basictypes.h"
-// AutoResetValue is useful for setting a variable to some value only
-// during a particular scope. If you have code that has to add "var =
-// false;" or "var = old_var;" at all the exit points of a block, for
-// example, you would benefit from using this instead.
+// AutoReset<> is useful for setting a variable to a new value only within a
+// particular scope. An AutoReset<> object resets a variable to its original
+// value upon destruction, making it an alternative to writing "var = false;"
+// or "var = old_val;" at all of a block's exit points.
//
-// This should be obvious, but note that the AutoResetValue instance
-// should have a shorter lifetime than the scoped_variable, to prevent
-// writing to invalid memory when the AutoResetValue goes out of
-// scope.
+// This should be obvious, but note that an AutoReset<> instance should have a
+// shorter lifetime than its scoped_variable, to prevent invalid memory writes
+// when the AutoReset<> object is destroyed.
template<typename T>
class AutoReset {