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

Side by Side Diff: net/http/http_server_properties_manager.cc

Issue 868753007: Change GetCanonicalSuffix() interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_server_properties_manager.h" 5 #include "net/http/http_server_properties_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 new AlternateProtocolMap(kMaxAlternateProtocolHostsToPersist); 606 new AlternateProtocolMap(kMaxAlternateProtocolHostsToPersist);
607 const AlternateProtocolMap& map = 607 const AlternateProtocolMap& map =
608 http_server_properties_impl_->alternate_protocol_map(); 608 http_server_properties_impl_->alternate_protocol_map();
609 count = 0; 609 count = 0;
610 typedef std::map<std::string, bool> CanonicalHostPersistedMap; 610 typedef std::map<std::string, bool> CanonicalHostPersistedMap;
611 CanonicalHostPersistedMap persisted_map; 611 CanonicalHostPersistedMap persisted_map;
612 for (AlternateProtocolMap::const_iterator it = map.begin(); 612 for (AlternateProtocolMap::const_iterator it = map.begin();
613 it != map.end() && count < kMaxAlternateProtocolHostsToPersist; ++it) { 613 it != map.end() && count < kMaxAlternateProtocolHostsToPersist; ++it) {
614 const HostPortPair& server = it->first; 614 const HostPortPair& server = it->first;
615 std::string canonical_suffix = 615 std::string canonical_suffix =
616 http_server_properties_impl_->GetCanonicalSuffix(server); 616 http_server_properties_impl_->GetCanonicalSuffix(server.host());
617 if (!canonical_suffix.empty()) { 617 if (!canonical_suffix.empty()) {
618 if (persisted_map.find(canonical_suffix) != persisted_map.end()) 618 if (persisted_map.find(canonical_suffix) != persisted_map.end())
619 continue; 619 continue;
620 persisted_map[canonical_suffix] = true; 620 persisted_map[canonical_suffix] = true;
621 } 621 }
622 alternate_protocol_map->Put(server, it->second); 622 alternate_protocol_map->Put(server, it->second);
623 ++count; 623 ++count;
624 } 624 }
625 625
626 SupportsQuicMap* supports_quic_map = new SupportsQuicMap(); 626 SupportsQuicMap* supports_quic_map = new SupportsQuicMap();
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 completion.Run(); 858 completion.Run();
859 } 859 }
860 860
861 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 861 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
862 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 862 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
863 if (!setting_prefs_) 863 if (!setting_prefs_)
864 ScheduleUpdateCacheOnPrefThread(); 864 ScheduleUpdateCacheOnPrefThread();
865 } 865 }
866 866
867 } // namespace net 867 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698