| Index: third_party/WebKit/Source/wtf/TemporaryChange.h
|
| diff --git a/third_party/WebKit/Source/wtf/TemporaryChange.h b/third_party/WebKit/Source/wtf/TemporaryChange.h
|
| index 05d4a2a03a2c23168d439e5c2f8e570e4b81bf0b..4090a00dda26ee70fbce6098080ef7a01cbbab43 100644
|
| --- a/third_party/WebKit/Source/wtf/TemporaryChange.h
|
| +++ b/third_party/WebKit/Source/wtf/TemporaryChange.h
|
| @@ -39,28 +39,22 @@ namespace WTF {
|
| // shorter lifetime than its scopedVariable, to prevent invalid memory writes
|
| // when the TemporaryChange<> object is destroyed.
|
|
|
| -template<typename T>
|
| +template <typename T>
|
| class TemporaryChange {
|
| - WTF_MAKE_NONCOPYABLE(TemporaryChange);
|
| -public:
|
| - TemporaryChange(T& scopedVariable, T newValue)
|
| - : m_scopedVariable(scopedVariable)
|
| - , m_originalValue(scopedVariable)
|
| - {
|
| - m_scopedVariable = newValue;
|
| - }
|
| + WTF_MAKE_NONCOPYABLE(TemporaryChange);
|
|
|
| - ~TemporaryChange()
|
| - {
|
| - m_scopedVariable = m_originalValue;
|
| - }
|
| + public:
|
| + TemporaryChange(T& scopedVariable, T newValue)
|
| + : m_scopedVariable(scopedVariable), m_originalValue(scopedVariable) {
|
| + m_scopedVariable = newValue;
|
| + }
|
|
|
| + ~TemporaryChange() { m_scopedVariable = m_originalValue; }
|
|
|
| -private:
|
| - T& m_scopedVariable;
|
| - T m_originalValue;
|
| + private:
|
| + T& m_scopedVariable;
|
| + T m_originalValue;
|
| };
|
| -
|
| }
|
|
|
| using WTF::TemporaryChange;
|
|
|