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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed)

Created:
4 years, 5 months ago by jsbell
Modified:
4 years, 5 months ago
CC:
Mads Ager (chromium), darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-bindings_chromium.org, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-events_chromium.org, blink-reviews-html_chromium.org, blink-reviews-layout_chromium.org, blink-reviews-paint_chromium.org, blink-reviews-style_chromium.org, blink-reviews-wtf_chromium.org, chromium-reviews, dcheng, dglazkov+blink, dominicc+watchlist_chromium.org, dshwang, krit, dtapuska+blinkwatch_chromium.org, eae+blinkwatch, Eric Willigers, f(malita), fs, gavinp+loader_chromium.org, gyuyoung2, Nate Chapin, jchaffraix+rendering, kinuko+watch, kinuko+fileapi, kouhei+heap_chromium.org, kouhei+svg_chromium.org, leviw+renderwatch, loading-reviews_chromium.org, loading-reviews+fetch_chromium.org, Mikhail, mlamouri+watch-blink_chromium.org, nhiroki, oilpan-reviews, pdr+svgwatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, rjwright, rwlbuis, Stephen Chennney, shans, sof, slimming-paint-reviews_chromium.org, szager+layoutwatch_chromium.org, timvolodine, tyoshino+watch_chromium.org, tzik, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change WTF::TemporaryChange to be an alias for base::AutoReset The behavior is the same, except that base::AutoReset takes a pointer whereas WTF::TemporaryChange took a non-const ref, so callers get sprinkled with ampersands. Since there's no benefit to a different name, align the name as well, and clean up #include usage. Inheriting from a typename alias confused MSVC, so the one instance of that is changed to use a member instead. Committed: https://crrev.com/bb8a6045d4557a81857321fc436b2e72930de689 Cr-Commit-Position: refs/heads/master@{#406285}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Inheriting from an alias may confuse MSVC; member instead? #

Patch Set 3 : TemporaryChange -> AutoReset #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -218 lines) Patch
M third_party/WebKit/Source/bindings/core/v8/ScriptWrappableVisitor.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/SelectorChecker.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DOMURL.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/StyleEngine.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/SelectionController.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UndoStack.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/MemoryCache.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fileapi/FileReader.cpp View 1 2 6 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameView.cpp View 1 2 5 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/frame/FrameViewAutoSizeInfo.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/PlatformEventDispatcher.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLTitleElement.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutGeometryMap.cpp View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.h View 1 2 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutObject.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/shapes/ShapeOutsideInfo.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceMarker.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/layout/svg/SVGTextLayoutEngine.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 5 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/core/page/PageAnimator.cpp View 1 2 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/page/PageVisibilityNotifier.cpp View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.h View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/paint/PaintLayer.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/SVGDocumentExtensions.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGElement.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/svg/SVGTitleElement.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/xml/parser/XMLDocumentParser.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/compositorworker/CompositorWorkerGlobalScope.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/gamepad/GamepadDispatcher.cpp View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/EventDispatchForbiddenScope.h View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/LifecycleNotifier.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/ScriptForbiddenScope.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/heap/HeapPage.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/InspectorOverlay.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebViewImpl.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/tests/DocumentLoaderTest.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
A + third_party/WebKit/Source/wtf/AutoReset.h View 1 2 1 chunk +13 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/wtf/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/wtf/TemporaryChange.h View 1 2 1 chunk +0 lines, -68 lines 0 comments Download
D third_party/WebKit/Source/wtf/TemporaryChangeTest.cpp View 1 chunk +0 lines, -47 lines 0 comments Download
M third_party/WebKit/Source/wtf/wtf.gypi View 1 2 3 chunks +1 line, -2 lines 0 comments Download

Messages

Total messages: 34 (21 generated)
jsbell
Trivial WTF slimming. Worth doing? Should we rename to WTF::AutoReset at the same time, since ...
4 years, 5 months ago (2016-07-14 23:29:14 UTC) #4
esprehn
Sigh, the coding style out in base not allowing non-const ref adds so much line ...
4 years, 5 months ago (2016-07-14 23:59:51 UTC) #5
haraken
On 2016/07/14 23:59:51, esprehn wrote: > Sigh, the coding style out in base not allowing ...
4 years, 5 months ago (2016-07-15 00:04:42 UTC) #6
Yuta Kitamura
LGTM https://codereview.chromium.org/2151933003/diff/1/third_party/WebKit/Source/wtf/TemporaryChange.h File third_party/WebKit/Source/wtf/TemporaryChange.h (right): https://codereview.chromium.org/2151933003/diff/1/third_party/WebKit/Source/wtf/TemporaryChange.h#newcode36 third_party/WebKit/Source/wtf/TemporaryChange.h:36: using TemporaryChange = typename base::AutoReset<T>; A compiler in ...
4 years, 5 months ago (2016-07-15 03:04:41 UTC) #10
Yuta Kitamura
But MSVC errors are still mysterious. It's known to have a bug around template aliases ...
4 years, 5 months ago (2016-07-15 03:09:25 UTC) #11
tzik
https://codereview.chromium.org/2151933003/diff/1/third_party/WebKit/Source/core/dom/StyleEngine.h File third_party/WebKit/Source/core/dom/StyleEngine.h (right): https://codereview.chromium.org/2151933003/diff/1/third_party/WebKit/Source/core/dom/StyleEngine.h#newcode67 third_party/WebKit/Source/core/dom/StyleEngine.h:67: : TemporaryChange<bool>(&engine.m_ignorePendingStylesheets, true) MSVC seems to fail to call ...
4 years, 5 months ago (2016-07-15 04:25:02 UTC) #13
jsbell
Thanks, all! Giving tzik's inheriting->member suggestion a whirl. I'll do a follow-up PS renaming the ...
4 years, 5 months ago (2016-07-18 18:42:37 UTC) #15
tzik
lgtm
4 years, 5 months ago (2016-07-19 02:09:29 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2151933003/40001
4 years, 5 months ago (2016-07-19 15:55:44 UTC) #28
darktears
 I'm currently out of the office until July 21 (holidays). I will not be ...
4 years, 5 months ago (2016-07-19 15:56:36 UTC) #29
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-19 16:03:14 UTC) #31
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-19 16:03:18 UTC) #32
commit-bot: I haz the power
4 years, 5 months ago (2016-07-19 16:05:23 UTC) #34
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/bb8a6045d4557a81857321fc436b2e72930de689
Cr-Commit-Position: refs/heads/master@{#406285}

Powered by Google App Engine
This is Rietveld 408576698