Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Fix comment in base/auto_reset.h to refer to AutoReset instead of
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mark@chromium.org committed Jun 28, 2011
1 parent 007af65 commit 1a73476
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions base/auto_reset.h
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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 {
Expand Down

0 comments on commit 1a73476

Please sign in to comment.