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

Issue 2957753002: No compliation-flag-dependent members in CriticalSection (Closed)

Created:
3 years, 5 months ago by eladalon
Modified:
3 years, 5 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, terelius
Target Ref:
refs/heads/master
Project:
webrtc
Visibility:
Public.

Description

No compliation-flag-dependent members in CriticalSection Having members in a class which only exist when certain compliation flags are turned on (unless relating to the target platform) means that those flags must be the same when compiling the module as when including its headers from other modules. This means that code outside of WebRTC runs the risk of misjudging the size of an rtc::CriticalSection, or any class which has an rtc::CriticalSection as a member. (This rule is applied recursively.) If a mismatch occurs, memory corruption is likely. Having discussed this a bit, we have decided that the simplest solution is probably the best - always define those members, even when compilation flags (namely, CS_DEBUG_CHECKS) render it unused. BUG=webrtc:7867 Review-Url: https://codereview.webrtc.org/2957753002 Cr-Commit-Position: refs/heads/master@{#18811} Committed: https://chromium.googlesource.com/external/webrtc/+/d6e9466e7ef8736c5dd4c736c9732506b1b70c1e

Patch Set 1 #

Total comments: 7

Patch Set 2 : . #

Total comments: 4

Patch Set 3 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -38 lines) Patch
M webrtc/base/criticalsection.h View 1 2 4 chunks +13 lines, -8 lines 0 comments Download
M webrtc/base/criticalsection.cc View 1 2 8 chunks +46 lines, -30 lines 0 comments Download

Messages

Total messages: 21 (7 generated)
eladalon
PTAL (I'll add owners once we have consensus.) https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc#newcode23 webrtc/base/criticalsection.cc:23: #elif ...
3 years, 5 months ago (2017-06-26 12:35:22 UTC) #2
nisse-webrtc
https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc#newcode23 webrtc/base/criticalsection.cc:23: #elif defined(WEBRTC_POSIX) On 2017/06/26 12:35:22, eladalon wrote: > mutex_ ...
3 years, 5 months ago (2017-06-26 12:53:09 UTC) #3
eladalon
Please take another look. :-) https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/2957753002/diff/1/webrtc/base/criticalsection.cc#newcode23 webrtc/base/criticalsection.cc:23: #elif defined(WEBRTC_POSIX) On 2017/06/26 ...
3 years, 5 months ago (2017-06-26 13:38:13 UTC) #4
nisse-webrtc
lgtm, with some very minor nits. https://codereview.webrtc.org/2957753002/diff/20001/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/2957753002/diff/20001/webrtc/base/criticalsection.cc#newcode40 webrtc/base/criticalsection.cc:40: #else // !defined(WEBRTC_WIN) ...
3 years, 5 months ago (2017-06-26 13:49:46 UTC) #5
eladalon
https://codereview.webrtc.org/2957753002/diff/20001/webrtc/base/criticalsection.cc File webrtc/base/criticalsection.cc (right): https://codereview.webrtc.org/2957753002/diff/20001/webrtc/base/criticalsection.cc#newcode40 webrtc/base/criticalsection.cc:40: #else // !defined(WEBRTC_WIN) && !defined(WEBRTC_POSIX) On 2017/06/26 13:49:46, nisse-webrtc ...
3 years, 5 months ago (2017-06-26 14:22:32 UTC) #6
kwiberg-webrtc
I'm not sure I agree with the basic premise of this CL. AFAIK we don't ...
3 years, 5 months ago (2017-06-27 10:33:57 UTC) #9
nisse-webrtc
On 2017/06/27 10:33:57, kwiberg-webrtc wrote: > I'm not sure I agree with the basic premise ...
3 years, 5 months ago (2017-06-27 12:11:54 UTC) #10
kwiberg-webrtc
On 2017/06/27 12:11:54, nisse-webrtc wrote: > On 2017/06/27 10:33:57, kwiberg-webrtc wrote: > > I'm not ...
3 years, 5 months ago (2017-06-27 12:43:04 UTC) #11
nisse-webrtc
On 2017/06/27 12:43:04, kwiberg-webrtc wrote: > Well, they have always compiled that .a or .so ...
3 years, 5 months ago (2017-06-27 13:12:45 UTC) #12
kwiberg-webrtc
On 2017/06/27 13:12:45, nisse-webrtc wrote: > On 2017/06/27 12:43:04, kwiberg-webrtc wrote: > > Well, they ...
3 years, 5 months ago (2017-06-27 13:25:05 UTC) #13
nisse-webrtc
On 2017/06/27 13:25:05, kwiberg-webrtc wrote: > This goes for all other GN settings that affect ...
3 years, 5 months ago (2017-06-28 07:18:29 UTC) #14
kwiberg-webrtc
lgtm for this, since the alternatives are large undertakings that can't be ready quickly enough
3 years, 5 months ago (2017-06-28 12:31:28 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/2957753002/40001
3 years, 5 months ago (2017-06-28 13:44:10 UTC) #18
commit-bot: I haz the power
3 years, 5 months ago (2017-06-28 14:31:36 UTC) #21
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/external/webrtc/+/d6e9466e7ef8736c5dd4c736c...

Powered by Google App Engine
This is Rietveld 408576698