| 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( | 272 startup_list->Append(base::NumberValue::New(kPredictorStartupFormatVersion)); |
| 273 new base::FundamentalValue(kPredictorStartupFormatVersion)); | |
| 274 for (FirstNavigations::iterator it = first_navigations_.begin(); | 273 for (FirstNavigations::iterator it = first_navigations_.begin(); |
| 275 it != first_navigations_.end(); | 274 it != first_navigations_.end(); |
| 276 ++it) { | 275 ++it) { |
| 277 DCHECK(it->first == Predictor::CanonicalizeUrl(it->first)); | 276 DCHECK(it->first == Predictor::CanonicalizeUrl(it->first)); |
| 278 startup_list->Append(new StringValue(it->first.spec())); | 277 startup_list->Append(base::StringValue::New(it->first.spec())); |
| 279 } | 278 } |
| 280 } | 279 } |
| 281 | 280 |
| 282 void InitialObserver::GetFirstResolutionsHtml(std::string* output) { | 281 void InitialObserver::GetFirstResolutionsHtml(std::string* output) { |
| 283 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 284 | 283 |
| 285 UrlInfo::UrlInfoTable resolution_list; | 284 UrlInfo::UrlInfoTable resolution_list; |
| 286 { | 285 { |
| 287 for (FirstNavigations::iterator it(first_navigations_.begin()); | 286 for (FirstNavigations::iterator it(first_navigations_.begin()); |
| 288 it != first_navigations_.end(); | 287 it != first_navigations_.end(); |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 DCHECK(!g_predictor); | 641 DCHECK(!g_predictor); |
| 643 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, | 642 InitNetworkPredictor(max_queueing_delay, max_parallel_resolves, user_prefs, |
| 644 local_state, preconnect_enabled); | 643 local_state, preconnect_enabled); |
| 645 } | 644 } |
| 646 } | 645 } |
| 647 | 646 |
| 648 PredictorInit::~PredictorInit() { | 647 PredictorInit::~PredictorInit() { |
| 649 } | 648 } |
| 650 | 649 |
| 651 } // namespace chrome_browser_net | 650 } // namespace chrome_browser_net |
| OLD | NEW |