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

Issue 2231953003: Added ASSERT_SIZE macro for checking size of size-sensitive classes (Closed)

Created:
4 years, 4 months ago by sashab
Modified:
4 years, 3 months ago
Reviewers:
Timothy Loh, esprehn
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-wtf_chromium.org, chromium-reviews, dglazkov+blink, Mikhail, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Added ASSERT_SIZE macro for checking size of size-sensitive classes Added ASSERT_SIZE macro for checking size of size-sensitive classes, which can be used with the SameSizeAs structs to give better compile errors with both the expected and actual size values. Also added the assert to the check for SameSizeAsCSSValue. Patch written with help by timloh@. BUG=486252 Committed: https://crrev.com/d4b40c0933c8019b196097ceaeb2099498f5f0a9 Cr-Commit-Position: refs/heads/master@{#417540}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Rebased & changed macro to check size only #

Patch Set 3 : g cl try #

Total comments: 2

Patch Set 4 : Review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -2 lines) Patch
M third_party/WebKit/Source/core/css/CSSValue.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/wtf/BUILD.gn View 1 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/Source/wtf/SizeAssertions.h View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 31 (16 generated)
sashab
4 years, 4 months ago (2016-08-11 08:06:10 UTC) #5
esprehn
I'm pretty skeptical of this, it makes it hard to understand where the space is ...
4 years, 4 months ago (2016-08-11 09:47:40 UTC) #10
Timothy Loh
On 2016/08/11 09:47:40, esprehn wrote: > I'm pretty skeptical of this, it makes it hard ...
4 years, 4 months ago (2016-08-12 01:36:31 UTC) #11
esprehn
What's the status here?
4 years, 3 months ago (2016-08-30 23:37:35 UTC) #12
sashab
Wdyt about this patch? If I can get it to work with DEBUG fields would ...
4 years, 3 months ago (2016-08-31 01:46:32 UTC) #13
sashab
Wdyt about this patch? If I can get it to work with DEBUG fields would ...
4 years, 3 months ago (2016-08-31 01:46:34 UTC) #14
sashab
Another reason I don't like the structs is they're not consistent and there's no standard ...
4 years, 3 months ago (2016-08-31 01:48:47 UTC) #15
sashab
Another reason I don't like the structs is they're not consistent and there's no standard ...
4 years, 3 months ago (2016-08-31 01:48:48 UTC) #16
sashab
Ok, I updated it to take 2 structs instead and compare the size, producing an ...
4 years, 3 months ago (2016-09-06 05:13:17 UTC) #17
esprehn
lgtm https://codereview.chromium.org/2231953003/diff/40001/third_party/WebKit/Source/wtf/SizeAssertions.h File third_party/WebKit/Source/wtf/SizeAssertions.h (right): https://codereview.chromium.org/2231953003/diff/40001/third_party/WebKit/Source/wtf/SizeAssertions.h#newcode1 third_party/WebKit/Source/wtf/SizeAssertions.h:1: #ifndef WTF_SizeAssertions_h missing the short copyright header
4 years, 3 months ago (2016-09-08 22:25:29 UTC) #18
esprehn
Also I think your change description needs updating?
4 years, 3 months ago (2016-09-08 22:25:48 UTC) #19
sashab
Done, thanks so much!! :D https://codereview.chromium.org/2231953003/diff/40001/third_party/WebKit/Source/wtf/SizeAssertions.h File third_party/WebKit/Source/wtf/SizeAssertions.h (right): https://codereview.chromium.org/2231953003/diff/40001/third_party/WebKit/Source/wtf/SizeAssertions.h#newcode1 third_party/WebKit/Source/wtf/SizeAssertions.h:1: #ifndef WTF_SizeAssertions_h On 2016/09/08 ...
4 years, 3 months ago (2016-09-09 01:23:47 UTC) #23
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/2231953003/60001
4 years, 3 months ago (2016-09-09 09:09:38 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-09-09 09:13:12 UTC) #29
commit-bot: I haz the power
4 years, 3 months ago (2016-09-09 09:16:05 UTC) #31
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d4b40c0933c8019b196097ceaeb2099498f5f0a9
Cr-Commit-Position: refs/heads/master@{#417540}

Powered by Google App Engine
This is Rietveld 408576698