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

Unified Diff: third_party/WebKit/Source/wtf/TemporaryChange.h

Issue 1611343002: wtf reformat test Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pydent Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « third_party/WebKit/Source/wtf/StringHasherTest.cpp ('k') | third_party/WebKit/Source/wtf/TemporaryChangeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698