| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ | 120 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ |
| 119 HISTOGRAM; \ | 121 HISTOGRAM; \ |
| 120 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ | 122 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ |
| 121 HISTOGRAM; \ | 123 HISTOGRAM; \ |
| 122 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ | 124 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ |
| 123 HISTOGRAM; \ | 125 HISTOGRAM; \ |
| 124 } else if (origin == ORIGIN_EXTERNAL_REQUEST) { \ | 126 } else if (origin == ORIGIN_EXTERNAL_REQUEST) { \ |
| 125 HISTOGRAM; \ | 127 HISTOGRAM; \ |
| 126 } else if (origin == ORIGIN_INSTANT) { \ | 128 } else if (origin == ORIGIN_INSTANT) { \ |
| 127 HISTOGRAM; \ | 129 HISTOGRAM; \ |
| 130 } else if (origin == ORIGIN_LINK_REL_NEXT) { \ |
| 131 HISTOGRAM; \ |
| 128 } else if (experiment != kNoExperiment) { \ | 132 } else if (experiment != kNoExperiment) { \ |
| 129 HISTOGRAM; \ | 133 HISTOGRAM; \ |
| 130 } else { \ | 134 } else { \ |
| 131 HISTOGRAM; \ | 135 HISTOGRAM; \ |
| 132 } \ | 136 } \ |
| 133 } | 137 } |
| 134 | 138 |
| 135 PrerenderHistograms::PrerenderHistograms() | 139 PrerenderHistograms::PrerenderHistograms() |
| 136 : last_experiment_id_(kNoExperiment), | 140 : last_experiment_id_(kNoExperiment), |
| 137 last_origin_(ORIGIN_MAX), | 141 last_origin_(ORIGIN_MAX), |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 return last_experiment_id_; | 405 return last_experiment_id_; |
| 402 } | 406 } |
| 403 | 407 |
| 404 bool PrerenderHistograms::IsOriginExperimentWash() const { | 408 bool PrerenderHistograms::IsOriginExperimentWash() const { |
| 405 if (!WithinWindow()) | 409 if (!WithinWindow()) |
| 406 return false; | 410 return false; |
| 407 return origin_experiment_wash_; | 411 return origin_experiment_wash_; |
| 408 } | 412 } |
| 409 | 413 |
| 410 } // namespace prerender | 414 } // namespace prerender |
| OLD | NEW |