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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 2298173002: Implement host-based deletion for the hostname resolution cache. (Closed)
Patch Set: Take TimeTicks::Now() out of the loop Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 UpdateNegotiateDisableCnameLookup(); 741 UpdateNegotiateDisableCnameLookup();
742 UpdateNegotiateEnablePort(); 742 UpdateNegotiateEnablePort();
743 #if defined(OS_ANDROID) 743 #if defined(OS_ANDROID)
744 UpdateAndroidAuthNegotiateAccountType(); 744 UpdateAndroidAuthNegotiateAccountType();
745 #endif 745 #endif
746 globals_->http_auth_handler_factory = 746 globals_->http_auth_handler_factory =
747 net::HttpAuthHandlerRegistryFactory::Create( 747 net::HttpAuthHandlerRegistryFactory::Create(
748 globals_->http_auth_preferences.get(), globals_->host_resolver.get()); 748 globals_->http_auth_preferences.get(), globals_->host_resolver.get());
749 } 749 }
750 750
751 void IOThread::ClearHostCache() { 751 void IOThread::ClearHostCache(
752 const base::Callback<bool(const std::string&)>& host_filter) {
752 DCHECK_CURRENTLY_ON(BrowserThread::IO); 753 DCHECK_CURRENTLY_ON(BrowserThread::IO);
753 754
754 net::HostCache* host_cache = globals_->host_resolver->GetHostCache(); 755 net::HostCache* host_cache = globals_->host_resolver->GetHostCache();
755 if (host_cache) 756 if (host_cache)
756 host_cache->clear(); 757 host_cache->ClearForHosts(host_filter);
757 } 758 }
758 759
759 const net::HttpNetworkSession::Params& IOThread::NetworkSessionParams() const { 760 const net::HttpNetworkSession::Params& IOThread::NetworkSessionParams() const {
760 return params_; 761 return params_;
761 } 762 }
762 763
763 base::TimeTicks IOThread::creation_time() const { 764 base::TimeTicks IOThread::creation_time() const {
764 return creation_time_; 765 return creation_time_;
765 } 766 }
766 767
767 net::SSLConfigService* IOThread::GetSSLConfigService() { 768 net::SSLConfigService* IOThread::GetSSLConfigService() {
768 return ssl_config_service_manager_->Get(); 769 return ssl_config_service_manager_->Get();
769 } 770 }
770 771
771 void IOThread::ChangedToOnTheRecordOnIOThread() { 772 void IOThread::ChangedToOnTheRecordOnIOThread() {
772 DCHECK_CURRENTLY_ON(BrowserThread::IO); 773 DCHECK_CURRENTLY_ON(BrowserThread::IO);
773 774
774 // Clear the host cache to avoid showing entries from the OTR session 775 // Clear the host cache to avoid showing entries from the OTR session
775 // in about:net-internals. 776 // in about:net-internals.
776 ClearHostCache(); 777 ClearHostCache(base::Callback<bool(const std::string&)>());
777 } 778 }
778 779
779 void IOThread::InitSystemRequestContext() { 780 void IOThread::InitSystemRequestContext() {
780 if (system_url_request_context_getter_.get()) 781 if (system_url_request_context_getter_.get())
781 return; 782 return;
782 // If we're in unit_tests, IOThread may not be run. 783 // If we're in unit_tests, IOThread may not be run.
783 if (!BrowserThread::IsMessageLoopValid(BrowserThread::IO)) 784 if (!BrowserThread::IsMessageLoopValid(BrowserThread::IO))
784 return; 785 return;
785 system_proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService( 786 system_proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService(
786 pref_proxy_config_tracker_.get()); 787 pref_proxy_config_tracker_.get());
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 1057 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
1057 // system URLRequestContext too. There's no reason this should be tied to a 1058 // system URLRequestContext too. There's no reason this should be tied to a
1058 // profile. 1059 // profile.
1059 return context; 1060 return context;
1060 } 1061 }
1061 1062
1062 const metrics::UpdateUsagePrefCallbackType& 1063 const metrics::UpdateUsagePrefCallbackType&
1063 IOThread::GetMetricsDataUseForwarder() { 1064 IOThread::GetMetricsDataUseForwarder() {
1064 return metrics_data_use_forwarder_; 1065 return metrics_data_use_forwarder_;
1065 } 1066 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698