diff options
-rw-r--r-- | chrome/browser/prefetch/prefetch.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/prefetch/prefetch.cc b/chrome/browser/prefetch/prefetch.cc index 84b517b..74c39b2 100644 --- a/chrome/browser/prefetch/prefetch.cc +++ b/chrome/browser/prefetch/prefetch.cc @@ -19,9 +19,17 @@ bool IsPrefetchEnabled(content::ResourceContext* resource_context) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); - DCHECK(io_data); + // TODO(bnc): Remove this condition once the new + // predictive preference is used on all platforms. See crbug.com/334602. + if (io_data->network_prediction_options()->GetValue() == + chrome_browser_net::NETWORK_PREDICTION_UNSET && + net::NetworkChangeNotifier::IsConnectionCellular( + net::NetworkChangeNotifier::GetConnectionType())) { + return false; + } + return chrome_browser_net::CanPredictNetworkActionsIO(io_data) && !DisableForFieldTrial(); } |