| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 DCHECK_EQ(url, Predictor::CanonicalizeUrl(url)); | 262 DCHECK_EQ(url, Predictor::CanonicalizeUrl(url)); |
| 263 if (first_navigations_.find(url) == first_navigations_.end()) | 263 if (first_navigations_.find(url) == first_navigations_.end()) |
| 264 first_navigations_[url] = base::TimeTicks::Now(); | 264 first_navigations_[url] = base::TimeTicks::Now(); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) { | 267 void InitialObserver::GetInitialDnsResolutionList(ListValue* startup_list) { |
| 268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 269 DCHECK(startup_list); | 269 DCHECK(startup_list); |
| 270 startup_list->Clear(); | 270 startup_list->Clear(); |
| 271 DCHECK_EQ(0u, startup_list->GetSize()); | 271 DCHECK_EQ(0u, startup_list->GetSize()); |
| 272 startup_list->Append(new FundamentalValue(kPredictorStartupFormatVersion)); | 272 startup_list->Append( |
| 273 new base::FundamentalValue(kPredictorStartupFormatVersion)); |
| 273 for (FirstNavigations::iterator it = first_navigations_.begin(); | 274 for (FirstNavigations::iterator it = first_navigations_.begin(); |
| 274 it != first_navigations_.end(); | 275 it != first_navigations_.end(); |
| 275 ++it) { | 276 ++it) { |
| 276 DCHECK(it->first == Predictor::CanonicalizeUrl(it->first)); | 277 DCHECK(it->first == Predictor::CanonicalizeUrl(it->first)); |
| 277 startup_list->Append(new StringValue(it->first.spec())); | 278 startup_list->Append(new StringValue(it->first.spec())); |
| 278 } | 279 } |
| 279 } | 280 } |
| 280 | 281 |
| 281 void InitialObserver::GetFirstResolutionsHtml(std::string* output) { | 282 void InitialObserver::GetFirstResolutionsHtml(std::string* output) { |
| 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 DCHECK(!g_predictor); | 642 DCHECK(!g_predictor); |
| 642 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, | 643 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, |
| 643 local_state, preconnect_enabled); | 644 local_state, preconnect_enabled); |
| 644 } | 645 } |
| 645 } | 646 } |
| 646 | 647 |
| 647 PredictorInit::~PredictorInit() { | 648 PredictorInit::~PredictorInit() { |
| 648 } | 649 } |
| 649 | 650 |
| 650 } // namespace chrome_browser_net | 651 } // namespace chrome_browser_net |
| OLD | NEW |