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

Issue 1878253003: Allow explicit conversion operators and implement WTF::OwnPtr::operator bool. (Closed)

Created:
4 years, 8 months ago by jbroman
Modified:
4 years, 8 months ago
CC:
jbroman, ajuma+watch-canvas_chromium.org, darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-css, blink-reviews-html_chromium.org, blink-reviews-layout_chromium.org, blink-reviews-platform-graphics_chromium.org, blink-reviews-wtf_chromium.org, Rik, chromium-reviews, danakj+watch_chromium.org, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, eae+blinkwatch, Eric Willigers, f(malita), gavinp+loader_chromium.org, haraken, hongchan, Nate Chapin, jbroman+cpp_chromium.org, jchaffraix+rendering, Justin Novosad, kinuko+watch, leviw+renderwatch, loading-reviews+fetch_chromium.org, Mikhail, pdr+renderingwatchlist_chromium.org, pdr+graphicswatchlist_chromium.org, rjwright, rwlbuis, Raymond Toy, Stephen Chennney, shans, szager+layoutwatch_chromium.org, tyoshino+watch_chromium.org, Yuta Kitamura, zoltan1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow explicit conversion operators and implement WTF::OwnPtr::operator bool. For consistency, PassOwnPtr::operator bool is also implemented. This is the simpler, and as of C++11, more idiomatic, way of only allowing conversion to bool. A minor downside is that the conversion doesn't automatically take place on return. There are many workarounds, but the !! idiom seems most common, so that is what has been used here. Committed: https://crrev.com/e18d314891dffa45c8583f2ffa4fcf6bbc7e0717 Cr-Commit-Position: refs/heads/master@{#387027}

Patch Set 1 #

Total comments: 7

Patch Set 2 : !! #

Patch Set 3 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -39 lines) Patch
M styleguide/c++/c++11.html View 2 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/animation/InterpolationValue.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/animation/PairwiseInterpolationValue.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/BinaryDataFontFaceSource.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/FontResource.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutBox.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h View 1 2 chunks +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/audio/HRTFDatabaseLoader.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/wtf/OwnPtr.h View 1 chunk +1 line, -5 lines 0 comments Download
M third_party/WebKit/Source/wtf/PassOwnPtr.h View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 21 (6 generated)
jbroman
Pending discussion on this thread: https://groups.google.com/a/chromium.org/d/msg/cxx/slLNb2u7Ei4/DLWiG_2wLAAJ
4 years, 8 months ago (2016-04-12 23:19:42 UTC) #2
danakj
LGTM % thakis https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h File third_party/WebKit/Source/wtf/OwnPtr.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h#newcode73 third_party/WebKit/Source/wtf/OwnPtr.h:73: explicit operator bool() const { return ...
4 years, 8 months ago (2016-04-12 23:23:24 UTC) #3
jbroman
https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h File third_party/WebKit/Source/wtf/OwnPtr.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h#newcode73 third_party/WebKit/Source/wtf/OwnPtr.h:73: explicit operator bool() const { return m_ptr; } On ...
4 years, 8 months ago (2016-04-12 23:26:38 UTC) #4
danakj
https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h File third_party/WebKit/Source/wtf/OwnPtr.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/wtf/OwnPtr.h#newcode73 third_party/WebKit/Source/wtf/OwnPtr.h:73: explicit operator bool() const { return m_ptr; } On ...
4 years, 8 months ago (2016-04-12 23:30:12 UTC) #5
Yuta Kitamura
LGTM, this is better :) (You still need to wait for Nico for wtf approval.)
4 years, 8 months ago (2016-04-13 00:10:25 UTC) #7
Nico
https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h File third_party/WebKit/Source/core/animation/InterpolationValue.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h#newcode37 third_party/WebKit/Source/core/animation/InterpolationValue.h:37: operator bool() const { return !!interpolableValue; } bleh, i ...
4 years, 8 months ago (2016-04-13 01:19:01 UTC) #8
Nico
(but +1 generally)
4 years, 8 months ago (2016-04-13 01:19:59 UTC) #9
alancutter (OOO until 2018)
https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h File third_party/WebKit/Source/core/animation/InterpolationValue.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h#newcode37 third_party/WebKit/Source/core/animation/InterpolationValue.h:37: operator bool() const { return !!interpolableValue; } On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 02:26:32 UTC) #11
Nico
If that works that's cool too. On Apr 12, 2016 10:26 PM, <alancutter@chromium.org> wrote: > ...
4 years, 8 months ago (2016-04-13 02:29:35 UTC) #12
Nico
If that works that's cool too. On Apr 12, 2016 10:26 PM, <alancutter@chromium.org> wrote: > ...
4 years, 8 months ago (2016-04-13 02:29:35 UTC) #13
jbroman
https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h File third_party/WebKit/Source/core/animation/InterpolationValue.h (right): https://codereview.chromium.org/1878253003/diff/1/third_party/WebKit/Source/core/animation/InterpolationValue.h#newcode37 third_party/WebKit/Source/core/animation/InterpolationValue.h:37: operator bool() const { return !!interpolableValue; } On 2016/04/13 ...
4 years, 8 months ago (2016-04-13 13:38:09 UTC) #14
Nico
lgtm
4 years, 8 months ago (2016-04-13 13:40:38 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1878253003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1878253003/40001
4 years, 8 months ago (2016-04-13 17:43:00 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 8 months ago (2016-04-13 18:06:58 UTC) #19
commit-bot: I haz the power
4 years, 8 months ago (2016-04-13 18:07:56 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/e18d314891dffa45c8583f2ffa4fcf6bbc7e0717
Cr-Commit-Position: refs/heads/master@{#387027}

Powered by Google App Engine
This is Rietveld 408576698