| OLD | NEW |
| 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 "net/dns/host_resolver_impl.h" | 5 #include "net/dns/host_resolver_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <Winsock2.h> | 8 #include <Winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <netdb.h> | 10 #include <netdb.h> |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 : HostResolverImpl( | 1888 : HostResolverImpl( |
| 1889 options, | 1889 options, |
| 1890 net_log, | 1890 net_log, |
| 1891 base::WorkerPool::GetTaskRunner(true /* task_is_slow */)) {} | 1891 base::WorkerPool::GetTaskRunner(true /* task_is_slow */)) {} |
| 1892 | 1892 |
| 1893 HostResolverImpl::~HostResolverImpl() { | 1893 HostResolverImpl::~HostResolverImpl() { |
| 1894 // Prevent the dispatcher from starting new jobs. | 1894 // Prevent the dispatcher from starting new jobs. |
| 1895 dispatcher_->SetLimitsToZero(); | 1895 dispatcher_->SetLimitsToZero(); |
| 1896 // It's now safe for Jobs to call KillDsnTask on destruction, because | 1896 // It's now safe for Jobs to call KillDsnTask on destruction, because |
| 1897 // OnJobComplete will not start any new jobs. | 1897 // OnJobComplete will not start any new jobs. |
| 1898 STLDeleteValues(&jobs_); | 1898 base::STLDeleteValues(&jobs_); |
| 1899 | 1899 |
| 1900 NetworkChangeNotifier::RemoveIPAddressObserver(this); | 1900 NetworkChangeNotifier::RemoveIPAddressObserver(this); |
| 1901 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 1901 NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
| 1902 NetworkChangeNotifier::RemoveDNSObserver(this); | 1902 NetworkChangeNotifier::RemoveDNSObserver(this); |
| 1903 } | 1903 } |
| 1904 | 1904 |
| 1905 void HostResolverImpl::SetMaxQueuedJobs(size_t value) { | 1905 void HostResolverImpl::SetMaxQueuedJobs(size_t value) { |
| 1906 DCHECK_EQ(0u, dispatcher_->num_queued_jobs()); | 1906 DCHECK_EQ(0u, dispatcher_->num_queued_jobs()); |
| 1907 DCHECK_GT(value, 0u); | 1907 DCHECK_GT(value, 0u); |
| 1908 max_queued_jobs_ = value; | 1908 max_queued_jobs_ = value; |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 if (job_) | 2609 if (job_) |
| 2610 job_->CancelRequest(this); | 2610 job_->CancelRequest(this); |
| 2611 } | 2611 } |
| 2612 | 2612 |
| 2613 void HostResolverImpl::RequestImpl::ChangeRequestPriority( | 2613 void HostResolverImpl::RequestImpl::ChangeRequestPriority( |
| 2614 RequestPriority priority) { | 2614 RequestPriority priority) { |
| 2615 job_->ChangeRequestPriority(this, priority); | 2615 job_->ChangeRequestPriority(this, priority); |
| 2616 } | 2616 } |
| 2617 | 2617 |
| 2618 } // namespace net | 2618 } // namespace net |
| OLD | NEW |