| 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/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 case ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN: | 55 case ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN: |
| 56 return ComposeHistogramName("websame", name); | 56 return ComposeHistogramName("websame", name); |
| 57 case ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN: | 57 case ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN: |
| 58 return ComposeHistogramName("webcross", name); | 58 return ComposeHistogramName("webcross", name); |
| 59 case ORIGIN_LOCAL_PREDICTOR: | 59 case ORIGIN_LOCAL_PREDICTOR: |
| 60 return ComposeHistogramName("localpredictor", name); | 60 return ComposeHistogramName("localpredictor", name); |
| 61 case ORIGIN_EXTERNAL_REQUEST: | 61 case ORIGIN_EXTERNAL_REQUEST: |
| 62 return ComposeHistogramName("externalrequest", name); | 62 return ComposeHistogramName("externalrequest", name); |
| 63 case ORIGIN_INSTANT: | 63 case ORIGIN_INSTANT: |
| 64 return ComposeHistogramName("Instant", name); | 64 return ComposeHistogramName("Instant", name); |
| 65 case ORIGIN_LINK_REL_NEXT: |
| 66 return ComposeHistogramName("webnext", name); |
| 65 case ORIGIN_GWS_PRERENDER: // Handled above. | 67 case ORIGIN_GWS_PRERENDER: // Handled above. |
| 66 default: | 68 default: |
| 67 NOTREACHED(); | 69 NOTREACHED(); |
| 68 break; | 70 break; |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 // Dummy return value to make the compiler happy. | 73 // Dummy return value to make the compiler happy. |
| 72 NOTREACHED(); | 74 NOTREACHED(); |
| 73 return ComposeHistogramName("wash", name); | 75 return ComposeHistogramName("wash", name); |
| 74 } | 76 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ | 126 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ |
| 125 HISTOGRAM; \ | 127 HISTOGRAM; \ |
| 126 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ | 128 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ |
| 127 HISTOGRAM; \ | 129 HISTOGRAM; \ |
| 128 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ | 130 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ |
| 129 HISTOGRAM; \ | 131 HISTOGRAM; \ |
| 130 } else if (origin == ORIGIN_EXTERNAL_REQUEST) { \ | 132 } else if (origin == ORIGIN_EXTERNAL_REQUEST) { \ |
| 131 HISTOGRAM; \ | 133 HISTOGRAM; \ |
| 132 } else if (origin == ORIGIN_INSTANT) { \ | 134 } else if (origin == ORIGIN_INSTANT) { \ |
| 133 HISTOGRAM; \ | 135 HISTOGRAM; \ |
| 136 } else if (origin == ORIGIN_LINK_REL_NEXT) { \ |
| 137 HISTOGRAM; \ |
| 134 } else if (experiment != kNoExperiment) { \ | 138 } else if (experiment != kNoExperiment) { \ |
| 135 HISTOGRAM; \ | 139 HISTOGRAM; \ |
| 136 } else { \ | 140 } else { \ |
| 137 HISTOGRAM; \ | 141 HISTOGRAM; \ |
| 138 } \ | 142 } \ |
| 139 } while (0) | 143 } while (0) |
| 140 | 144 |
| 141 PrerenderHistograms::PrerenderHistograms() | 145 PrerenderHistograms::PrerenderHistograms() |
| 142 : last_experiment_id_(kNoExperiment), | 146 : last_experiment_id_(kNoExperiment), |
| 143 last_origin_(ORIGIN_MAX), | 147 last_origin_(ORIGIN_MAX), |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return last_experiment_id_; | 419 return last_experiment_id_; |
| 416 } | 420 } |
| 417 | 421 |
| 418 bool PrerenderHistograms::IsOriginExperimentWash() const { | 422 bool PrerenderHistograms::IsOriginExperimentWash() const { |
| 419 if (!WithinWindow()) | 423 if (!WithinWindow()) |
| 420 return false; | 424 return false; |
| 421 return origin_experiment_wash_; | 425 return origin_experiment_wash_; |
| 422 } | 426 } |
| 423 | 427 |
| 424 } // namespace prerender | 428 } // namespace prerender |
| OLD | NEW |