diff options
author | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-14 23:29:04 +0000 |
---|---|---|
committer | shishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-14 23:29:04 +0000 |
commit | 1bd55ae056e7772922da318c0282ad8d59c9d496 (patch) | |
tree | 5db42ca41693a4a5a0b0f6946fb1f2dc2e5776dd /chrome/browser/prerender/prerender_field_trial.cc | |
parent | 95d4e5f8ca8b1456c5927df7376e2bd1b7cb8e3a (diff) | |
download | chromium_src-1bd55ae056e7772922da318c0282ad8d59c9d496.zip chromium_src-1bd55ae056e7772922da318c0282ad8d59c9d496.tar.gz chromium_src-1bd55ae056e7772922da318c0282ad8d59c9d496.tar.bz2 |
Adds speculative prefetching of resources.
The learning component was already checked in.
BUG=None
TEST=To be done.
Review URL: https://chromiumcodereview.appspot.com/10817004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156926 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prerender/prerender_field_trial.cc')
-rw-r--r-- | chrome/browser/prerender/prerender_field_trial.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc index 69edf7b..f50036f 100644 --- a/chrome/browser/prerender/prerender_field_trial.cc +++ b/chrome/browser/prerender/prerender_field_trial.cc @@ -293,4 +293,20 @@ bool IsSpeculativeResourcePrefetchingLearningEnabled(Profile* profile) { return group == g_speculative_prefetching_learning_default_group_number; } +bool IsSpeculativeResourcePrefetchingEnabled(Profile* profile) { + if (!profile) + return false; + + // Check if the user has set a command line flag. + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kSpeculativeResourcePrefetching)) { + const std::string switch_value = + CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kSpeculativeResourcePrefetching); + return switch_value == switches::kSpeculativeResourcePrefetchingEnabled; + } + + return false; +} + } // namespace prerender |