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

Side by Side Diff: net/ocsp/nss_ocsp.cc

Issue 460040: Do not set io_loop_ to NULL until we have deleted request_ and set... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Upload before checkin Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ocsp/nss_ocsp.h" 5 #include "net/ocsp/nss_ocsp.h"
6 6
7 #include <certt.h> 7 #include <certt.h>
8 #include <certdb.h> 8 #include <certdb.h>
9 #include <ocsp.h> 9 #include <ocsp.h>
10 #include <nspr.h> 10 #include <nspr.h>
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 DCHECK_EQ(request, request_); 209 DCHECK_EQ(request, request_);
210 DCHECK_EQ(MessageLoopForIO::current(), io_loop_); 210 DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
211 211
212 do { 212 do {
213 if (!request_->status().is_success() || bytes_read <= 0) 213 if (!request_->status().is_success() || bytes_read <= 0)
214 break; 214 break;
215 data_.append(buffer_->data(), bytes_read); 215 data_.append(buffer_->data(), bytes_read);
216 } while (request_->Read(buffer_, kRecvBufferSize, &bytes_read)); 216 } while (request_->Read(buffer_, kRecvBufferSize, &bytes_read));
217 217
218 if (!request_->status().is_io_pending()) { 218 if (!request_->status().is_io_pending()) {
219 MessageLoop* io_loop = io_loop_; 219 delete request_;
220 request_ = NULL;
221 io_loop_->RemoveDestructionObserver(this);
220 { 222 {
221 AutoLock autolock(lock_); 223 AutoLock autolock(lock_);
222 finished_ = true; 224 finished_ = true;
223 io_loop_ = NULL; 225 io_loop_ = NULL;
224 } 226 }
225 cv_.Signal(); 227 cv_.Signal();
226 delete request_;
227 request_ = NULL;
228 io_loop->RemoveDestructionObserver(this);
229 } 228 }
230 } 229 }
231 230
232 virtual void WillDestroyCurrentMessageLoop() { 231 virtual void WillDestroyCurrentMessageLoop() {
233 DCHECK_EQ(MessageLoopForIO::current(), io_loop_); 232 DCHECK_EQ(MessageLoopForIO::current(), io_loop_);
234 { 233 {
235 AutoLock autolock(lock_); 234 AutoLock autolock(lock_);
236 io_loop_ = NULL; 235 io_loop_ = NULL;
237 } 236 }
238 if (request_) { 237 if (request_) {
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // This function would be called before NSS initialization. 558 // This function would be called before NSS initialization.
560 void SetURLRequestContextForOCSP(URLRequestContext* request_context) { 559 void SetURLRequestContextForOCSP(URLRequestContext* request_context) {
561 OCSPInitSingleton::set_url_request_context(request_context); 560 OCSPInitSingleton::set_url_request_context(request_context);
562 } 561 }
563 562
564 URLRequestContext* GetURLRequestContextForOCSP() { 563 URLRequestContext* GetURLRequestContextForOCSP() {
565 return OCSPInitSingleton::url_request_context(); 564 return OCSPInitSingleton::url_request_context();
566 } 565 }
567 566
568 } // namespace net 567 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698