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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 1142413004: HttpServerProperties - Don't persist if ConfirmAlternativeService is (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 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 | « no previous file | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 1a1ab79c48648509c3619fdd757476d62cb5a86c..d4faf0ee8a649597a95209ff0345c7d676a928cd 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -245,8 +245,15 @@ bool HttpServerPropertiesManager::WasAlternativeServiceRecentlyBroken(
void HttpServerPropertiesManager::ConfirmAlternativeService(
const AlternativeService& alternative_service) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
+ bool old_value = http_server_properties_impl_->IsAlternativeServiceBroken(
+ alternative_service);
http_server_properties_impl_->ConfirmAlternativeService(alternative_service);
- ScheduleUpdatePrefsOnNetworkThread(CONFIRM_ALTERNATIVE_SERVICE);
+ bool new_value = http_server_properties_impl_->IsAlternativeServiceBroken(
+ alternative_service);
+ // For persisting, we only care about the value returned by
+ // IsAlternativeServiceBroken. If that value changes, then call persist.
+ if (old_value != new_value)
+ ScheduleUpdatePrefsOnNetworkThread(CONFIRM_ALTERNATIVE_SERVICE);
}
void HttpServerPropertiesManager::ClearAlternativeService(
« no previous file with comments | « no previous file | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698