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

Issue 460067: Don't call RemoveDestructionObserver on non-IO thread. (Closed)

Created:
11 years ago by ukai
Modified:
6 years, 4 months ago
Reviewers:
wtc, M-A Ruel
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, darin (slow to review), jam, ben+cc_chromium.org
Visibility:
Public.

Description

Don't call RemoveDestructionObserver on non-IO thread. RemoveDestructionObserver is expected to be called on the IO thread. Instead, just checking io_loop_ is NULL in destructor. IO thread should be deleted and call WillDestroyCurrentMessageLoop() before deleting singletons in AtExitManager. BUG=28526, 28769 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=34655

Patch Set 1 #

Patch Set 2 : fix compile errors #

Patch Set 3 : fix Init() #

Patch Set 4 : rebase #

Patch Set 5 : lock assertRequired #

Total comments: 3

Patch Set 6 : use Singleton instead of having global lock #

Total comments: 12

Patch Set 7 : Fix locks #

Total comments: 8

Patch Set 8 : fix maruel and wtc comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -24 lines) Patch
M net/ocsp/nss_ocsp.cc View 1 2 3 4 5 6 7 11 chunks +55 lines, -24 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
ukai
11 years ago (2009-12-04 10:20:21 UTC) #1
wtc1
On Fri, Dec 4, 2009 at 2:20 AM, <ukai@chromium.org> wrote: > Reviewers: wtc, > > ...
11 years ago (2009-12-10 00:28:41 UTC) #2
wtc
This CL looks correct, but it adds a static Lock object. That violates our policy ...
11 years ago (2009-12-11 02:12:30 UTC) #3
wtc
Another issue is whether we shut down the worker threads. If we don't shut down ...
11 years ago (2009-12-11 02:17:54 UTC) #4
M-A Ruel
I'm against this change, it adds a global variable with a constructor (the lock). You ...
11 years ago (2009-12-11 02:32:40 UTC) #5
ukai
On 2009/12/11 02:32:40, Marc-Antoine Ruel wrote: > I'm against this change, it adds a global ...
11 years ago (2009-12-11 03:30:44 UTC) #6
ukai
Seems to be ok just to use Singleton and checks io_loop_ is NULL (by WillDestroyCurrnetMessageLoop()). ...
11 years ago (2009-12-14 04:42:38 UTC) #7
M-A Ruel
http://codereview.chromium.org/460067/diff/10001/9002 File net/ocsp/nss_ocsp.cc (right): http://codereview.chromium.org/460067/diff/10001/9002#newcode32 net/ocsp/nss_ocsp.cc:32: static const int kRecvBufferSize = 4096; Style issue: shouldn't ...
11 years ago (2009-12-14 15:14:38 UTC) #8
ukai
http://codereview.chromium.org/460067/diff/10001/9002 File net/ocsp/nss_ocsp.cc (right): http://codereview.chromium.org/460067/diff/10001/9002#newcode32 net/ocsp/nss_ocsp.cc:32: static const int kRecvBufferSize = 4096; On 2009/12/14 15:14:39, ...
11 years ago (2009-12-15 04:26:09 UTC) #9
M-A Ruel
lgtm with comments http://codereview.chromium.org/460067/diff/12001/13001 File net/ocsp/nss_ocsp.cc (right): http://codereview.chromium.org/460067/diff/12001/13001#newcode129 net/ocsp/nss_ocsp.cc:129: DCHECK(!io_loop_); This function is fine to ...
11 years ago (2009-12-15 18:43:22 UTC) #10
wtc
11 years ago (2009-12-16 01:49:18 UTC) #11
LGTM.  Reviewing this code always makes my head hurt :-)

http://codereview.chromium.org/460067/diff/12001/13001
File net/ocsp/nss_ocsp.cc (right):

http://codereview.chromium.org/460067/diff/12001/13001#newcode45
net/ocsp/nss_ocsp.cc:45: request_context_ = NULL;
Do we need to set request_context_ to NULL? Or is this
just defensive programming?

http://codereview.chromium.org/460067/diff/12001/13001#newcode129
net/ocsp/nss_ocsp.cc:129: DCHECK(!io_loop_);
On 2009/12/15 18:43:22, Marc-Antoine Ruel wrote:
> This function is fine to be called without a lock? If so, comment why.

This subtle point is worth a comment.  Some sort of locking
is indeed required, but it's done by the PostTaskToIOLoop
method.

http://codereview.chromium.org/460067/diff/12001/13001#newcode252
net/ocsp/nss_ocsp.cc:252: AutoLock autolock(lock_);
If we don't have reference leaks, when this destructor
is called, there should be only one thread that has
a reference to this object, and so that thread doesn't
need to lock lock_.

http://codereview.chromium.org/460067/diff/12001/13001#newcode563
net/ocsp/nss_ocsp.cc:563: OCSPInitSingleton::OCSPInitSingleton()
On 2009/12/15 18:43:22, Marc-Antoine Ruel wrote:
> I wonder why the constructor has been moved this far at the bottom of the
file.
> Please don't move this function in this change though.

Yeah, I also hate this.  We should move this function
in a follow-up CL.

Powered by Google App Engine
This is Rietveld 408576698