| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/prerender/prerender_histograms.h" | 5 #include "chrome/browser/prerender/prerender_histograms.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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void PrerenderHistograms::RecordFinalStatus(Origin origin, | 259 void PrerenderHistograms::RecordFinalStatus(Origin origin, |
| 260 uint8 experiment_id, | 260 uint8 experiment_id, |
| 261 FinalStatus final_status) const { | 261 FinalStatus final_status) const { |
| 262 DCHECK(final_status != FINAL_STATUS_MAX); | 262 DCHECK(final_status != FINAL_STATUS_MAX); |
| 263 PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT( | 263 PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT( |
| 264 base::FieldTrial::MakeName("FinalStatus", "Prerender"), | 264 base::FieldTrial::MakeName("FinalStatus", "Prerender"), |
| 265 origin, experiment_id, | 265 origin, experiment_id, |
| 266 UMA_HISTOGRAM_ENUMERATION(name, final_status, FINAL_STATUS_MAX)); | 266 UMA_HISTOGRAM_ENUMERATION(name, final_status, FINAL_STATUS_MAX)); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void PrerenderHistograms::RecordMatchCompleteFinalStatus( |
| 270 Origin origin, |
| 271 uint8 experiment_id, |
| 272 FinalStatus final_status) const { |
| 273 DCHECK(final_status != FINAL_STATUS_MAX); |
| 274 PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT( |
| 275 base::FieldTrial::MakeName("FinalStatusMatchComplete", "Prerender"), |
| 276 origin, experiment_id, |
| 277 UMA_HISTOGRAM_ENUMERATION(name, final_status, FINAL_STATUS_MAX)); |
| 278 } |
| 279 |
| 269 uint8 PrerenderHistograms::GetCurrentExperimentId() const { | 280 uint8 PrerenderHistograms::GetCurrentExperimentId() const { |
| 270 if (!WithinWindow()) | 281 if (!WithinWindow()) |
| 271 return kNoExperiment; | 282 return kNoExperiment; |
| 272 return last_experiment_id_; | 283 return last_experiment_id_; |
| 273 } | 284 } |
| 274 | 285 |
| 275 Origin PrerenderHistograms::GetCurrentOrigin() const { | 286 Origin PrerenderHistograms::GetCurrentOrigin() const { |
| 276 if (!WithinWindow()) | 287 if (!WithinWindow()) |
| 277 return ORIGIN_LINK_REL_PRERENDER; | 288 return ORIGIN_LINK_REL_PRERENDER; |
| 278 return last_origin_; | 289 return last_origin_; |
| 279 } | 290 } |
| 280 | 291 |
| 281 bool PrerenderHistograms::IsOriginExperimentWash() const { | 292 bool PrerenderHistograms::IsOriginExperimentWash() const { |
| 282 if (!WithinWindow()) | 293 if (!WithinWindow()) |
| 283 return false; | 294 return false; |
| 284 return origin_experiment_wash_; | 295 return origin_experiment_wash_; |
| 285 } | 296 } |
| 286 | 297 |
| 287 } // namespace prerender | 298 } // namespace prerender |
| OLD | NEW |