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

Unified Diff: net/base/host_resolver_impl.cc

Issue 8533011: Remove unused HostResolver::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
Index: net/base/host_resolver_impl.cc
diff --git a/net/base/host_resolver_impl.cc b/net/base/host_resolver_impl.cc
index c4002e6a57cf33ebbabe84e39bbcaf43d0f3b25e..90db8b01d242dd3cd36d2151ba5e836693843c07 100644
--- a/net/base/host_resolver_impl.cc
+++ b/net/base/host_resolver_impl.cc
@@ -1262,22 +1262,6 @@ void HostResolverImpl::CancelRequest(RequestHandle req_handle) {
req->info());
}
-void HostResolverImpl::AddObserver(HostResolver::Observer* observer) {
- DCHECK(CalledOnValidThread());
- observers_.push_back(observer);
-}
-
-void HostResolverImpl::RemoveObserver(HostResolver::Observer* observer) {
- DCHECK(CalledOnValidThread());
- ObserversList::iterator it =
- std::find(observers_.begin(), observers_.end(), observer);
-
- // Observer must exist.
- DCHECK(it != observers_.end());
-
- observers_.erase(it);
-}
-
void HostResolverImpl::SetDefaultAddressFamily(AddressFamily address_family) {
DCHECK(CalledOnValidThread());
ipv6_probe_monitoring_ = false;
@@ -1443,14 +1427,6 @@ void HostResolverImpl::OnStartRequest(const BoundNetLog& source_net_log,
NetLog::TYPE_HOST_RESOLVER_IMPL_REQUEST,
make_scoped_refptr(new RequestInfoParameters(
info, source_net_log.source())));
-
- // Notify the observers of the start.
- if (!observers_.empty()) {
- for (ObserversList::iterator it = observers_.begin();
- it != observers_.end(); ++it) {
- (*it)->OnStartResolution(request_id, info);
- }
- }
}
void HostResolverImpl::OnFinishRequest(const BoundNetLog& source_net_log,
@@ -1461,14 +1437,6 @@ void HostResolverImpl::OnFinishRequest(const BoundNetLog& source_net_log,
int os_error) {
bool was_resolved = net_error == OK;
- // Notify the observers of the completion.
- if (!observers_.empty()) {
- for (ObserversList::iterator it = observers_.begin();
- it != observers_.end(); ++it) {
- (*it)->OnFinishResolutionWithStatus(request_id, was_resolved, info);
- }
- }
-
// Log some extra parameters on failure for synchronous requests.
scoped_refptr<NetLog::EventParameters> params;
if (!was_resolved) {
@@ -1484,15 +1452,6 @@ void HostResolverImpl::OnCancelRequest(const BoundNetLog& source_net_log,
int request_id,
const RequestInfo& info) {
request_net_log.AddEvent(NetLog::TYPE_CANCELLED, NULL);
-
- // Notify the observers of the cancellation.
- if (!observers_.empty()) {
- for (ObserversList::iterator it = observers_.begin();
- it != observers_.end(); ++it) {
- (*it)->OnCancelResolution(request_id, info);
- }
- }
-
request_net_log.EndEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_REQUEST, NULL);
source_net_log.EndEvent(NetLog::TYPE_HOST_RESOLVER_IMPL, NULL);
}

Powered by Google App Engine
This is Rietveld 408576698