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

Issue 1769010: [Mac] Add locking as speculative fix for X509Certificate crashes. (Closed)

Created:
10 years, 8 months ago by Jens Alfke
Modified:
9 years, 7 months ago
Reviewers:
wtc
CC:
chromium-reviews, pam+watch_chromium.org, John Grabowski, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

[Mac] Add locking as speculative fix for X509Certificate crashes. BUG=30001 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45728

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -0 lines) Patch
M net/base/x509_certificate.h View 1 chunk +5 lines, -0 lines 1 comment Download
M net/base/x509_certificate_mac.cc View 1 chunk +3 lines, -0 lines 1 comment Download

Messages

Total messages: 2 (0 generated)
Jens Alfke
Minimal tweak to prevent multiple threads from verifying the same cert at the same time. ...
10 years, 8 months ago (2010-04-26 22:26:03 UTC) #1
wtc
10 years, 8 months ago (2010-04-27 00:06:43 UTC) #2
LGTM.

http://codereview.chromium.org/1769010/diff/1/2
File net/base/x509_certificate.h (right):

http://codereview.chromium.org/1769010/diff/1/2#newcode298
net/base/x509_certificate.h:298: mutable Lock lock_;
Nit: perhaps rename this lock "verify_lock_" to stress the
fact that it applies to the Verify() method only.

Nit: should we explain why this lock is mutable? (because
Verify is a const method)

http://codereview.chromium.org/1769010/diff/1/3
File net/base/x509_certificate_mac.cc (right):

http://codereview.chromium.org/1769010/diff/1/3#newcode450
net/base/x509_certificate_mac.cc:450: // From here on, only one thread can be
active at a time.
It would be nice to explain why you break the Verify method
into two parts at this point.

I guess the code before this point can clearly be executed
by multiple threads.  After this point, it's less clear.
And we know for sure that we do not want multiple threads
to call SecTrustEvaluate (line 503) simultaneously.

Powered by Google App Engine
This is Rietveld 408576698