OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/spawned_test_server/base_test_server.h" | 5 #include "net/test/spawned_test_server/base_test_server.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 std::string new_file_path = original_file_path; | 219 std::string new_file_path = original_file_path; |
220 bool first_query_parameter = true; | 220 bool first_query_parameter = true; |
221 const std::vector<StringPair>::const_iterator end = text_to_replace.end(); | 221 const std::vector<StringPair>::const_iterator end = text_to_replace.end(); |
222 for (std::vector<StringPair>::const_iterator it = text_to_replace.begin(); | 222 for (std::vector<StringPair>::const_iterator it = text_to_replace.begin(); |
223 it != end; | 223 it != end; |
224 ++it) { | 224 ++it) { |
225 const std::string& old_text = it->first; | 225 const std::string& old_text = it->first; |
226 const std::string& new_text = it->second; | 226 const std::string& new_text = it->second; |
227 std::string base64_old; | 227 std::string base64_old; |
228 std::string base64_new; | 228 std::string base64_new; |
229 if (!base::Base64Encode(old_text, &base64_old)) | 229 base::Base64Encode(old_text, &base64_old); |
230 return false; | 230 base::Base64Encode(new_text, &base64_new); |
231 if (!base::Base64Encode(new_text, &base64_new)) | |
232 return false; | |
233 if (first_query_parameter) { | 231 if (first_query_parameter) { |
234 new_file_path += "?"; | 232 new_file_path += "?"; |
235 first_query_parameter = false; | 233 first_query_parameter = false; |
236 } else { | 234 } else { |
237 new_file_path += "&"; | 235 new_file_path += "&"; |
238 } | 236 } |
239 new_file_path += "replace_text="; | 237 new_file_path += "replace_text="; |
240 new_file_path += base64_old; | 238 new_file_path += base64_old; |
241 new_file_path += ":"; | 239 new_file_path += ":"; |
242 new_file_path += base64_new; | 240 new_file_path += base64_new; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 if (bulk_cipher_values->GetSize()) | 391 if (bulk_cipher_values->GetSize()) |
394 arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release()); | 392 arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release()); |
395 if (ssl_options_.record_resume) | 393 if (ssl_options_.record_resume) |
396 arguments->Set("https-record-resume", base::Value::CreateNullValue()); | 394 arguments->Set("https-record-resume", base::Value::CreateNullValue()); |
397 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) { | 395 if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) { |
398 arguments->Set("tls-intolerant", | 396 arguments->Set("tls-intolerant", |
399 new base::FundamentalValue(ssl_options_.tls_intolerant)); | 397 new base::FundamentalValue(ssl_options_.tls_intolerant)); |
400 } | 398 } |
401 if (!ssl_options_.signed_cert_timestamps.empty()) { | 399 if (!ssl_options_.signed_cert_timestamps.empty()) { |
402 std::string b64_scts; | 400 std::string b64_scts; |
403 if (!base::Base64Encode(ssl_options_.signed_cert_timestamps, &b64_scts)) | 401 base::Base64Encode(ssl_options_.signed_cert_timestamps, &b64_scts); |
404 return false; | |
405 arguments->SetString("signed-cert-timestamps", b64_scts); | 402 arguments->SetString("signed-cert-timestamps", b64_scts); |
406 } | 403 } |
407 } | 404 } |
408 | 405 |
409 return GenerateAdditionalArguments(arguments); | 406 return GenerateAdditionalArguments(arguments); |
410 } | 407 } |
411 | 408 |
412 bool BaseTestServer::GenerateAdditionalArguments( | 409 bool BaseTestServer::GenerateAdditionalArguments( |
413 base::DictionaryValue* arguments) const { | 410 base::DictionaryValue* arguments) const { |
414 return true; | 411 return true; |
415 } | 412 } |
416 | 413 |
417 } // namespace net | 414 } // namespace net |
OLD | NEW |