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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 BrowserThread::PostTask( | 837 BrowserThread::PostTask( |
838 BrowserThread::IO, | 838 BrowserThread::IO, |
839 FROM_HERE, | 839 FROM_HERE, |
840 base::Bind(&Predictor::PreconnectUrlOnIOThread, | 840 base::Bind(&Predictor::PreconnectUrlOnIOThread, |
841 base::Unretained(this), url, first_party_for_cookies, | 841 base::Unretained(this), url, first_party_for_cookies, |
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, |
jar (doing other things)
2013/06/10 03:17:16
nit: one arg per line for definitions and declarat
kouhei (in TOK)
2013/06/10 23:24:05
Ack.
kouhei (in TOK)
2013/06/14 16:49:42
I would like to address this in other CL.
| |
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 | |
851 UMA_HISTOGRAM_BOOLEAN( | |
852 "Net.PreconnectsUnique", | |
853 recent_preconnects_.WasRecentlySeen(canonical_url)); | |
jar (doing other things)
2013/06/10 03:17:16
Why is this an interesting stat?
I expect that co
| |
850 recent_preconnects_.SetRecentlySeen(canonical_url); | 854 recent_preconnects_.SetRecentlySeen(canonical_url); |
851 | 855 |
852 PreconnectOnIOThread(url, | 856 PreconnectOnIOThread(url, |
853 first_party_for_cookies, | 857 first_party_for_cookies, |
854 motivation, | 858 motivation, |
855 count, | 859 count, |
856 url_request_context_getter_.get()); | 860 url_request_context_getter_.get()); |
857 } | 861 } |
858 | 862 |
859 void Predictor::RecordPreconnectNavigationStats(const GURL& url) { | 863 void Predictor::RecordPreconnectNavigationStats(const GURL& url) { |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1227 IOThread* io_thread, | 1231 IOThread* io_thread, |
1228 net::URLRequestContextGetter* getter) { | 1232 net::URLRequestContextGetter* getter) { |
1229 // Empty function for unittests. | 1233 // Empty function for unittests. |
1230 } | 1234 } |
1231 | 1235 |
1232 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { | 1236 void SimplePredictor::ShutdownOnUIThread(PrefService* user_prefs) { |
1233 SetShutdown(true); | 1237 SetShutdown(true); |
1234 } | 1238 } |
1235 | 1239 |
1236 } // namespace chrome_browser_net | 1240 } // namespace chrome_browser_net |
OLD | NEW |