| 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 "chrome/browser/net/dns_probe_job.h" | 5 #include "chrome/browser/net/dns_probe_job.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 dns_client_(dns_client.Pass()), | 98 dns_client_(dns_client.Pass()), |
| 99 callback_(callback), | 99 callback_(callback), |
| 100 good_running_(false), | 100 good_running_(false), |
| 101 bad_running_(false), | 101 bad_running_(false), |
| 102 good_result_(QUERY_UNKNOWN), | 102 good_result_(QUERY_UNKNOWN), |
| 103 bad_result_(QUERY_UNKNOWN), | 103 bad_result_(QUERY_UNKNOWN), |
| 104 weak_factory_(this) { | 104 weak_factory_(this) { |
| 105 DCHECK(dns_client_.get()); | 105 DCHECK(dns_client_.get()); |
| 106 DCHECK(dns_client_->GetConfig()); | 106 DCHECK(dns_client_->GetConfig()); |
| 107 | 107 |
| 108 MessageLoop::current()->PostTask( | 108 base::MessageLoop::current()->PostTask( |
| 109 FROM_HERE, | 109 FROM_HERE, |
| 110 base::Bind(&DnsProbeJobImpl::Start, | 110 base::Bind(&DnsProbeJobImpl::Start, |
| 111 weak_factory_.GetWeakPtr())); | 111 weak_factory_.GetWeakPtr())); |
| 112 } | 112 } |
| 113 | 113 |
| 114 DnsProbeJobImpl::~DnsProbeJobImpl() { | 114 DnsProbeJobImpl::~DnsProbeJobImpl() { |
| 115 } | 115 } |
| 116 | 116 |
| 117 void DnsProbeJobImpl::Start() { | 117 void DnsProbeJobImpl::Start() { |
| 118 // TODO(ttuttle): Pick a good random hostname for the bad case. | 118 // TODO(ttuttle): Pick a good random hostname for the bad case. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 scoped_ptr<DnsProbeJob> DnsProbeJob::CreateJob( | 228 scoped_ptr<DnsProbeJob> DnsProbeJob::CreateJob( |
| 229 scoped_ptr<DnsClient> dns_client, | 229 scoped_ptr<DnsClient> dns_client, |
| 230 const CallbackType& callback, | 230 const CallbackType& callback, |
| 231 NetLog* net_log) { | 231 NetLog* net_log) { |
| 232 return scoped_ptr<DnsProbeJob>( | 232 return scoped_ptr<DnsProbeJob>( |
| 233 new DnsProbeJobImpl(dns_client.Pass(), callback, net_log)); | 233 new DnsProbeJobImpl(dns_client.Pass(), callback, net_log)); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace chrome_browser_net | 236 } // namespace chrome_browser_net |
| OLD | NEW |