OLD | NEW |
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 14 matching lines...) Expand all Loading... |
25 #include "base/stl_util.h" | 25 #include "base/stl_util.h" |
26 #include "base/strings/string_util.h" | 26 #include "base/strings/string_util.h" |
27 #include "base/strings/stringprintf.h" | 27 #include "base/strings/stringprintf.h" |
28 #include "base/synchronization/condition_variable.h" | 28 #include "base/synchronization/condition_variable.h" |
29 #include "base/synchronization/lock.h" | 29 #include "base/synchronization/lock.h" |
30 #include "base/threading/thread_checker.h" | 30 #include "base/threading/thread_checker.h" |
31 #include "base/time/time.h" | 31 #include "base/time/time.h" |
32 #include "net/base/host_port_pair.h" | 32 #include "net/base/host_port_pair.h" |
33 #include "net/base/io_buffer.h" | 33 #include "net/base/io_buffer.h" |
34 #include "net/base/load_flags.h" | 34 #include "net/base/load_flags.h" |
| 35 #include "net/base/request_priority.h" |
35 #include "net/base/upload_bytes_element_reader.h" | 36 #include "net/base/upload_bytes_element_reader.h" |
36 #include "net/base/upload_data_stream.h" | 37 #include "net/base/upload_data_stream.h" |
37 #include "net/http/http_request_headers.h" | 38 #include "net/http/http_request_headers.h" |
38 #include "net/http/http_response_headers.h" | 39 #include "net/http/http_response_headers.h" |
39 #include "net/url_request/url_request.h" | 40 #include "net/url_request/url_request.h" |
40 #include "net/url_request/url_request_context.h" | 41 #include "net/url_request/url_request_context.h" |
41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
42 | 43 |
43 namespace net { | 44 namespace net { |
44 | 45 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 if (url_request_context == NULL) | 387 if (url_request_context == NULL) |
387 return; | 388 return; |
388 | 389 |
389 { | 390 { |
390 base::AutoLock autolock(lock_); | 391 base::AutoLock autolock(lock_); |
391 DCHECK(!io_loop_); | 392 DCHECK(!io_loop_); |
392 io_loop_ = base::MessageLoopForIO::current(); | 393 io_loop_ = base::MessageLoopForIO::current(); |
393 g_ocsp_io_loop.Get().AddRequest(this); | 394 g_ocsp_io_loop.Get().AddRequest(this); |
394 } | 395 } |
395 | 396 |
396 request_ = new URLRequest(url_, this, url_request_context); | 397 request_ = |
| 398 new URLRequest(url_, DEFAULT_PRIORITY, this, url_request_context); |
397 // To meet the privacy requirements of incognito mode. | 399 // To meet the privacy requirements of incognito mode. |
398 request_->set_load_flags(LOAD_DISABLE_CACHE | LOAD_DO_NOT_SAVE_COOKIES | | 400 request_->set_load_flags(LOAD_DISABLE_CACHE | LOAD_DO_NOT_SAVE_COOKIES | |
399 LOAD_DO_NOT_SEND_COOKIES); | 401 LOAD_DO_NOT_SEND_COOKIES); |
400 | 402 |
401 if (http_request_method_ == "POST") { | 403 if (http_request_method_ == "POST") { |
402 DCHECK(!upload_content_.empty()); | 404 DCHECK(!upload_content_.empty()); |
403 DCHECK(!upload_content_type_.empty()); | 405 DCHECK(!upload_content_type_.empty()); |
404 | 406 |
405 request_->set_method("POST"); | 407 request_->set_method("POST"); |
406 extra_request_headers_.SetHeader( | 408 extra_request_headers_.SetHeader( |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { | 967 void SetURLRequestContextForNSSHttpIO(URLRequestContext* request_context) { |
966 pthread_mutex_lock(&g_request_context_lock); | 968 pthread_mutex_lock(&g_request_context_lock); |
967 if (request_context) { | 969 if (request_context) { |
968 DCHECK(!g_request_context); | 970 DCHECK(!g_request_context); |
969 } | 971 } |
970 g_request_context = request_context; | 972 g_request_context = request_context; |
971 pthread_mutex_unlock(&g_request_context_lock); | 973 pthread_mutex_unlock(&g_request_context_lock); |
972 } | 974 } |
973 | 975 |
974 } // namespace net | 976 } // namespace net |
OLD | NEW |