| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 namespace { | 127 namespace { |
| 128 | 128 |
| 129 HttpNetworkSession* CreateSession(SpdySessionDependencies* session_deps) { | 129 HttpNetworkSession* CreateSession(SpdySessionDependencies* session_deps) { |
| 130 return SpdySessionDependencies::SpdyCreateSession(session_deps); | 130 return SpdySessionDependencies::SpdyCreateSession(session_deps); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Takes in a Value created from a NetLogHttpResponseParameter, and returns | 133 // Takes in a Value created from a NetLogHttpResponseParameter, and returns |
| 134 // a JSONified list of headers as a single string. Uses single quotes instead | 134 // a JSONified list of headers as a single string. Uses single quotes instead |
| 135 // of double quotes for easier comparison. Returns false on failure. | 135 // of double quotes for easier comparison. Returns false on failure. |
| 136 bool GetHeaders(DictionaryValue* params, std::string* headers) { | 136 bool GetHeaders(base::DictionaryValue* params, std::string* headers) { |
| 137 if (!params) | 137 if (!params) |
| 138 return false; | 138 return false; |
| 139 ListValue* header_list; | 139 base::ListValue* header_list; |
| 140 if (!params->GetList("headers", &header_list)) | 140 if (!params->GetList("headers", &header_list)) |
| 141 return false; | 141 return false; |
| 142 std::string double_quote_headers; | 142 std::string double_quote_headers; |
| 143 base::JSONWriter::Write(header_list, &double_quote_headers); | 143 base::JSONWriter::Write(header_list, &double_quote_headers); |
| 144 ReplaceChars(double_quote_headers, "\"", "'", headers); | 144 ReplaceChars(double_quote_headers, "\"", "'", headers); |
| 145 return true; | 145 return true; |
| 146 } | 146 } |
| 147 | 147 |
| 148 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is | 148 // Tests LoadTimingInfo in the case a socket is reused and no PAC script is |
| 149 // used. | 149 // used. |
| (...skipping 11206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11356 EXPECT_EQ("hello!", response_data); | 11356 EXPECT_EQ("hello!", response_data); |
| 11357 EXPECT_FALSE( | 11357 EXPECT_FALSE( |
| 11358 session->spdy_session_pool()->HasSession(spdy_session_key_a)); | 11358 session->spdy_session_pool()->HasSession(spdy_session_key_a)); |
| 11359 EXPECT_FALSE( | 11359 EXPECT_FALSE( |
| 11360 session->spdy_session_pool()->HasSession(spdy_session_key_b)); | 11360 session->spdy_session_pool()->HasSession(spdy_session_key_b)); |
| 11361 | 11361 |
| 11362 HttpStreamFactory::SetNextProtos(std::vector<std::string>()); | 11362 HttpStreamFactory::SetNextProtos(std::vector<std::string>()); |
| 11363 } | 11363 } |
| 11364 | 11364 |
| 11365 } // namespace net | 11365 } // namespace net |
| OLD | NEW |