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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 motivation, count)); | 842 motivation, count)); |
843 } | 843 } |
844 } | 844 } |
845 | 845 |
846 void Predictor::PreconnectUrlOnIOThread( | 846 void Predictor::PreconnectUrlOnIOThread( |
847 const GURL& url, const GURL& first_party_for_cookies, | 847 const GURL& url, const GURL& first_party_for_cookies, |
848 UrlInfo::ResolutionMotivation motivation, int count) { | 848 UrlInfo::ResolutionMotivation motivation, int count) { |
849 GURL canonical_url(CanonicalizeUrl(url)); | 849 GURL canonical_url(CanonicalizeUrl(url)); |
850 recent_preconnects_.SetRecentlySeen(canonical_url); | 850 recent_preconnects_.SetRecentlySeen(canonical_url); |
851 | 851 |
852 PreconnectOnIOThread(url, first_party_for_cookies, motivation, count, | 852 PreconnectOnIOThread(url, |
853 url_request_context_getter_); | 853 first_party_for_cookies, |
| 854 motivation, |
| 855 count, |
| 856 url_request_context_getter_.get()); |
854 } | 857 } |
855 | 858 |
856 void Predictor::RecordPreconnectNavigationStats(const GURL& url) { | 859 void Predictor::RecordPreconnectNavigationStats(const GURL& url) { |
857 UMA_HISTOGRAM_BOOLEAN( | 860 UMA_HISTOGRAM_BOOLEAN( |
858 "Net.PreconnectedNavigation", | 861 "Net.PreconnectedNavigation", |
859 recent_preconnects_.WasRecentlySeen(url)); | 862 recent_preconnects_.WasRecentlySeen(url)); |
860 } | 863 } |
861 | 864 |
862 void Predictor::PredictFrameSubresources(const GURL& url, | 865 void Predictor::PredictFrameSubresources(const GURL& url, |
863 const GURL& first_party_for_cookies) { | 866 const GURL& first_party_for_cookies) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 IOThread* io_thread, | 1227 IOThread* io_thread, |
1225 net::URLRequestContextGetter* getter) { | 1228 net::URLRequestContextGetter* getter) { |
1226 // Empty function for unittests. | 1229 // Empty function for unittests. |
1227 } | 1230 } |
1228 | 1231 |
1229 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1232 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
1230 SetShutdown(true); | 1233 SetShutdown(true); |
1231 } | 1234 } |
1232 | 1235 |
1233 } // namespace chrome_browser_net | 1236 } // namespace chrome_browser_net |
OLD | NEW |