New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 906125 link

Starred by 1 user

Issue metadata

Status: Started
Owner:
Last visit > 30 days ago
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Implement C++ Promises for Chromium

Project Member Reported by alexclarke@chromium.org, Nov 16

Issue description

Project Member

Comment 2 by bugdroid1@chromium.org, Dec 4

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4

commit 2fb11e0d8a1b9d8e3b46bf91844683848646cbe4
Author: Alex Clarke <alexclarke@chromium.org>
Date: Tue Dec 04 09:43:59 2018

[C++ Promises] Add base::TypeId

This is a light weight alternative to RTTI based on using the linker to
uniquely reserve a zero-initialised byte in .rodata. The cost here is
the pointer-sized relocation that the linker must patch in for every
type at program startup. We don't expect vast numbers of types to be
used in practice so this should be OK.

Note we can't use std::any when C++17 arrives because that is based on
RTTI which is banned in Chromium, which motivates base::TypeId.

Bug: 906125
Change-Id: I03f7c14f0cc665d865eb6e029a23f441baf20a9a
Reviewed-on: https://chromium-review.googlesource.com/c/1340317
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613486}
[modify] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/BUILD.gn
[modify] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/test/BUILD.gn
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/test/type_id_test_support_a.cc
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/test/type_id_test_support_a.h
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/test/type_id_test_support_b.cc
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/test/type_id_test_support_b.h
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/type_id.cc
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/type_id.h
[add] https://crrev.com/2fb11e0d8a1b9d8e3b46bf91844683848646cbe4/base/type_id_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac076988a89fe54e2101c05c9f0dac05677796d8

commit ac076988a89fe54e2101c05c9f0dac05677796d8
Author: Carlos Caballero <carlscab@google.com>
Date: Thu Dec 13 00:29:36 2018

Make sure TypeId works with components

Make the dummy_var globally visible so that we only have one instance
across all shared libraries, executables etc.

Bug: 906125
Change-Id: I0aba75171ea3f55aa5440eb73a11713ed952f5bb
Reviewed-on: https://chromium-review.googlesource.com/c/1367671
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#616120}
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/BUILD.gn
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/test/BUILD.gn
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/test/type_id_test_support_a.cc
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/test/type_id_test_support_a.h
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/test/type_id_test_support_b.cc
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/test/type_id_test_support_b.h
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/type_id.cc
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/type_id.h
[modify] https://crrev.com/ac076988a89fe54e2101c05c9f0dac05677796d8/base/type_id_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5be1cd882f73600125f113a448ca471965b2d1f0

commit 5be1cd882f73600125f113a448ca471965b2d1f0
Author: Hitoshi Yoshida <peria@chromium.org>
Date: Thu Dec 13 03:01:44 2018

Revert "Make sure TypeId works with components"

This reverts commit ac076988a89fe54e2101c05c9f0dac05677796d8.

Reason for revert: base_unittests failing on Win 7/10

Original change's description:
> Make sure TypeId works with components
> 
> Make the dummy_var globally visible so that we only have one instance
> across all shared libraries, executables etc.
> 
> Bug: 906125
> Change-Id: I0aba75171ea3f55aa5440eb73a11713ed952f5bb
> Reviewed-on: https://chromium-review.googlesource.com/c/1367671
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Alex Clarke <alexclarke@chromium.org>
> Commit-Queue: Carlos Caballero <carlscab@google.com>
> Cr-Commit-Position: refs/heads/master@{#616120}

TBR=dcheng@chromium.org,gab@chromium.org,alexclarke@chromium.org,carlscab@google.com

Change-Id: I83f9b8d8c14b81317112d531cdd57b507149d324
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 906125, 914651
Reviewed-on: https://chromium-review.googlesource.com/c/1375293
Reviewed-by: Hitoshi Yoshida <peria@chromium.org>
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616186}
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/BUILD.gn
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/test/BUILD.gn
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/test/type_id_test_support_a.cc
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/test/type_id_test_support_a.h
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/test/type_id_test_support_b.cc
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/test/type_id_test_support_b.h
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/type_id.cc
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/type_id.h
[modify] https://crrev.com/5be1cd882f73600125f113a448ca471965b2d1f0/base/type_id_unittest.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a3962dd12a6d26d7c4449f81933a08455480bb7

commit 8a3962dd12a6d26d7c4449f81933a08455480bb7
Author: Carlos Caballero <carlscab@google.com>
Date: Fri Dec 14 19:39:04 2018

Move TypeId to experimental

TypeId is not quite ready yet. In particular TypeId instances created
for the same type in different components are not "equal".

This patch adds a test that will fail (thus DISABLED for now) and moves
the TypeId class to experimental to prevent people for using it for now.

Bug: 906125
Change-Id: I10f7707d70a66173676a50d7cf3d3a25f431f905
Reviewed-on: https://chromium-review.googlesource.com/c/1377738
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616787}
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/BUILD.gn
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/test/BUILD.gn
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/test/type_id_test_support_a.cc
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/test/type_id_test_support_a.h
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/test/type_id_test_support_b.cc
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/test/type_id_test_support_b.h
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/type_id.cc
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/type_id.h
[modify] https://crrev.com/8a3962dd12a6d26d7c4449f81933a08455480bb7/base/type_id_unittest.cc

Sign in to add a comment