| 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 <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 int GetIdleSocketCountInSSLSocketPool(net::HttpNetworkSession* session) { | 117 int GetIdleSocketCountInSSLSocketPool(net::HttpNetworkSession* session) { |
| 118 return session->GetSSLSocketPool( | 118 return session->GetSSLSocketPool( |
| 119 net::HttpNetworkSession::NORMAL_SOCKET_POOL)->IdleSocketCount(); | 119 net::HttpNetworkSession::NORMAL_SOCKET_POOL)->IdleSocketCount(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Takes in a Value created from a NetLogHttpResponseParameter, and returns | 122 // Takes in a Value created from a NetLogHttpResponseParameter, and returns |
| 123 // a JSONified list of headers as a single string. Uses single quotes instead | 123 // a JSONified list of headers as a single string. Uses single quotes instead |
| 124 // of double quotes for easier comparison. Returns false on failure. | 124 // of double quotes for easier comparison. Returns false on failure. |
| 125 bool GetHeaders(DictionaryValue* params, std::string* headers) { | 125 bool GetHeaders(base::DictionaryValue* params, std::string* headers) { |
| 126 if (!params) | 126 if (!params) |
| 127 return false; | 127 return false; |
| 128 ListValue* header_list; | 128 base::ListValue* header_list; |
| 129 if (!params->GetList("headers", &header_list)) | 129 if (!params->GetList("headers", &header_list)) |
| 130 return false; | 130 return false; |
| 131 std::string double_quote_headers; | 131 std::string double_quote_headers; |
| 132 base::JSONWriter::Write(header_list, &double_quote_headers); | 132 base::JSONWriter::Write(header_list, &double_quote_headers); |
| 133 ReplaceChars(double_quote_headers, "\"", "'", headers); | 133 ReplaceChars(double_quote_headers, "\"", "'", headers); |
| 134 return true; | 134 return true; |
| 135 } | 135 } |
| 136 | 136 |
| 137 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is | 137 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is |
| 138 // used. | 138 // used. |
| (...skipping 11264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11403 EXPECT_EQ("hello!", response_data); | 11403 EXPECT_EQ("hello!", response_data); |
| 11404 EXPECT_FALSE( | 11404 EXPECT_FALSE( |
| 11405 session->spdy_session_pool()->HasSession(spdy_session_key_a)); | 11405 session->spdy_session_pool()->HasSession(spdy_session_key_a)); |
| 11406 EXPECT_FALSE( | 11406 EXPECT_FALSE( |
| 11407 session->spdy_session_pool()->HasSession(spdy_session_key_b)); | 11407 session->spdy_session_pool()->HasSession(spdy_session_key_b)); |
| 11408 | 11408 |
| 11409 HttpStreamFactory::SetNextProtos(std::vector<std::string>()); | 11409 HttpStreamFactory::SetNextProtos(std::vector<std::string>()); |
| 11410 } | 11410 } |
| 11411 | 11411 |
| 11412 } // namespace net | 11412 } // namespace net |
| OLD | NEW |