summaryrefslogtreecommitdiffstats
path: root/net/ocsp
diff options
context:
space:
mode:
authorukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:40:40 +0000
committerukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:40:40 +0000
commit9c214d9e2dcc0e2d4565fefb2702c194018e2b0d (patch)
tree458cb845b56f04abf72a934c0df67770b4fb560e /net/ocsp
parent440a52ad2c9ab5d3175bd4966ab835286b71e093 (diff)
downloadchromium_src-9c214d9e2dcc0e2d4565fefb2702c194018e2b0d.zip
chromium_src-9c214d9e2dcc0e2d4565fefb2702c194018e2b0d.tar.gz
chromium_src-9c214d9e2dcc0e2d4565fefb2702c194018e2b0d.tar.bz2
Don't call CancelURLRequest if request_is already NULL.
Fix DCHECK when io_loop_ is NULL http://code.google.com/p/chromium/issues/detail?id=23437#c8 hits DCHECK at nss_ocsp.cc:281 in CancelURLRequest(). CancelURLRequest() is called from Cancel() if io_loop_ is not NULL. Maybe, we don't need to call CancelURLRequest if request_ is already NULL, which happens when request is completed in OnReadCompleted(). BUG=23437 TEST=none Review URL: http://codereview.chromium.org/405013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32306 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ocsp')
-rw-r--r--net/ocsp/nss_ocsp.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc
index 661935f..a082dde 100644
--- a/net/ocsp/nss_ocsp.cc
+++ b/net/ocsp/nss_ocsp.cc
@@ -126,7 +126,7 @@ class OCSPRequestSession
}
void Cancel() {
- if (io_loop_) {
+ if (io_loop_ && request_) {
io_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this, &OCSPRequestSession::CancelURLRequest));
@@ -190,8 +190,8 @@ class OCSPRequestSession
}
virtual void OnResponseStarted(URLRequest* request) {
- DCHECK(request == request_);
- DCHECK(MessageLoopForIO::current() == io_loop_);
+ DCHECK_EQ(request, request_);
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
int bytes_read = 0;
if (request->status().is_success()) {
@@ -204,8 +204,8 @@ class OCSPRequestSession
}
virtual void OnReadCompleted(URLRequest* request, int bytes_read) {
- DCHECK(request == request_);
- DCHECK(MessageLoopForIO::current() == io_loop_);
+ DCHECK_EQ(request, request_);
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
do {
if (!request_->status().is_success() || bytes_read <= 0)
@@ -227,7 +227,7 @@ class OCSPRequestSession
}
virtual void WillDestroyCurrentMessageLoop() {
- DCHECK(MessageLoopForIO::current() == io_loop_);
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
if (request_) {
request_->Cancel();
delete request_;
@@ -247,7 +247,7 @@ class OCSPRequestSession
}
void StartURLRequest() {
- DCHECK(MessageLoopForIO::current() == io_loop_);
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
DCHECK(!request_);
io_loop_->AddDestructionObserver(this);
@@ -278,7 +278,7 @@ class OCSPRequestSession
}
void CancelURLRequest() {
- DCHECK(MessageLoopForIO::current() == io_loop_);
+ DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
if (request_) {
request_->Cancel();
delete request_;