diff options
author | bnc@chromium.org <bnc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 19:09:58 +0000 |
---|---|---|
committer | bnc@chromium.org <bnc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-20 19:09:58 +0000 |
commit | cfef24807374687c56448caeee1725e3431bb9ed (patch) | |
tree | a68809944d2fb507a6962e392c50d5a852e44b8d | |
parent | 45ff0eb6fd47bfa799ee5c58cb0a9c342c05662e (diff) | |
download | chromium_src-cfef24807374687c56448caeee1725e3431bb9ed.zip chromium_src-cfef24807374687c56448caeee1725e3431bb9ed.tar.gz chromium_src-cfef24807374687c56448caeee1725e3431bb9ed.tar.bz2 |
Add AllowNetworkPrediction preference name and enum.
BUG=334602
Review URL: https://codereview.chromium.org/336543003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278789 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/net/predictor.h | 9 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 9 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h index 3234e17..3a747d8 100644 --- a/chrome/browser/net/predictor.h +++ b/chrome/browser/net/predictor.h @@ -80,6 +80,15 @@ class PredictorObserver { // the IO thread. class Predictor { public: + // Enum describing when to allow network predictions based on connection type. + // The same enum must be used by the platform-dependent components. + // TODO(bnc): implement as per crbug.com/334602. + enum NetworkPredictionOptions { + NETWORK_PREDICTION_ALWAYS, + NETWORK_PREDICTION_WIFI_ONLY, + NETWORK_PREDICTION_NEVER + }; + // A version number for prefs that are saved. This should be incremented when // we change the format so that we discard old data. static const int kPredictorReferrerVersion; diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 7f23dca..85e68af 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -507,8 +507,17 @@ const char kMultipleProfilePrefMigration[] = // of web pages, and resource prefetching. // NOTE: The "dns_prefetching.enabled" value is used so that historical user // preferences are not lost. +// TODO(bnc): Remove kNetworkPredictionEnabled once kAllowNetworkPrediction is +// functioning as per crbug.com/334602. const char kNetworkPredictionEnabled[] = "dns_prefetching.enabled"; +// A preference of enum chrome_browser_net::NetworkPredictionOptions shows +// if prediction of network actions is allowed, depending on network type. +// Actions include DNS prefetching, TCP and SSL preconnection, prerendering +// of web pages, and resource prefetching. +// TODO(bnc): Implement this preference as per crbug.com/334602. +const char kAllowNetworkPrediction[] = "net.allow_network_prediction"; + // An integer representing the state of the default apps installation process. // This value is persisted in the profile's user preferences because the process // is async, and the user may have stopped chrome in the middle. The next time diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index fc6ddd8..7168b35 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -182,6 +182,7 @@ extern const char kLastPolicyCheckTime[]; extern const char kInstantUIZeroSuggestUrlPrefix[]; extern const char kMultipleProfilePrefMigration[]; extern const char kNetworkPredictionEnabled[]; +extern const char kAllowNetworkPrediction[]; extern const char kDefaultAppsInstallState[]; extern const char kHideWebStoreIcon[]; #if defined(OS_CHROMEOS) |