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

Issue 18508: Moved Init() startup_data_->event.Signal() because derived classes may... (Closed)

Created:
11 years, 11 months ago by John Grabowski
Modified:
9 years, 6 months ago
Reviewers:
Mark Mentovai, agl
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Moved Init() startup_data_->event.Signal() because derived classes may not be safe to use until Init() has been called. As an example, RenderThread() creates it's IPC::SyncChannel in Init(), so it isn't safe to call Send() method until after. Change tested explicitly on Mac Win Linux. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=8485

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 4

Patch Set 6 : '' #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -3 lines) Patch
M base/thread.cc View 1 2 1 chunk +4 lines, -3 lines 0 comments Download
M base/thread_unittest.cc View 1 2 3 4 5 2 chunks +23 lines, -0 lines 3 comments Download

Messages

Total messages: 5 (0 generated)
John Grabowski
11 years, 11 months ago (2009-01-22 18:43:51 UTC) #1
agl
http://codereview.chromium.org/18508/diff/15/16 File base/thread_unittest.cc (right): http://codereview.chromium.org/18508/diff/15/16#newcode42 Line 42: SleepInsideInitThread() : Thread("none") { init_called_ = true; } ...
11 years, 11 months ago (2009-01-22 19:05:24 UTC) #2
John Grabowski
http://codereview.chromium.org/18508/diff/15/16 File base/thread_unittest.cc (right): http://codereview.chromium.org/18508/diff/15/16#newcode42 Line 42: SleepInsideInitThread() : Thread("none") { init_called_ = true; } ...
11 years, 11 months ago (2009-01-22 19:18:05 UTC) #3
agl
This makes sense to me now. LGTM. AGL
11 years, 11 months ago (2009-01-22 19:20:42 UTC) #4
Mark Mentovai
11 years, 11 months ago (2009-01-22 19:36:10 UTC) #5
LGTM, good catch.

http://codereview.chromium.org/18508/diff/21/212
File base/thread_unittest.cc (right):

http://codereview.chromium.org/18508/diff/21/212#newcode42
Line 42: SleepInsideInitThread() : Thread("none") { init_called_ = false; }
Prefer |init_called_(false) { }| for constructors.

http://codereview.chromium.org/18508/diff/21/212#newcode49
Line 49: bool InitCalled() { return init_called_; }
It's almost not worth mentioning for this because it's just a silly test class,
but normal style would be to name this init_called (simple inline getter) and
make the method const.

http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Functi...

http://codereview.chromium.org/18508/diff/21/212#newcode132
Line 132: 
Nit: kill trailing blank line.

Powered by Google App Engine
This is Rietveld 408576698