Add a way to revert a variable to its previous value after leaving a scope.
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2011 05:36:03 +0000 (05:36 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Nov 2011 05:36:03 +0000 (05:36 +0000)
commit999bfe6e48f3e81024d4de3d490c0f0091d64ef4
tree1c81abfbb15de046ee21a4e53e45a2386c6377da
parentd05d8da0ed856e707050724a0e028efd09116471
Add a way to revert a variable to its previous value after leaving a scope.
https://bugs.webkit.org/show_bug.cgi?id=73371

Reviewed by Adam Barth.

Source/JavaScriptCore:

In case anyone from Chromium sees this, it is nearly identical to AutoReset
but if the same name were used, it causes unnecessary ambiguity.

* JavaScriptCore.xcodeproj/project.pbxproj:
* wtf/TemporarilyChange.h: Added.
(WTF::TemporarilyChange::TemporarilyChange):
(WTF::TemporarilyChange::~TemporarilyChange):

Source/JavaScriptGlue:

* ForwardingHeaders/wtf/TemporarilyChange.h: Added.

Source/WebCore:

* ForwardingHeaders/wtf/TemporarilyChange.h: Added.

Source/WebKit/mac:

* ForwardingHeaders/wtf/TemporarilyChange.h: Added.

Tools:

* DumpRenderTree/ForwardingHeaders/wtf/TemporarilyChange.h: Added.
* TestWebKitAPI/TestWebKitAPI.gypi: Added test file to the build.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Ditto.
* TestWebKitAPI/win/TestWebKitAPI.vcproj: Ditto.
* TestWebKitAPI/Tests/WTF/TemporarilyChange.cpp: Added.
(TestWebKitAPI::TEST): Added a test for TemporarilyChange.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/wtf/TemporarilyChange.h [new file with mode: 0644]
Source/JavaScriptGlue/ChangeLog
Source/JavaScriptGlue/ForwardingHeaders/wtf/TemporarilyChange.h [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/ForwardingHeaders/wtf/TemporarilyChange.h [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/ForwardingHeaders/wtf/TemporarilyChange.h [new file with mode: 0644]
Tools/ChangeLog
Tools/DumpRenderTree/ForwardingHeaders/wtf/TemporarilyChange.h [new file with mode: 0644]
Tools/TestWebKitAPI/TestWebKitAPI.gypi
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WTF/TemporarilyChange.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/win/TestWebKitAPI.vcproj