diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 18:38:31 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-04 18:38:31 +0000 |
commit | bd6b924a418a7aff495669567ae6946825524616 (patch) | |
tree | d7383afee82256d612e9a8bd490d0233c8f69b3c | |
parent | 5e3477e34c93c52e03f10101909ceeb71324b38c (diff) | |
download | chromium_src-bd6b924a418a7aff495669567ae6946825524616.zip chromium_src-bd6b924a418a7aff495669567ae6946825524616.tar.gz chromium_src-bd6b924a418a7aff495669567ae6946825524616.tar.bz2 |
Change how Prerender control group works so the "matched" case is recorded.
This changes the control group to do a prefetch, but no prerender. It also fixes a number
of issues which get exposed when that is the behavior.
BUG=None
TEST=Get selected in control group, search for prerendered page, make sure it makes sense.
Review URL: http://codereview.chromium.org/6720021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80345 0039d316-1c4b-4281-b951-d872f2087c98
5 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index 72ed1a2..166f4f9 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -490,6 +490,9 @@ void PrerenderContents::RendererUnresponsive(RenderViewHost* render_view_host, base::ProcessMetrics* PrerenderContents::MaybeGetProcessMetrics() { if (process_metrics_.get() == NULL) { + // If a PrenderContents hasn't started prerending, don't be fully formed. + if (!render_view_host_ || !render_view_host_->process()) + return NULL; base::ProcessHandle handle = render_view_host_->process()->GetHandle(); if (handle == base::kNullProcessHandle) return NULL; diff --git a/chrome/browser/prerender/prerender_field_trial.cc b/chrome/browser/prerender/prerender_field_trial.cc index d15a173..615d258 100644 --- a/chrome/browser/prerender/prerender_field_trial.cc +++ b/chrome/browser/prerender/prerender_field_trial.cc @@ -96,7 +96,7 @@ void ConfigurePrefetchAndPrerender(const CommandLine& command_line) { PrerenderManager::PRERENDER_MODE_EXPERIMENT_PRERENDER_GROUP); } else if (trial_group == kPrerenderControl1Group || trial_group == kPrerenderControl2Group) { - ResourceDispatcherHost::set_is_prefetch_enabled(false); + ResourceDispatcherHost::set_is_prefetch_enabled(true); PrerenderManager::SetMode( PrerenderManager::PRERENDER_MODE_EXPERIMENT_CONTROL_GROUP); } else { diff --git a/chrome/browser/prerender/prerender_final_status.cc b/chrome/browser/prerender/prerender_final_status.cc index 52dcdad..cfad313 100644 --- a/chrome/browser/prerender/prerender_final_status.cc +++ b/chrome/browser/prerender/prerender_final_status.cc @@ -10,6 +10,11 @@ namespace prerender { void RecordFinalStatus(FinalStatus final_status) { DCHECK(final_status != FINAL_STATUS_MAX); + // FINAL_STATUS_CONTROL_GROUP indicates that the PrerenderContents + // was created only to measure "would-have-been-prerendered" for + // control group measurements. Don't pollute data with it. + if (final_status == FINAL_STATUS_CONTROL_GROUP) + return; UMA_HISTOGRAM_ENUMERATION("Prerender.FinalStatus", final_status, FINAL_STATUS_MAX); diff --git a/chrome/browser/prerender/prerender_final_status.h b/chrome/browser/prerender/prerender_final_status.h index a0ec142..48122be 100644 --- a/chrome/browser/prerender/prerender_final_status.h +++ b/chrome/browser/prerender/prerender_final_status.h @@ -28,6 +28,7 @@ enum FinalStatus { FINAL_STATUS_TOO_MANY_PROCESSES, FINAL_STATUS_RATE_LIMIT_EXCEEDED, FINAL_STATUS_PENDING_SKIPPED, + FINAL_STATUS_CONTROL_GROUP, FINAL_STATUS_MAX, }; diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index d468ea0..49335a3 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -180,7 +180,9 @@ bool PrerenderManager::AddPreload(const GURL& url, GetCurrentTime()); prerender_list_.push_back(data); - if (!IsControlGroup()) { + if (IsControlGroup()) { + data.contents_->set_final_status(FINAL_STATUS_CONTROL_GROUP); + } else { last_prerender_start_time_ = GetCurrentTimeTicks(); data.contents_->StartPrerendering(); } |