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

Unified Diff: net/http/http_response_info.cc

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 8 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
« no previous file with comments | « net/http/http_response_info.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_info.cc
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index e50a46f35354ca5b39d481021a22b1885fb4ae21..a4d672da4b00f17bc9c1db7f0596656c3b3b61ad 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -84,6 +84,9 @@ enum {
// This bit is set if the response info has connection info.
RESPONSE_INFO_HAS_CONNECTION_INFO = 1 << 18,
+ // This bit is set if the request has http authentication.
+ RESPONSE_INFO_USE_HTTP_AUTHENTICATION = 1 << 19,
+
// TODO(darin): Add other bits to indicate alternate request methods.
// For now, we don't support storing those.
};
@@ -94,6 +97,7 @@ HttpResponseInfo::HttpResponseInfo()
was_fetched_via_spdy(false),
was_npn_negotiated(false),
was_fetched_via_proxy(false),
+ did_use_http_auth(false),
connection_info(CONNECTION_INFO_UNKNOWN) {
}
@@ -103,6 +107,7 @@ HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs)
was_fetched_via_spdy(rhs.was_fetched_via_spdy),
was_npn_negotiated(rhs.was_npn_negotiated),
was_fetched_via_proxy(rhs.was_fetched_via_proxy),
+ did_use_http_auth(rhs.did_use_http_auth),
socket_address(rhs.socket_address),
npn_negotiated_protocol(rhs.npn_negotiated_protocol),
connection_info(rhs.connection_info),
@@ -125,6 +130,7 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) {
was_fetched_via_spdy = rhs.was_fetched_via_spdy;
was_npn_negotiated = rhs.was_npn_negotiated;
was_fetched_via_proxy = rhs.was_fetched_via_proxy;
+ did_use_http_auth = rhs.did_use_http_auth;
socket_address = rhs.socket_address;
npn_negotiated_protocol = rhs.npn_negotiated_protocol;
request_time = rhs.request_time;
@@ -243,6 +249,8 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
*response_truncated = (flags & RESPONSE_INFO_TRUNCATED) != 0;
+ did_use_http_auth = (flags & RESPONSE_INFO_USE_HTTP_AUTHENTICATION) != 0;
+
return true;
}
@@ -272,6 +280,8 @@ void HttpResponseInfo::Persist(Pickle* pickle,
flags |= RESPONSE_INFO_WAS_PROXY;
if (connection_info != CONNECTION_INFO_UNKNOWN)
flags |= RESPONSE_INFO_HAS_CONNECTION_INFO;
+ if (did_use_http_auth)
+ flags |= RESPONSE_INFO_USE_HTTP_AUTHENTICATION;
pickle->WriteInt(flags);
pickle->WriteInt64(request_time.ToInternalValue());
« no previous file with comments | « net/http/http_response_info.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698