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 <stdio.h> | 5 #include <stdio.h> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 base::Unretained(this))); | 394 base::Unretained(this))); |
395 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 395 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
396 FROM_HERE, timeout_closure_.callback(), config_timeout_); | 396 FROM_HERE, timeout_closure_.callback(), config_timeout_); |
397 } | 397 } |
398 } | 398 } |
399 | 399 |
400 void GDig::Finish(Result result) { | 400 void GDig::Finish(Result result) { |
401 DCHECK_NE(RESULT_PENDING, result); | 401 DCHECK_NE(RESULT_PENDING, result); |
402 result_ = result; | 402 result_ = result; |
403 if (base::MessageLoop::current()) | 403 if (base::MessageLoop::current()) |
404 base::MessageLoop::current()->Quit(); | 404 base::MessageLoop::current()->QuitWhenIdle(); |
405 } | 405 } |
406 | 406 |
407 void GDig::OnDnsConfig(const DnsConfig& dns_config_const) { | 407 void GDig::OnDnsConfig(const DnsConfig& dns_config_const) { |
408 timeout_closure_.Cancel(); | 408 timeout_closure_.Cancel(); |
409 DCHECK(dns_config_const.IsValid()); | 409 DCHECK(dns_config_const.IsValid()); |
410 DnsConfig dns_config = dns_config_const; | 410 DnsConfig dns_config = dns_config_const; |
411 | 411 |
412 if (timeout_.InMilliseconds() > 0) | 412 if (timeout_.InMilliseconds() > 0) |
413 dns_config.timeout = timeout_; | 413 dns_config.timeout = timeout_; |
414 if (print_config_) { | 414 if (print_config_) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 } | 512 } |
513 | 513 |
514 } // empty namespace | 514 } // empty namespace |
515 | 515 |
516 } // namespace net | 516 } // namespace net |
517 | 517 |
518 int main(int argc, const char* argv[]) { | 518 int main(int argc, const char* argv[]) { |
519 net::GDig dig; | 519 net::GDig dig; |
520 return dig.Main(argc, argv); | 520 return dig.Main(argc, argv); |
521 } | 521 } |
OLD | NEW |