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

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

Issue 10559036: Added URLRequestContext to constructor for URLRequest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with latest version Created 8 years, 6 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (url_request_context == NULL) 359 if (url_request_context == NULL)
360 return; 360 return;
361 361
362 { 362 {
363 base::AutoLock autolock(lock_); 363 base::AutoLock autolock(lock_);
364 DCHECK(!io_loop_); 364 DCHECK(!io_loop_);
365 io_loop_ = MessageLoopForIO::current(); 365 io_loop_ = MessageLoopForIO::current();
366 g_ocsp_io_loop.Get().AddRequest(this); 366 g_ocsp_io_loop.Get().AddRequest(this);
367 } 367 }
368 368
369 request_ = new net::URLRequest(url_, this); 369 request_ = new net::URLRequest(url_, this, url_request_context);
370 request_->set_context(url_request_context);
371 // To meet the privacy requirements of incognito mode. 370 // To meet the privacy requirements of incognito mode.
372 request_->set_load_flags( 371 request_->set_load_flags(
373 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES | 372 net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES |
374 net::LOAD_DO_NOT_SEND_COOKIES); 373 net::LOAD_DO_NOT_SEND_COOKIES);
375 374
376 if (http_request_method_ == "POST") { 375 if (http_request_method_ == "POST") {
377 DCHECK(!upload_content_.empty()); 376 DCHECK(!upload_content_.empty());
378 DCHECK(!upload_content_type_.empty()); 377 DCHECK(!upload_content_type_.empty());
379 378
380 request_->set_method("POST"); 379 request_->set_method("POST");
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { 931 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) {
933 pthread_mutex_lock(&g_request_context_lock); 932 pthread_mutex_lock(&g_request_context_lock);
934 if (request_context) { 933 if (request_context) {
935 DCHECK(!g_request_context); 934 DCHECK(!g_request_context);
936 } 935 }
937 g_request_context = request_context; 936 g_request_context = request_context;
938 pthread_mutex_unlock(&g_request_context_lock); 937 pthread_mutex_unlock(&g_request_context_lock);
939 } 938 }
940 939
941 } // namespace net 940 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698