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

Unified Diff: net/url_request/url_request.cc

Issue 7276: Adding security info to canceled requests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request.cc
===================================================================
--- net/url_request/url_request.cc (revision 9948)
+++ net/url_request/url_request.cc (working copy)
@@ -228,10 +228,23 @@
}
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) {
+ SimulateSSLError(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.
@@ -239,6 +252,7 @@
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.

Powered by Google App Engine
This is Rietveld 408576698