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

Side by Side Diff: chrome/browser/net/dns_host_info.cc

Issue 15076: Clean up dns prefetch code, and also port it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: use scoper for init & free Created 11 years, 10 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // See header file for description of class 5 // See header file for description of class
6 6
7 #include "chrome/browser/net/dns_host_info.h" 7 #include "chrome/browser/net/dns_host_info.h"
8 8
9 #include <math.h> 9 #include <math.h>
10 10
(...skipping 21 matching lines...) Expand all
32 int DnsHostInfo::sequence_counter = 1; 32 int DnsHostInfo::sequence_counter = 1;
33 33
34 34
35 bool DnsHostInfo::NeedsDnsUpdate(const std::string& hostname) { 35 bool DnsHostInfo::NeedsDnsUpdate(const std::string& hostname) {
36 DCHECK(hostname == hostname_); 36 DCHECK(hostname == hostname_);
37 switch (state_) { 37 switch (state_) {
38 case PENDING: // Just now created info. 38 case PENDING: // Just now created info.
39 return true; 39 return true;
40 40
41 case QUEUED: // In queue. 41 case QUEUED: // In queue.
42 case ASSIGNED: // Slave is working on it. 42 case ASSIGNED: // It's being resolved.
43 case ASSIGNED_BUT_MARKED: // Slave is working on it. 43 case ASSIGNED_BUT_MARKED: // It's being resolved.
44 return false; // We're already working on it 44 return false; // We're already working on it
45 45
46 case NO_SUCH_NAME: // Lookup failed. 46 case NO_SUCH_NAME: // Lookup failed.
47 case FOUND: // Lookup succeeded. 47 case FOUND: // Lookup succeeded.
48 return !IsStillCached(); // See if DNS cache expired. 48 return !IsStillCached(); // See if DNS cache expired.
49 49
50 default: 50 default:
51 DCHECK(false); 51 DCHECK(false);
52 return false; 52 return false;
53 } 53 }
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 case LEARNED_REFERAL_MOTIVATED: 402 case LEARNED_REFERAL_MOTIVATED:
403 return RemoveJs(referring_hostname_); 403 return RemoveJs(referring_hostname_);
404 404
405 default: 405 default:
406 return ""; 406 return "";
407 } 407 }
408 } 408 }
409 409
410 } // namespace chrome_browser_net 410 } // namespace chrome_browser_net
411 411
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698