Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: chrome/browser/net/predictor.cc

Issue 2950533002: android: Disable the startup DNS resolutions. (Closed)
Patch Set: Remove dead code. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/predictor.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <iterator> 9 #include <iterator>
10 #include <set> 10 #include <set>
11 #include <sstream> 11 #include <sstream>
12 #include <utility> 12 #include <utility>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/containers/mru_cache.h" 17 #include "base/containers/mru_cache.h"
18 #include "base/feature_list.h" 18 #include "base/feature_list.h"
19 #include "base/location.h" 19 #include "base/location.h"
20 #include "base/logging.h" 20 #include "base/logging.h"
21 #include "base/macros.h" 21 #include "base/macros.h"
22 #include "base/memory/ptr_util.h" 22 #include "base/memory/ptr_util.h"
23 #include "base/metrics/histogram_macros.h" 23 #include "base/metrics/histogram_macros.h"
24 #include "base/single_thread_task_runner.h" 24 #include "base/single_thread_task_runner.h"
25 #include "base/stl_util.h" 25 #include "base/stl_util.h"
26 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
27 #include "base/threading/thread_restrictions.h" 27 #include "base/threading/thread_restrictions.h"
28 #include "base/threading/thread_task_runner_handle.h" 28 #include "base/threading/thread_task_runner_handle.h"
29 #include "base/time/time.h" 29 #include "base/time/time.h"
30 #include "base/trace_event/trace_event.h"
30 #include "base/values.h" 31 #include "base/values.h"
32 #include "build/build_config.h"
31 #include "chrome/browser/io_thread.h" 33 #include "chrome/browser/io_thread.h"
32 #include "chrome/browser/prefs/session_startup_pref.h" 34 #include "chrome/browser/prefs/session_startup_pref.h"
33 #include "chrome/browser/profiles/profile_io_data.h" 35 #include "chrome/browser/profiles/profile_io_data.h"
34 #include "chrome/common/chrome_switches.h" 36 #include "chrome/common/chrome_switches.h"
35 #include "chrome/common/pref_names.h" 37 #include "chrome/common/pref_names.h"
36 #include "components/pref_registry/pref_registry_syncable.h" 38 #include "components/pref_registry/pref_registry_syncable.h"
37 #include "components/prefs/pref_service.h" 39 #include "components/prefs/pref_service.h"
38 #include "components/prefs/scoped_user_pref_update.h" 40 #include "components/prefs/scoped_user_pref_update.h"
39 #include "content/public/browser/browser_thread.h" 41 #include "content/public/browser/browser_thread.h"
40 #include "content/public/browser/resource_hints.h" 42 #include "content/public/browser/resource_hints.h"
(...skipping 12 matching lines...) Expand all
53 using base::TimeDelta; 55 using base::TimeDelta;
54 using content::BrowserThread; 56 using content::BrowserThread;
55 57
56 namespace chrome_browser_net { 58 namespace chrome_browser_net {
57 59
58 namespace { 60 namespace {
59 61
60 const base::Feature kNetworkPrediction{"NetworkPrediction", 62 const base::Feature kNetworkPrediction{"NetworkPrediction",
61 base::FEATURE_ENABLED_BY_DEFAULT}; 63 base::FEATURE_ENABLED_BY_DEFAULT};
62 64
65 #if defined(OS_ANDROID)
66 // Disabled on Android, as there are no "pinned tabs", meaning that a startup
67 // is unlikely to request the same URL, and hence to resolve the same domains
68 // as the previous one.
69 constexpr bool kInitialDnsPrefetchListEnabled = false;
70 #else
71 constexpr bool kInitialDnsPrefetchListEnabled = true;
72 #endif // defined(OS_ANDROID)
73
63 } // namespace 74 } // namespace
64 75
76 // The InitialObserver monitors navigations made by the network stack. This
77 // is only used to identify startup time resolutions (for re-resolution
78 // during our next process startup).
79 // TODO(jar): Consider preconnecting at startup, which may be faster than
80 // waiting for render process to start and request a connection.
81 class InitialObserver {
82 public:
83 InitialObserver();
84 ~InitialObserver();
85 // Recording of when we observed each navigation.
86 typedef std::map<GURL, base::TimeTicks> FirstNavigations;
87
88 // Potentially add a new URL to our startup list.
89 void Append(const GURL& url, Predictor* predictor);
90
91 // Get an HTML version of our current planned first_navigations_.
92 void GetFirstResolutionsHtml(std::string* output);
93
94 // Persist the current first_navigations_ for storage in a list.
95 void GetInitialDnsResolutionList(base::ListValue* startup_list);
96
97 // Discards all initial loading history.
98 void DiscardInitialNavigationHistory() { first_navigations_.clear(); }
99
100 private:
101 // List of the first N URL resolutions observed in this run.
102 FirstNavigations first_navigations_;
103
104 // The number of URLs we'll save for pre-resolving at next startup.
105 static const size_t kStartupResolutionCount = 10;
106 };
107
65 // static 108 // static
66 const int Predictor::kPredictorReferrerVersion = 2; 109 const int Predictor::kPredictorReferrerVersion = 2;
67 const double Predictor::kPreconnectWorthyExpectedValue = 0.8; 110 const double Predictor::kPreconnectWorthyExpectedValue = 0.8;
68 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1; 111 const double Predictor::kDNSPreresolutionWorthyExpectedValue = 0.1;
69 const double Predictor::kDiscardableExpectedValue = 0.05; 112 const double Predictor::kDiscardableExpectedValue = 0.05;
70 const size_t Predictor::kMaxSpeculativeParallelResolves = 3; 113 const size_t Predictor::kMaxSpeculativeParallelResolves = 3;
71 const int Predictor::kMaxUnusedSocketLifetimeSecondsWithoutAGet = 10; 114 const int Predictor::kMaxUnusedSocketLifetimeSecondsWithoutAGet = 10;
72 115
73 // This number was obtained by the Net.Predictor.MRUIndex histogram on Canary 116 // This number was obtained by the Net.Predictor.MRUIndex histogram on Canary
74 // and Dev channel (M53). The database size was initialized to 1000, and the 117 // and Dev channel (M53). The database size was initialized to 1000, and the
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 static_cast<int>(future_url->second.preresolution_count()), 542 static_cast<int>(future_url->second.preresolution_count()),
500 static_cast<double>(future_url->second.subresource_use_rate()), 543 static_cast<double>(future_url->second.subresource_use_rate()),
501 future_url->first.spec().c_str()); 544 future_url->first.spec().c_str());
502 } 545 }
503 } 546 }
504 output->append("</table>"); 547 output->append("</table>");
505 } 548 }
506 549
507 void Predictor::GetHtmlInfo(std::string* output) { 550 void Predictor::GetHtmlInfo(std::string* output) {
508 DCHECK_CURRENTLY_ON(BrowserThread::IO); 551 DCHECK_CURRENTLY_ON(BrowserThread::IO);
509 if (initial_observer_.get()) 552 if (kInitialDnsPrefetchListEnabled && initial_observer_)
510 initial_observer_->GetFirstResolutionsHtml(output); 553 initial_observer_->GetFirstResolutionsHtml(output);
511 // Show list of subresource predictions and stats. 554 // Show list of subresource predictions and stats.
512 GetHtmlReferrerLists(output); 555 GetHtmlReferrerLists(output);
513 556
514 // Local lists for calling UrlInfo 557 // Local lists for calling UrlInfo
515 UrlInfo::UrlInfoTable name_not_found; 558 UrlInfo::UrlInfoTable name_not_found;
516 UrlInfo::UrlInfoTable name_preresolved; 559 UrlInfo::UrlInfoTable name_preresolved;
517 560
518 // UrlInfo supports value semantics, so we can do a shallow copy. 561 // UrlInfo supports value semantics, so we can do a shallow copy.
519 for (Results::iterator it(results_.begin()); it != results_.end(); it++) { 562 for (Results::iterator it(results_.begin()); it != results_.end(); it++) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 } 623 }
581 624
582 referrers_.Put(GURL(motivating_url_spec), Referrer()) 625 referrers_.Put(GURL(motivating_url_spec), Referrer())
583 ->second.Deserialize(*subresource_list); 626 ->second.Deserialize(*subresource_list);
584 } 627 }
585 } 628 }
586 } 629 }
587 630
588 void Predictor::DiscardInitialNavigationHistory() { 631 void Predictor::DiscardInitialNavigationHistory() {
589 DCHECK_CURRENTLY_ON(BrowserThread::IO); 632 DCHECK_CURRENTLY_ON(BrowserThread::IO);
590 if (initial_observer_.get()) 633 if (kInitialDnsPrefetchListEnabled && initial_observer_)
591 initial_observer_->DiscardInitialNavigationHistory(); 634 initial_observer_->DiscardInitialNavigationHistory();
592 } 635 }
593 636
594 void Predictor::FinalizeInitializationOnIOThread( 637 void Predictor::FinalizeInitializationOnIOThread(
595 const std::vector<GURL>& startup_urls, 638 const std::vector<GURL>& startup_urls,
596 std::unique_ptr<base::ListValue> referral_list, 639 std::unique_ptr<base::ListValue> referral_list,
597 IOThread* io_thread, 640 IOThread* io_thread,
598 ProfileIOData* profile_io_data) { 641 ProfileIOData* profile_io_data) {
599 DCHECK_CURRENTLY_ON(BrowserThread::IO); 642 DCHECK_CURRENTLY_ON(BrowserThread::IO);
643 TRACE_EVENT0("net", "Predictor::FinalizeInitializationOnIOThread");
600 644
601 profile_io_data_ = profile_io_data; 645 profile_io_data_ = profile_io_data;
602 initial_observer_.reset(new InitialObserver()); 646 if (kInitialDnsPrefetchListEnabled)
647 initial_observer_ = base::MakeUnique<InitialObserver>();
603 648
604 net::URLRequestContext* context = 649 net::URLRequestContext* context =
605 url_request_context_getter_->GetURLRequestContext(); 650 url_request_context_getter_->GetURLRequestContext();
606 transport_security_state_ = context->transport_security_state(); 651 transport_security_state_ = context->transport_security_state();
607 ssl_config_service_ = context->ssl_config_service(); 652 ssl_config_service_ = context->ssl_config_service();
608 proxy_service_ = context->proxy_service(); 653 proxy_service_ = context->proxy_service();
609 654
610 // base::WeakPtrFactory instances need to be created and destroyed 655 // base::WeakPtrFactory instances need to be created and destroyed
611 // on the same thread. Initialize the IO thread weak factory now. 656 // on the same thread. Initialize the IO thread weak factory now.
612 io_weak_factory_.reset(new base::WeakPtrFactory<Predictor>(this)); 657 io_weak_factory_.reset(new base::WeakPtrFactory<Predictor>(this));
613 658
614 // Prefetch these hostnames on startup. 659 // Prefetch these hostnames on startup.
615 DnsPrefetchMotivatedList(startup_urls, UrlInfo::STARTUP_LIST_MOTIVATED); 660 if (kInitialDnsPrefetchListEnabled)
661 DnsPrefetchMotivatedList(startup_urls, UrlInfo::STARTUP_LIST_MOTIVATED);
616 662
617 DeserializeReferrers(*referral_list); 663 DeserializeReferrers(*referral_list);
618 664
619 LogStartupMetrics(); 665 LogStartupMetrics();
620 } 666 }
621 667
622 //----------------------------------------------------------------------------- 668 //-----------------------------------------------------------------------------
623 // This section intermingles prefetch results with actual browser HTTP 669 // This section intermingles prefetch results with actual browser HTTP
624 // network activity. It supports calculating of the benefit of a prefetch, as 670 // network activity. It supports calculating of the benefit of a prefetch, as
625 // well as recording what prefetched hostname resolutions might be potentially 671 // well as recording what prefetched hostname resolutions might be potentially
626 // helpful during the next chrome-startup. 672 // helpful during the next chrome-startup.
627 //----------------------------------------------------------------------------- 673 //-----------------------------------------------------------------------------
628 674
629 void Predictor::LearnAboutInitialNavigation(const GURL& url) { 675 void Predictor::LearnAboutInitialNavigation(const GURL& url) {
630 DCHECK_CURRENTLY_ON(BrowserThread::IO); 676 DCHECK_CURRENTLY_ON(BrowserThread::IO);
631 if (!PredictorEnabled() || nullptr == initial_observer_.get() || 677 if (!PredictorEnabled() || !kInitialDnsPrefetchListEnabled ||
632 !CanPreresolveAndPreconnect()) { 678 !initial_observer_ || !CanPreresolveAndPreconnect()) {
633 return; 679 return;
634 } 680 }
635 initial_observer_->Append(url, this); 681 initial_observer_->Append(url, this);
636 } 682 }
637 683
638 // This API is only used in the browser process. 684 // This API is only used in the browser process.
639 // It is called from an IPC message originating in the renderer. It currently 685 // It is called from an IPC message originating in the renderer. It currently
640 // includes both Page-Scan, and Link-Hover prefetching. 686 // includes both Page-Scan, and Link-Hover prefetching.
641 // TODO(jar): Separate out link-hover prefetching, and page-scan results. 687 // TODO(jar): Separate out link-hover prefetching, and page-scan results.
642 void Predictor::DnsPrefetchList(const std::vector<std::string>& hostnames) { 688 void Predictor::DnsPrefetchList(const std::vector<std::string>& hostnames) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 // Functions to handle saving of hostnames from one session to the next, to 722 // Functions to handle saving of hostnames from one session to the next, to
677 // expedite startup times. 723 // expedite startup times.
678 724
679 void Predictor::SaveStateForNextStartup() { 725 void Predictor::SaveStateForNextStartup() {
680 DCHECK_CURRENTLY_ON(BrowserThread::UI); 726 DCHECK_CURRENTLY_ON(BrowserThread::UI);
681 if (!PredictorEnabled()) 727 if (!PredictorEnabled())
682 return; 728 return;
683 if (!CanPreresolveAndPreconnect()) 729 if (!CanPreresolveAndPreconnect())
684 return; 730 return;
685 731
686 std::unique_ptr<base::ListValue> startup_list(new base::ListValue); 732 auto startup_list = base::MakeUnique<base::ListValue>();
687 std::unique_ptr<base::ListValue> referral_list(new base::ListValue); 733 auto referral_list = base::MakeUnique<base::ListValue>();
688 734
689 // Get raw pointers to pass to the first task. Ownership of the unique_ptrs 735 // Get raw pointers to pass to the first task. Ownership of the unique_ptrs
690 // will be passed to the reply task. 736 // will be passed to the reply task.
691 base::ListValue* startup_list_raw = startup_list.get(); 737 base::ListValue* startup_list_raw = startup_list.get();
692 base::ListValue* referral_list_raw = referral_list.get(); 738 base::ListValue* referral_list_raw = referral_list.get();
693 739
694 // The first post task here is guaranteed to execute before the post task in 740 // The first post task here is guaranteed to execute before the post task in
695 // ShutdownOnUIThread, because the caller has a valid profile. 741 // ShutdownOnUIThread, because the caller has a valid profile.
696 BrowserThread::PostTaskAndReply( 742 BrowserThread::PostTaskAndReply(
697 BrowserThread::IO, FROM_HERE, 743 BrowserThread::IO, FROM_HERE,
698 base::BindOnce(&Predictor::WriteDnsPrefetchState, base::Unretained(this), 744 base::BindOnce(&Predictor::WriteDnsPrefetchState, base::Unretained(this),
699 startup_list_raw, referral_list_raw), 745 startup_list_raw, referral_list_raw),
700 base::BindOnce(&Predictor::UpdatePrefsOnUIThread, 746 base::BindOnce(&Predictor::UpdatePrefsOnUIThread,
701 ui_weak_factory_->GetWeakPtr(), 747 ui_weak_factory_->GetWeakPtr(),
702 base::Passed(std::move(startup_list)), 748 base::Passed(std::move(startup_list)),
703 base::Passed(std::move(referral_list)))); 749 base::Passed(std::move(referral_list))));
704 } 750 }
705 751
706 void Predictor::UpdatePrefsOnUIThread( 752 void Predictor::UpdatePrefsOnUIThread(
707 std::unique_ptr<base::ListValue> startup_list, 753 std::unique_ptr<base::ListValue> startup_list,
708 std::unique_ptr<base::ListValue> referral_list) { 754 std::unique_ptr<base::ListValue> referral_list) {
709 DCHECK_CURRENTLY_ON(BrowserThread::UI); 755 DCHECK_CURRENTLY_ON(BrowserThread::UI);
710 user_prefs_->Set(prefs::kDnsPrefetchingStartupList, *startup_list); 756 user_prefs_->Set(prefs::kDnsPrefetchingStartupList, *startup_list);
757 // May be empty if kInitialDnsPrefetchListEnabled is false. Still update the
jkarlin 2017/06/26 16:47:56 New line above this
Benoit L 2017/06/27 08:37:56 Done.
758 // prefs to clear the state.
711 user_prefs_->Set(prefs::kDnsPrefetchingHostReferralList, *referral_list); 759 user_prefs_->Set(prefs::kDnsPrefetchingHostReferralList, *referral_list);
712 } 760 }
713 761
714 void Predictor::WriteDnsPrefetchState(base::ListValue* startup_list, 762 void Predictor::WriteDnsPrefetchState(base::ListValue* startup_list,
715 base::ListValue* referral_list) { 763 base::ListValue* referral_list) {
716 DCHECK_CURRENTLY_ON(BrowserThread::IO); 764 DCHECK_CURRENTLY_ON(BrowserThread::IO);
717 if (initial_observer_.get()) 765 if (kInitialDnsPrefetchListEnabled && initial_observer_)
718 initial_observer_->GetInitialDnsResolutionList(startup_list); 766 initial_observer_->GetInitialDnsResolutionList(startup_list);
719 767
720 SerializeReferrers(referral_list); 768 SerializeReferrers(referral_list);
721 } 769 }
722 770
723 void Predictor::PreconnectUrl(const GURL& url, 771 void Predictor::PreconnectUrl(const GURL& url,
724 const GURL& first_party_for_cookies, 772 const GURL& first_party_for_cookies,
725 UrlInfo::ResolutionMotivation motivation, 773 UrlInfo::ResolutionMotivation motivation,
726 bool allow_credentials, 774 bool allow_credentials,
727 int count) { 775 int count) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 std::queue<GURL> *queue(rush_queue_.empty() ? &background_queue_ 1148 std::queue<GURL> *queue(rush_queue_.empty() ? &background_queue_
1101 : &rush_queue_); 1149 : &rush_queue_);
1102 GURL url(queue->front()); 1150 GURL url(queue->front());
1103 queue->pop(); 1151 queue->pop();
1104 return url; 1152 return url;
1105 } 1153 }
1106 1154
1107 //----------------------------------------------------------------------------- 1155 //-----------------------------------------------------------------------------
1108 // Member definitions for InitialObserver class. 1156 // Member definitions for InitialObserver class.
1109 1157
1110 Predictor::InitialObserver::InitialObserver() { 1158 InitialObserver::InitialObserver() = default;
1111 }
1112 1159
1113 Predictor::InitialObserver::~InitialObserver() { 1160 InitialObserver::~InitialObserver() = default;
1114 }
1115 1161
1116 void Predictor::InitialObserver::Append(const GURL& url, 1162 void InitialObserver::Append(const GURL& url, Predictor* predictor) {
1117 Predictor* predictor) {
1118 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1163 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1119 1164
1120 if (kStartupResolutionCount <= first_navigations_.size()) 1165 if (kStartupResolutionCount <= first_navigations_.size())
1121 return; 1166 return;
1122 1167
1123 DCHECK(url.SchemeIsHTTPOrHTTPS()); 1168 DCHECK(url.SchemeIsHTTPOrHTTPS());
1124 DCHECK_EQ(url, Predictor::CanonicalizeUrl(url)); 1169 DCHECK_EQ(url, Predictor::CanonicalizeUrl(url));
1125 if (first_navigations_.find(url) == first_navigations_.end()) 1170 if (first_navigations_.find(url) == first_navigations_.end())
1126 first_navigations_[url] = base::TimeTicks::Now(); 1171 first_navigations_[url] = base::TimeTicks::Now();
1127 } 1172 }
1128 1173
1129 void Predictor::InitialObserver::GetInitialDnsResolutionList( 1174 void InitialObserver::GetInitialDnsResolutionList(
1130 base::ListValue* startup_list) { 1175 base::ListValue* startup_list) {
1131 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1176 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1132 DCHECK(startup_list); 1177 DCHECK(startup_list);
1133 DCHECK(startup_list->empty()); 1178 DCHECK(startup_list->empty());
1134 DCHECK_EQ(0u, startup_list->GetSize()); 1179 DCHECK_EQ(0u, startup_list->GetSize());
1135 startup_list->AppendInteger(kPredictorStartupFormatVersion); 1180 startup_list->AppendInteger(kPredictorStartupFormatVersion);
1136 for (FirstNavigations::iterator it = first_navigations_.begin(); 1181 for (const auto& url_time : first_navigations_) {
1137 it != first_navigations_.end(); 1182 DCHECK(url_time.first == Predictor::CanonicalizeUrl(url_time.first));
1138 ++it) { 1183 startup_list->AppendString(url_time.first.spec());
1139 DCHECK(it->first == Predictor::CanonicalizeUrl(it->first));
1140 startup_list->AppendString(it->first.spec());
1141 } 1184 }
1142 } 1185 }
1143 1186
1144 void Predictor::InitialObserver::GetFirstResolutionsHtml( 1187 void InitialObserver::GetFirstResolutionsHtml(std::string* output) {
1145 std::string* output) {
1146 DCHECK_CURRENTLY_ON(BrowserThread::IO); 1188 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1147 1189
1148 UrlInfo::UrlInfoTable resolution_list; 1190 UrlInfo::UrlInfoTable resolution_list;
1149 { 1191 for (const auto& url_time : first_navigations_) {
1150 for (FirstNavigations::iterator it(first_navigations_.begin()); 1192 UrlInfo info;
1151 it != first_navigations_.end(); 1193 info.SetUrl(url_time.first);
1152 it++) { 1194 info.set_time(url_time.second);
1153 UrlInfo info; 1195 resolution_list.push_back(info);
1154 info.SetUrl(it->first);
1155 info.set_time(it->second);
1156 resolution_list.push_back(info);
1157 }
1158 } 1196 }
1159 UrlInfo::GetHtmlTable(resolution_list, 1197 UrlInfo::GetHtmlTable(resolution_list,
1160 "Future startups will prefetch DNS records for ", false, output); 1198 "Future startups will prefetch DNS records for ", false,
1199 output);
1161 } 1200 }
1162 1201
1163 //----------------------------------------------------------------------------- 1202 //-----------------------------------------------------------------------------
1164 // Helper functions 1203 // Helper functions
1165 //----------------------------------------------------------------------------- 1204 //-----------------------------------------------------------------------------
1166 1205
1167 // static 1206 // static
1168 GURL Predictor::CanonicalizeUrl(const GURL& url) { 1207 GURL Predictor::CanonicalizeUrl(const GURL& url) {
1169 if (!url.has_host()) 1208 if (!url.has_host())
1170 return GURL::EmptyGURL(); 1209 return GURL::EmptyGURL();
(...skipping 26 matching lines...) Expand all
1197 } 1236 }
1198 1237
1199 void SimplePredictor::ShutdownOnUIThread() { 1238 void SimplePredictor::ShutdownOnUIThread() {
1200 SetShutdown(true); 1239 SetShutdown(true);
1201 } 1240 }
1202 1241
1203 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; } 1242 bool SimplePredictor::CanPrefetchAndPrerender() const { return true; }
1204 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; } 1243 bool SimplePredictor::CanPreresolveAndPreconnect() const { return true; }
1205 1244
1206 } // namespace chrome_browser_net 1245 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698