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/predictor.h" | 5 #include "chrome/browser/net/predictor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 UMA_HISTOGRAM_ENUMERATION("Net.PreconnectSubresourceEval", evalution, | 1021 UMA_HISTOGRAM_ENUMERATION("Net.PreconnectSubresourceEval", evalution, |
1022 SUBRESOURCE_VALUE_MAX); | 1022 SUBRESOURCE_VALUE_MAX); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 | 1025 |
1026 void Predictor::OnLookupFinished(LookupRequest* request, const GURL& url, | 1026 void Predictor::OnLookupFinished(LookupRequest* request, const GURL& url, |
1027 bool found) { | 1027 bool found) { |
1028 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1028 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1029 | 1029 |
1030 LookupFinished(request, url, found); | 1030 LookupFinished(request, url, found); |
| 1031 if (observer_) |
| 1032 observer_->OnDnsLookupFinished(url, found); |
1031 pending_lookups_.erase(request); | 1033 pending_lookups_.erase(request); |
1032 delete request; | 1034 delete request; |
1033 | 1035 |
1034 StartSomeQueuedResolutions(); | 1036 StartSomeQueuedResolutions(); |
1035 } | 1037 } |
1036 | 1038 |
1037 void Predictor::LookupFinished(LookupRequest* request, const GURL& url, | 1039 void Predictor::LookupFinished(LookupRequest* request, const GURL& url, |
1038 bool found) { | 1040 bool found) { |
1039 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1041 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
1040 UrlInfo* info = &results_[url]; | 1042 UrlInfo* info = &results_[url]; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 } | 1361 } |
1360 | 1362 |
1361 void SimplePredictor::ShutdownOnUIThread() { | 1363 void SimplePredictor::ShutdownOnUIThread() { |
1362 SetShutdown(true); | 1364 SetShutdown(true); |
1363 } | 1365 } |
1364 | 1366 |
1365 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } | 1367 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } |
1366 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } | 1368 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } |
1367 | 1369 |
1368 } // namespace chrome_browser_net | 1370 } // namespace chrome_browser_net |
OLD | NEW |