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

Issue 1245163002: Base: add Optional<T>. (Closed)

Created:
5 years, 5 months ago by mlamouri (slow - plz ping)
Modified:
4 years, 8 months ago
CC:
chromium-reviews, dcheng, Sami
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Base: add Optional<T>. This is an implementation of the C++17 std::optional<> feature: http://en.cppreference.com/w/cpp/utility/optional Chromium documentation: https://chromium.googlesource.com/chromium/src/+/master/docs/optional.md BUG=521269 Committed: https://crrev.com/8756e4f20df53bbb7fbb49b2ca19fda93a95bdb4 Cr-Commit-Position: refs/heads/master@{#388187} Committed: https://crrev.com/53f6b258355ce36752ea7a8dcf8953560b5be818 Cr-Commit-Position: refs/heads/master@{#388232}

Patch Set 1 #

Patch Set 2 : format #

Patch Set 3 : add files #

Patch Set 4 : Nullable -> Optional #

Total comments: 11

Patch Set 5 : #

Total comments: 21

Patch Set 6 : closer to spec implementation #

Total comments: 69

Patch Set 7 : review comments #

Total comments: 21

Patch Set 8 : review comments #

Patch Set 9 : dcheng's suggestion #

Patch Set 10 : attempt to fix windows build #

Patch Set 11 : documentation #

Patch Set 12 : missed one expect_true #

Patch Set 13 : moar test changes for msvc #

Total comments: 4

Patch Set 14 : updated documentation #

Total comments: 1

Patch Set 15 : doc changes #

Patch Set 16 : win7 fix #

Patch Set 17 : fix md #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1763 lines, -0 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
M base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
A base/optional.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +427 lines, -0 lines 0 comments Download
A base/optional_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1224 lines, -0 lines 0 comments Download
A docs/optional.md View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +108 lines, -0 lines 0 comments Download

Messages

Total messages: 98 (32 generated)
mlamouri (slow - plz ping)
5 years, 5 months ago (2015-07-21 13:35:00 UTC) #2
Nico
There's no motivation anywhere why this is useful – nothing in the cl description, no ...
5 years, 5 months ago (2015-07-21 15:01:10 UTC) #3
Bernhard Bauer
On 2015/07/21 15:01:10, Nico wrote: > There's no motivation anywhere why this is useful – ...
5 years, 5 months ago (2015-07-21 15:04:58 UTC) #4
mlamouri (slow - plz ping)
Sorry, for the very limited context. I had to run out of the office unexpectedly. ...
5 years, 5 months ago (2015-07-21 19:14:22 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/40001
5 years, 5 months ago (2015-07-21 19:15:32 UTC) #7
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_compile_dbg/builds/38687)
5 years, 5 months ago (2015-07-21 19:34:22 UTC) #9
Lalit Maganti
thakis: could you please consider mlamouri's explanation. It would be really good to have this ...
5 years, 4 months ago (2015-07-30 13:20:31 UTC) #11
Lalit Maganti
+ danakj because dmurph sitting next to me said so. Sorry danakj -- dmurph
5 years, 4 months ago (2015-08-03 11:58:57 UTC) #13
danakj
On 2015/07/21 19:14:22, Mounir Lamouri OOO up to 3 Aug wrote: > Sorry, for the ...
5 years, 4 months ago (2015-08-03 18:14:13 UTC) #14
mlamouri (slow - plz ping)
I've created a bug. Regarding the difference between Optional<> and Nullable<>, I guess the gist ...
5 years, 4 months ago (2015-08-15 13:55:52 UTC) #15
Bernhard Bauer
On 2015/08/15 13:55:52, Mounir Lamouri wrote: > I've created a bug. > > Regarding the ...
5 years, 4 months ago (2015-08-17 07:59:47 UTC) #16
mlamouri (slow - plz ping)
I have updated the CL to use Optional<T> instead of Nullable<T>. It also uses a ...
5 years, 4 months ago (2015-08-23 14:34:12 UTC) #17
mlamouri (slow - plz ping)
https://codereview.chromium.org/1245163002/diff/60001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/60001/base/optional.h#newcode17 base/optional.h:17: // subset of it. It uses nullptr_t instead of ...
5 years, 4 months ago (2015-08-23 14:35:03 UTC) #18
danakj
So I think that I would like to move WTF::Optional to base, but this implementation ...
5 years, 2 months ago (2015-10-15 20:45:27 UTC) #19
mlamouri (slow - plz ping)
danakj@, I've applied your comments. The implementation is closer to the C++ standard. I've listed ...
5 years, 2 months ago (2015-10-24 09:46:59 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/80001
5 years, 1 month ago (2015-10-25 16:17:18 UTC) #24
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/125453)
5 years, 1 month ago (2015-10-25 17:11:02 UTC) #26
mlamouri (slow - plz ping)
danakj@, PTAL. I will investigate the Windows build if the current CL is more in ...
5 years, 1 month ago (2015-10-27 19:45:31 UTC) #27
danakj
This looks really great, thanks! We're really close to allowing && so I think I'd ...
5 years, 1 month ago (2015-11-19 20:55:46 UTC) #28
danakj
*insert a bunch of comments about lets make this match the experimental one exactly* https://codereview.chromium.org/1245163002/diff/80001/base/optional.h ...
5 years ago (2015-12-10 23:45:46 UTC) #29
enne (OOO)
Is this going to land any time soon? I was looking for something like this ...
4 years, 10 months ago (2016-02-03 19:20:31 UTC) #30
mlamouri (slow - plz ping)
I need to apply the last comments that Dana left. I hope to find some ...
4 years, 10 months ago (2016-02-03 19:26:03 UTC) #31
dmazzoni
Also adding my vote of support - this is exactly what I need in http://crrev.com/1713723002
4 years, 10 months ago (2016-02-24 19:25:38 UTC) #33
mlamouri (slow - plz ping)
Dana, can you PTAL. Could you check the bool operator. I couldn't get the Testable ...
4 years, 9 months ago (2016-02-29 22:31:27 UTC) #34
danakj
https://codereview.chromium.org/1245163002/diff/100001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/100001/base/optional.h#newcode20 base/optional.h:20: explicit nullopt_t(int) { } nit: no space in {}. ...
4 years, 9 months ago (2016-03-04 00:31:09 UTC) #35
danakj
Looks like VS 2015 has stuck now.
4 years, 9 months ago (2016-03-14 18:59:49 UTC) #36
mlamouri (slow - plz ping)
On 2016/03/14 at 18:59:49, danakj wrote: > Looks like VS 2015 has stuck now. I ...
4 years, 9 months ago (2016-03-14 19:02:03 UTC) #37
danakj
On Mon, Mar 14, 2016 at 12:02 PM, <mlamouri@chromium.org> wrote: > On 2016/03/14 at 18:59:49, ...
4 years, 9 months ago (2016-03-14 19:38:57 UTC) #38
horo
Could you please let me know when this CL will be submitted? This CL is ...
4 years, 9 months ago (2016-03-17 07:23:58 UTC) #40
danakj
On 2016/03/17 07:23:58, horo wrote: > Could you please let me know when this CL ...
4 years, 9 months ago (2016-03-17 19:01:43 UTC) #41
mlamouri (slow - plz ping)
Dana, PTAL. I've applied your comments. I still need to add a few tests but ...
4 years, 9 months ago (2016-03-18 01:16:04 UTC) #44
danakj
Looks great! I think we'll probably be able to use constexpr this week, 2015 continues ...
4 years, 9 months ago (2016-03-21 21:49:38 UTC) #45
horo
https://codereview.chromium.org/1245163002/diff/120001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 base/optional.h:27: constexpr in_place_t in_place; I think you need an explicit ...
4 years, 9 months ago (2016-03-24 06:25:58 UTC) #47
mlamouri (slow - plz ping)
All comments applied. I've also finished the unit tests. PTAL. https://codereview.chromium.org/1245163002/diff/120001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 ...
4 years, 9 months ago (2016-03-24 09:20:45 UTC) #48
horo
https://codereview.chromium.org/1245163002/diff/120001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 base/optional.h:27: constexpr in_place_t in_place; On 2016/03/24 09:20:44, Mounir Lamouri wrote: ...
4 years, 9 months ago (2016-03-24 09:47:22 UTC) #49
horo
On 2016/03/24 09:47:22, horo wrote: > https://codereview.chromium.org/1245163002/diff/120001/base/optional.h > File base/optional.h (right): > > https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 > ...
4 years, 9 months ago (2016-03-24 09:56:30 UTC) #50
mlamouri (slow - plz ping)
On 2016/03/24 at 09:56:30, horo wrote: > On 2016/03/24 09:47:22, horo wrote: > > https://codereview.chromium.org/1245163002/diff/120001/base/optional.h ...
4 years, 9 months ago (2016-03-24 10:03:36 UTC) #51
dcheng
https://codereview.chromium.org/1245163002/diff/120001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 base/optional.h:27: constexpr in_place_t in_place; On 2016/03/24 at 09:47:22, horo wrote: ...
4 years, 9 months ago (2016-03-24 10:20:51 UTC) #53
danakj
https://codereview.chromium.org/1245163002/diff/120001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/120001/base/optional.h#newcode27 base/optional.h:27: constexpr in_place_t in_place; On 2016/03/24 10:20:51, dcheng wrote: > ...
4 years, 9 months ago (2016-03-24 20:38:52 UTC) #54
shivanisha
I am working on a fix that uses this patch ( see https://codereview.chromium.org/1837233002). The windows ...
4 years, 8 months ago (2016-03-29 18:35:45 UTC) #55
Will Harris
hello I wondered what the status of this CL was as it's blocking another CL ...
4 years, 8 months ago (2016-04-05 18:22:08 UTC) #58
danakj
On Tue, Apr 5, 2016 at 11:22 AM, <wfh@chromium.org> wrote: > hello I wondered what ...
4 years, 8 months ago (2016-04-05 18:26:03 UTC) #59
Will Harris
okay thanks for the update. +shivanisha
4 years, 8 months ago (2016-04-05 19:41:33 UTC) #61
Will Harris
M51 has branched, I think this is a good indication that we are sticking with ...
4 years, 8 months ago (2016-04-11 17:52:55 UTC) #62
danakj
On Mon, Apr 11, 2016 at 10:52 AM, <wfh@chromium.org> wrote: > M51 has branched, I ...
4 years, 8 months ago (2016-04-11 21:23:51 UTC) #63
danakj
Looks like we're ok to use VS2015 now. This LGTM with 1 last comment. Were ...
4 years, 8 months ago (2016-04-12 23:37:53 UTC) #64
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/140001
4 years, 8 months ago (2016-04-12 23:38:57 UTC) #66
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/173586)
4 years, 8 months ago (2016-04-13 00:23:46 UTC) #68
danakj
When you EXPECT_EQ(a,b) or EXPECT_TRUE(a) and |a| and |b| are of type Optional<TestObject> then we ...
4 years, 8 months ago (2016-04-13 00:30:33 UTC) #69
jbroman
On 2016/04/13 at 00:30:33, danakj wrote: > When you EXPECT_EQ(a,b) or EXPECT_TRUE(a) and |a| and ...
4 years, 8 months ago (2016-04-13 01:06:31 UTC) #70
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/180001
4 years, 8 months ago (2016-04-13 14:38:51 UTC) #72
mlamouri (slow - plz ping)
Dana, I've updated the CL with some doc. It's still WIP but I have a ...
4 years, 8 months ago (2016-04-13 15:21:21 UTC) #73
danakj
Thanks looks good, and looks like the windows bot is happy too. https://codereview.chromium.org/1245163002/diff/240001/base/optional.h File base/optional.h ...
4 years, 8 months ago (2016-04-14 20:16:20 UTC) #74
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/240001
4 years, 8 months ago (2016-04-14 20:16:41 UTC) #76
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-14 22:32:33 UTC) #78
mlamouri (slow - plz ping)
Documentation updated. https://codereview.chromium.org/1245163002/diff/240001/base/optional.h File base/optional.h (right): https://codereview.chromium.org/1245163002/diff/240001/base/optional.h#newcode34 base/optional.h:34: // http://en.cppreference.com/w/cpp/utility/optional On 2016/04/14 at 20:16:20, danakj ...
4 years, 8 months ago (2016-04-16 11:43:43 UTC) #79
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/260001
4 years, 8 months ago (2016-04-16 15:57:38 UTC) #81
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-16 23:16:26 UTC) #83
danakj
LGTM let's land and start converting existing Nullable/Optional/Maybe things to use this. https://codereview.chromium.org/1245163002/diff/260001/docs/optional.md File docs/optional.md ...
4 years, 8 months ago (2016-04-18 21:08:10 UTC) #84
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/280001
4 years, 8 months ago (2016-04-19 10:42:56 UTC) #88
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 8 months ago (2016-04-19 12:04:11 UTC) #89
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/8756e4f20df53bbb7fbb49b2ca19fda93a95bdb4 Cr-Commit-Position: refs/heads/master@{#388187}
4 years, 8 months ago (2016-04-19 12:05:04 UTC) #91
cmumford
A revert of this CL (patchset #15 id:280001) has been created in https://codereview.chromium.org/1902833002/ by cmumford@chromium.org. ...
4 years, 8 months ago (2016-04-19 15:59:11 UTC) #92
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1245163002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1245163002/320001
4 years, 8 months ago (2016-04-19 16:16:59 UTC) #95
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 8 months ago (2016-04-19 17:27:14 UTC) #96
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:13:19 UTC) #98
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/53f6b258355ce36752ea7a8dcf8953560b5be818
Cr-Commit-Position: refs/heads/master@{#388232}

Powered by Google App Engine
This is Rietveld 408576698