| 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 using base::TimeDelta; | 72 using base::TimeDelta; |
| 73 | 73 |
| 74 namespace net { | 74 namespace net { |
| 75 | 75 |
| 76 namespace { | 76 namespace { |
| 77 | 77 |
| 78 void ProcessAlternateProtocol( | 78 void ProcessAlternateProtocol( |
| 79 HttpNetworkSession* session, | 79 HttpNetworkSession* session, |
| 80 const HttpResponseHeaders& headers, | 80 const HttpResponseHeaders& headers, |
| 81 const HostPortPair& http_host_port_pair) { | 81 const HostPortPair& http_host_port_pair) { |
| 82 if (!headers.HasHeader(kAlternateProtocolHeader)) |
| 83 return; |
| 84 |
| 85 std::vector<std::string> alternate_protocol_values; |
| 86 void* iter = NULL; |
| 82 std::string alternate_protocol_str; | 87 std::string alternate_protocol_str; |
| 83 | 88 while (headers.EnumerateHeader(&iter, kAlternateProtocolHeader, |
| 84 if (!headers.EnumerateHeader(NULL, kAlternateProtocolHeader, | 89 &alternate_protocol_str)) { |
| 85 &alternate_protocol_str)) { | 90 alternate_protocol_values.push_back(alternate_protocol_str); |
| 86 // Header is not present. | |
| 87 return; | |
| 88 } | 91 } |
| 89 | 92 |
| 90 session->http_stream_factory()->ProcessAlternateProtocol( | 93 session->http_stream_factory()->ProcessAlternateProtocol( |
| 91 session->http_server_properties(), | 94 session->http_server_properties(), |
| 92 alternate_protocol_str, | 95 alternate_protocol_values, |
| 93 http_host_port_pair, | 96 http_host_port_pair, |
| 94 *session); | 97 *session); |
| 95 } | 98 } |
| 96 | 99 |
| 97 // Returns true if |error| is a client certificate authentication error. | 100 // Returns true if |error| is a client certificate authentication error. |
| 98 bool IsClientCertificateError(int error) { | 101 bool IsClientCertificateError(int error) { |
| 99 switch (error) { | 102 switch (error) { |
| 100 case ERR_BAD_SSL_CLIENT_AUTH_CERT: | 103 case ERR_BAD_SSL_CLIENT_AUTH_CERT: |
| 101 case ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED: | 104 case ERR_SSL_CLIENT_AUTH_PRIVATE_KEY_ACCESS_DENIED: |
| 102 case ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY: | 105 case ERR_SSL_CLIENT_AUTH_CERT_NO_PRIVATE_KEY: |
| (...skipping 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1554 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1552 state); | 1555 state); |
| 1553 break; | 1556 break; |
| 1554 } | 1557 } |
| 1555 return description; | 1558 return description; |
| 1556 } | 1559 } |
| 1557 | 1560 |
| 1558 #undef STATE_CASE | 1561 #undef STATE_CASE |
| 1559 | 1562 |
| 1560 } // namespace net | 1563 } // namespace net |
| OLD | NEW |