| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_master.h" | 5 #include "chrome/browser/net/dns_master.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // net:ERR_IO_PENDING ==> Network will callback later with result. | 41 // net:ERR_IO_PENDING ==> Network will callback later with result. |
| 42 // anything else ==> Host was not found synchronously. | 42 // anything else ==> Host was not found synchronously. |
| 43 int Start() { | 43 int Start() { |
| 44 // Port doesn't really matter. | 44 // Port doesn't really matter. |
| 45 net::HostResolver::RequestInfo resolve_info(hostname_, 80); | 45 net::HostResolver::RequestInfo resolve_info(hostname_, 80); |
| 46 | 46 |
| 47 // Make a note that this is a speculative resolve request. This allows us | 47 // Make a note that this is a speculative resolve request. This allows us |
| 48 // to separate it from real navigations in the observer's callback, and | 48 // to separate it from real navigations in the observer's callback, and |
| 49 // lets the HostResolver know it can de-prioritize it. | 49 // lets the HostResolver know it can de-prioritize it. |
| 50 resolve_info.set_is_speculative(true); | 50 resolve_info.set_is_speculative(true); |
| 51 return resolver_.Resolve(resolve_info, &addresses_, &net_callback_); | 51 return resolver_.Resolve( |
| 52 NULL, resolve_info, &addresses_, &net_callback_); |
| 52 } | 53 } |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 void OnLookupFinished(int result) { | 56 void OnLookupFinished(int result) { |
| 56 master_->OnLookupFinished(this, hostname_, result == net::OK); | 57 master_->OnLookupFinished(this, hostname_, result == net::OK); |
| 57 } | 58 } |
| 58 | 59 |
| 59 // HostResolver will call us using this callback when resolution is complete. | 60 // HostResolver will call us using this callback when resolution is complete. |
| 60 net::CompletionCallbackImpl<LookupRequest> net_callback_; | 61 net::CompletionCallbackImpl<LookupRequest> net_callback_; |
| 61 | 62 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 std::string hostname(rush_queue_.front()); | 612 std::string hostname(rush_queue_.front()); |
| 612 rush_queue_.pop(); | 613 rush_queue_.pop(); |
| 613 return hostname; | 614 return hostname; |
| 614 } | 615 } |
| 615 std::string hostname(background_queue_.front()); | 616 std::string hostname(background_queue_.front()); |
| 616 background_queue_.pop(); | 617 background_queue_.pop(); |
| 617 return hostname; | 618 return hostname; |
| 618 } | 619 } |
| 619 | 620 |
| 620 } // namespace chrome_browser_net | 621 } // namespace chrome_browser_net |
| OLD | NEW |