Commit c0553baf authored by Eric Roman's avatar Eric Roman Committed by Commit Bot

[cleanup] Use base::nullopt in //net/proxy_resolution

Change-Id: I2451fcbfd31bb70628d138838ec95327cb8af91b
Reviewed-on: https://chromium-review.googlesource.com/1066599Reviewed-by: default avatarBence Béky <bnc@chromium.org>
Commit-Queue: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560334}
parent c4a28c47
......@@ -1026,7 +1026,7 @@ ProxyConfigServiceLinux::Delegate::GetConfigFromSettings() {
if (!setting_getter_->GetString(SettingGetter::PROXY_MODE, &mode)) {
// We expect this to always be set, so if we don't see it then we probably
// have a gsettings problem, and so we don't have a valid proxy config.
return base::Optional<ProxyConfigWithAnnotation>();
return base::nullopt;
}
if (mode == "none") {
// Specifically specifies no proxy.
......@@ -1045,7 +1045,7 @@ ProxyConfigServiceLinux::Delegate::GetConfigFromSettings() {
pac_url_str = "file://" + pac_url_str;
GURL pac_url(pac_url_str);
if (!pac_url.is_valid())
return base::Optional<ProxyConfigWithAnnotation>();
return base::nullopt;
config.set_pac_url(pac_url);
return ProxyConfigWithAnnotation(
config, NetworkTrafficAnnotationTag(traffic_annotation_));
......@@ -1058,7 +1058,7 @@ ProxyConfigServiceLinux::Delegate::GetConfigFromSettings() {
if (mode != "manual") {
// Mode is unrecognized.
return base::Optional<ProxyConfigWithAnnotation>();
return base::nullopt;
}
bool use_http_proxy;
if (setting_getter_->GetBool(SettingGetter::PROXY_USE_HTTP_PROXY,
......@@ -1122,7 +1122,7 @@ ProxyConfigServiceLinux::Delegate::GetConfigFromSettings() {
if (config.proxy_rules().empty()) {
// Manual mode but we couldn't parse any rules.
return base::Optional<ProxyConfigWithAnnotation>();
return base::nullopt;
}
// Check for authentication, just so we can warn.
......@@ -1235,7 +1235,7 @@ void ProxyConfigServiceLinux::Delegate::SetUpAndFetchInitialConfig(
// does so even if the proxy mode is set to auto, which would
// mislead us.
cached_config_ = base::Optional<ProxyConfigWithAnnotation>();
cached_config_ = base::nullopt;
if (setting_getter_ && setting_getter_->Init(glib_task_runner)) {
cached_config_ = GetConfigFromSettings();
}
......
......@@ -1487,9 +1487,9 @@ ProxyResolutionService::State ProxyResolutionService::ResetProxyConfig(
init_proxy_resolver_.reset();
SuspendAllPendingRequests();
resolver_.reset();
config_ = base::Optional<ProxyConfigWithAnnotation>();
config_ = base::nullopt;
if (reset_fetched_config)
fetched_config_ = base::Optional<ProxyConfigWithAnnotation>();
fetched_config_ = base::nullopt;
current_state_ = STATE_NONE;
return previous_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment