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

Issue 3824006: base: add a thread-safety assertion checker (Closed)

Created:
10 years, 2 months ago by Evan Martin
Modified:
10 years, 2 months ago
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

base: add a thread-safety assertion checker ThreadAssertions lets us assert that the current thread is allowed to make blocking calls. See the header for more background. This change implements ThreadAssertions but doesn't turn it on for any of Chrome. BUG=59575 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=63091

Patch Set 1 #

Total comments: 2

Patch Set 2 : rename #

Patch Set 3 : ok #

Patch Set 4 : make comment match reality #

Total comments: 2

Patch Set 5 : fix function name #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -1 line) Patch
M base/base.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M base/thread_local.h View 1 chunk +1 line, -1 line 0 comments Download
A base/thread_restrictions.h View 2 3 4 1 chunk +47 lines, -0 lines 2 comments Download
A base/thread_restrictions.cc View 2 3 4 1 chunk +42 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Aaron Boodman
cool. http://codereview.chromium.org/3824006/diff/1/4 File base/strict_mode.h (right): http://codereview.chromium.org/3824006/diff/1/4#newcode5 base/strict_mode.h:5: #ifndef BASE_STRICT_MODE_H_ Is "strict mode" a term of ...
10 years, 2 months ago (2010-10-18 20:22:11 UTC) #1
Evan Martin
Having tried this out locally, I found we have extra threads in e.g. base_unittests that ...
10 years, 2 months ago (2010-10-18 20:40:50 UTC) #2
jam
I agree a blacklist would be better. That way when someone adds a new background ...
10 years, 2 months ago (2010-10-18 23:33:15 UTC) #3
jam
also, can we check this in with asserts in file_util and PluginList::LoadPlugins? otherwise it'll be ...
10 years, 2 months ago (2010-10-18 23:34:01 UTC) #4
Evan Martin
On 2010/10/18 23:34:01, John Abd-El-Malek wrote: > also, can we check this in with asserts ...
10 years, 2 months ago (2010-10-18 23:35:12 UTC) #5
tfarina
http://codereview.chromium.org/3824006/diff/10001/11004 File base/thread_restrictions.h (right): http://codereview.chromium.org/3824006/diff/10001/11004#newcode20 base/thread_restrictions.h:20: // base::ThreadRestrictions::AssertIsIOAllowed(); typo: AssertIOAllowed To match with the method ...
10 years, 2 months ago (2010-10-19 02:42:38 UTC) #6
Evan Martin
Thanks Thiago! I think this is ready to go in, unless Darin has any comments...
10 years, 2 months ago (2010-10-19 18:03:31 UTC) #7
Evan Martin
Thanks Thiago! I think this is ready to go in, unless Darin has any comments...
10 years, 2 months ago (2010-10-19 18:03:44 UTC) #8
jam
lgtm
10 years, 2 months ago (2010-10-19 20:27:17 UTC) #9
darin (slow to review)
10 years, 2 months ago (2010-10-22 06:30:44 UTC) #10
http://codereview.chromium.org/3824006/diff/17001/18004
File base/thread_restrictions.h (right):

http://codereview.chromium.org/3824006/diff/17001/18004#newcode28
base/thread_restrictions.h:28: static void SetIOAllowed(bool allowed);
I think it is confusing to use the term "IO" here like this.  Asynchronous IO is
fine.  The problem is blocking IO.

SetBlockingIOAllowed and AssertBlockingIOAllowed would have been better.

http://codereview.chromium.org/3824006/diff/17001/18004#newcode35
base/thread_restrictions.h:35: ThreadRestrictions();  // class for namespacing
only
DISALLOW_IMPLICIT_CONSTRUCTORS?

Powered by Google App Engine
This is Rietveld 408576698