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

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

Issue 1989363007: Move predictor dns unit tests to browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman@ review Created 4 years, 6 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
« no previous file with comments | « chrome/browser/net/predictor.h ('k') | chrome/browser/net/predictor_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor.h ('k') | chrome/browser/net/predictor_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698