summaryrefslogtreecommitdiffstats
path: root/net/url_request/url_request.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-07 07:47:52 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-07 07:47:52 +0000
commitcdb11b555f79840fc9f793d808af13bcaf9bd1f7 (patch)
treef4b81528e7f534fe25b7e2c60321a7324ff4b956 /net/url_request/url_request.cc
parent61e978ad63e1963c41db50e7b9b40580391a6170 (diff)
downloadchromium_src-cdb11b555f79840fc9f793d808af13bcaf9bd1f7.zip
chromium_src-cdb11b555f79840fc9f793d808af13bcaf9bd1f7.tar.gz
chromium_src-cdb11b555f79840fc9f793d808af13bcaf9bd1f7.tar.bz2
Landing again the CL that adds security info to canceled requests (it was breaking NPAPI tests on Vista due to an erroneuous commented line).
TBR=darin Review URL: http://codereview.chromium.org/39309 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request/url_request.cc')
-rw-r--r--net/url_request/url_request.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index fefd24c..3de8439 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -260,10 +260,23 @@ void URLRequest::Start() {
}
void URLRequest::Cancel() {
- CancelWithError(net::ERR_ABORTED);
+ DoCancel(net::ERR_ABORTED, net::SSLInfo());
}
-void URLRequest::CancelWithError(int os_error) {
+void URLRequest::SimulateError(int os_error) {
+ DoCancel(os_error, net::SSLInfo());
+}
+
+void URLRequest::SimulateSSLError(int os_error, const net::SSLInfo& ssl_info) {
+ // This should only be called on a started request.
+ if (!is_pending_ || !job_ || job_->has_response_started()) {
+ NOTREACHED();
+ return;
+ }
+ DoCancel(os_error, ssl_info);
+}
+
+void URLRequest::DoCancel(int os_error, const net::SSLInfo& ssl_info) {
DCHECK(os_error < 0);
// If the URL request already has an error status, then canceling is a no-op.
@@ -271,6 +284,7 @@ void URLRequest::CancelWithError(int os_error) {
if (status_.is_success()) {
status_.set_status(URLRequestStatus::CANCELED);
status_.set_os_error(os_error);
+ response_info_.ssl_info = ssl_info;
}
// There's nothing to do if we are not waiting on a Job.