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

Side by Side Diff: chrome/browser/prefetch/prefetch.cc

Issue 385173002: Make prefetch default on (subject to the regular predictive networking preference). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 5 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 | « no previous file | chrome/browser/prefetch/prefetch_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/prefetch/prefetch.h" 5 #include "chrome/browser/prefetch/prefetch.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "chrome/browser/net/prediction_options.h" 11 #include "chrome/browser/net/prediction_options.h"
12 #include "chrome/browser/prefetch/prefetch_field_trial.h" 12 #include "chrome/browser/prefetch/prefetch_field_trial.h"
13 #include "chrome/browser/profiles/profile_io_data.h" 13 #include "chrome/browser/profiles/profile_io_data.h"
14 #include "net/base/network_change_notifier.h" 14 #include "net/base/network_change_notifier.h"
15 15
16 namespace prefetch { 16 namespace prefetch {
17 17
18 bool IsPrefetchEnabled(content::ResourceContext* resource_context) { 18 bool IsPrefetchEnabled(content::ResourceContext* resource_context) {
19 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 19 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
20 20
21 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); 21 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
22 22
23 DCHECK(io_data); 23 DCHECK(io_data);
24 24
25 return IsPrefetchFieldTrialEnabled() && 25 return chrome_browser_net::CanPredictNetworkActionsIO(io_data) &&
26 chrome_browser_net::CanPredictNetworkActionsIO(io_data); 26 !DisableForFieldTrial();
27 } 27 }
28 28
29 } // namespace prefetch 29 } // namespace prefetch
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefetch/prefetch_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698