OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_api.h" | 5 #include "chrome/browser/net/predictor_api.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // Member definitions for InitialObserver class. | 239 // Member definitions for InitialObserver class. |
240 | 240 |
241 void InitialObserver::Append(const GURL& url) { | 241 void InitialObserver::Append(const GURL& url) { |
242 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 242 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
243 | 243 |
244 if (!on_the_record_switch || NULL == g_predictor) | 244 if (!on_the_record_switch || NULL == g_predictor) |
245 return; | 245 return; |
246 if (kStartupResolutionCount <= first_navigations_.size()) | 246 if (kStartupResolutionCount <= first_navigations_.size()) |
247 return; | 247 return; |
248 | 248 |
249 if (url.SchemeIs("http") || url.SchemeIs("https")) { | 249 if (url.SchemeIs("http") || url.SchemeIs("https") || url.SchemeIs("httpsv")) { |
250 const GURL url_without_path(Predictor::CanonicalizeUrl(url)); | 250 const GURL url_without_path(Predictor::CanonicalizeUrl(url)); |
251 if (first_navigations_.find(url_without_path) == first_navigations_.end()) | 251 if (first_navigations_.find(url_without_path) == first_navigations_.end()) |
252 first_navigations_[url_without_path] = base::TimeTicks::Now(); | 252 first_navigations_[url_without_path] = base::TimeTicks::Now(); |
253 } | 253 } |
254 } | 254 } |
255 | 255 |
256 void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) { | 256 void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) { |
257 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 257 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
258 DCHECK(startup_list); | 258 DCHECK(startup_list); |
259 startup_list->Clear(); | 259 startup_list->Clear(); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 DCHECK(!g_predictor); | 624 DCHECK(!g_predictor); |
625 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, | 625 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, |
626 local_state, preconnect_enabled); | 626 local_state, preconnect_enabled); |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 PredictorInit::~PredictorInit() { | 630 PredictorInit::~PredictorInit() { |
631 } | 631 } |
632 | 632 |
633 } // namespace chrome_browser_net | 633 } // namespace chrome_browser_net |
OLD | NEW |