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

Unified Diff: net/test/spawned_test_server/base_test_server.cc

Issue 2792573002: Remove base::Value::CreateNullValue (Closed)
Patch Set: Rebase Created 3 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 | « mojo/common/values_struct_traits.cc ('k') | net/test/spawned_test_server/remote_test_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/test/spawned_test_server/base_test_server.cc
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc
index afc77f3758947d116ce863d55bad3967403b5b26..2f02922556fb60fce5538151cd65167744d32b59 100644
--- a/net/test/spawned_test_server/base_test_server.cc
+++ b/net/test/spawned_test_server/base_test_server.cc
@@ -14,6 +14,7 @@
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/path_service.h"
#include "base/values.h"
#include "net/base/address_list.h"
@@ -535,16 +536,16 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
arguments->SetString("data-dir", document_root_.value());
if (VLOG_IS_ON(1) || log_to_console_)
- arguments->Set("log-to-console", base::Value::CreateNullValue());
+ arguments->Set("log-to-console", base::MakeUnique<base::Value>());
if (ws_basic_auth_) {
DCHECK(type_ == TYPE_WS || type_ == TYPE_WSS);
- arguments->Set("ws-basic-auth", base::Value::CreateNullValue());
+ arguments->Set("ws-basic-auth", base::MakeUnique<base::Value>());
}
if (no_anonymous_ftp_user_) {
DCHECK_EQ(TYPE_FTP, type_);
- arguments->Set("no-anonymous-ftp-user", base::Value::CreateNullValue());
+ arguments->Set("no-anonymous-ftp-user", base::MakeUnique<base::Value>());
}
if (UsingSSL(type_)) {
@@ -564,7 +565,7 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
// Check the client certificate related arguments.
if (ssl_options_.request_client_certificate)
- arguments->Set("ssl-client-auth", base::Value::CreateNullValue());
+ arguments->Set("ssl-client-auth", base::MakeUnique<base::Value>());
std::unique_ptr<base::ListValue> ssl_client_certs(new base::ListValue());
std::vector<base::FilePath>::const_iterator it;
@@ -591,11 +592,11 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
}
if (type_ == TYPE_HTTPS) {
- arguments->Set("https", base::Value::CreateNullValue());
+ arguments->Set("https", base::MakeUnique<base::Value>());
if (ssl_options_.server_certificate ==
SSLOptions::CERT_AUTO_AIA_INTERMEDIATE)
- arguments->Set("aia-intermediate", base::Value::CreateNullValue());
+ arguments->Set("aia-intermediate", base::MakeUnique<base::Value>());
std::string ocsp_arg = ssl_options_.GetOCSPArgument();
if (!ocsp_arg.empty())
@@ -624,14 +625,14 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
if (bulk_cipher_values->GetSize())
arguments->Set("ssl-bulk-cipher", bulk_cipher_values.release());
if (ssl_options_.record_resume)
- arguments->Set("https-record-resume", base::Value::CreateNullValue());
+ arguments->Set("https-record-resume", base::MakeUnique<base::Value>());
if (ssl_options_.tls_intolerant != SSLOptions::TLS_INTOLERANT_NONE) {
arguments->SetInteger("tls-intolerant", ssl_options_.tls_intolerant);
arguments->Set("tls-intolerance-type", GetTLSIntoleranceType(
ssl_options_.tls_intolerance_type));
}
if (ssl_options_.fallback_scsv_enabled)
- arguments->Set("fallback-scsv", base::Value::CreateNullValue());
+ arguments->Set("fallback-scsv", base::MakeUnique<base::Value>());
if (!ssl_options_.signed_cert_timestamps_tls_ext.empty()) {
std::string b64_scts_tls_ext;
base::Base64Encode(ssl_options_.signed_cert_timestamps_tls_ext,
@@ -639,10 +640,10 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
arguments->SetString("signed-cert-timestamps-tls-ext", b64_scts_tls_ext);
}
if (ssl_options_.staple_ocsp_response)
- arguments->Set("staple-ocsp-response", base::Value::CreateNullValue());
+ arguments->Set("staple-ocsp-response", base::MakeUnique<base::Value>());
if (ssl_options_.ocsp_server_unavailable) {
arguments->Set("ocsp-server-unavailable",
- base::Value::CreateNullValue());
+ base::MakeUnique<base::Value>());
}
if (!ssl_options_.alpn_protocols.empty()) {
std::unique_ptr<base::ListValue> alpn_protocols(new base::ListValue());
@@ -659,13 +660,13 @@ bool BaseTestServer::GenerateArguments(base::DictionaryValue* arguments) const {
arguments->Set("npn-protocols", std::move(npn_protocols));
}
if (ssl_options_.alert_after_handshake)
- arguments->Set("alert-after-handshake", base::Value::CreateNullValue());
+ arguments->Set("alert-after-handshake", base::MakeUnique<base::Value>());
if (ssl_options_.disable_channel_id)
- arguments->Set("disable-channel-id", base::Value::CreateNullValue());
+ arguments->Set("disable-channel-id", base::MakeUnique<base::Value>());
if (ssl_options_.disable_extended_master_secret) {
arguments->Set("disable-extended-master-secret",
- base::Value::CreateNullValue());
+ base::MakeUnique<base::Value>());
}
if (!ssl_options_.supported_token_binding_params.empty()) {
std::unique_ptr<base::ListValue> token_binding_params(
« no previous file with comments | « mojo/common/values_struct_traits.cc ('k') | net/test/spawned_test_server/remote_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698