| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 switch (origin) { | 50 switch (origin) { |
| 51 case ORIGIN_OMNIBOX: | 51 case ORIGIN_OMNIBOX: |
| 52 return ComposeHistogramName("omnibox", name); | 52 return ComposeHistogramName("omnibox", name); |
| 53 case ORIGIN_NONE: | 53 case ORIGIN_NONE: |
| 54 return ComposeHistogramName("none", name); | 54 return ComposeHistogramName("none", name); |
| 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: |
| 60 return ComposeHistogramName("localpredictor", name); |
| 59 case ORIGIN_GWS_PRERENDER: // Handled above. | 61 case ORIGIN_GWS_PRERENDER: // Handled above. |
| 60 default: | 62 default: |
| 61 NOTREACHED(); | 63 NOTREACHED(); |
| 62 break; | 64 break; |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 // Dummy return value to make the compiler happy. | 67 // Dummy return value to make the compiler happy. |
| 66 NOTREACHED(); | 68 NOTREACHED(); |
| 67 return ComposeHistogramName("wash", name); | 69 return ComposeHistogramName("wash", name); |
| 68 } | 70 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 (origin != ORIGIN_GWS_PRERENDER || \ | 108 (origin != ORIGIN_GWS_PRERENDER || \ |
| 107 experiment != recording_experiment)) { \ | 109 experiment != recording_experiment)) { \ |
| 108 } else if (origin == ORIGIN_OMNIBOX) { \ | 110 } else if (origin == ORIGIN_OMNIBOX) { \ |
| 109 HISTOGRAM; \ | 111 HISTOGRAM; \ |
| 110 } else if (origin == ORIGIN_NONE) { \ | 112 } else if (origin == ORIGIN_NONE) { \ |
| 111 HISTOGRAM; \ | 113 HISTOGRAM; \ |
| 112 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ | 114 } else if (origin == ORIGIN_LINK_REL_PRERENDER_SAMEDOMAIN) { \ |
| 113 HISTOGRAM; \ | 115 HISTOGRAM; \ |
| 114 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ | 116 } else if (origin == ORIGIN_LINK_REL_PRERENDER_CROSSDOMAIN) { \ |
| 115 HISTOGRAM; \ | 117 HISTOGRAM; \ |
| 118 } else if (origin == ORIGIN_LOCAL_PREDICTOR) { \ |
| 119 HISTOGRAM; \ |
| 116 } else if (experiment != kNoExperiment) { \ | 120 } else if (experiment != kNoExperiment) { \ |
| 117 HISTOGRAM; \ | 121 HISTOGRAM; \ |
| 118 } else { \ | 122 } else { \ |
| 119 HISTOGRAM; \ | 123 HISTOGRAM; \ |
| 120 } \ | 124 } \ |
| 121 } | 125 } |
| 122 | 126 |
| 123 PrerenderHistograms::PrerenderHistograms() | 127 PrerenderHistograms::PrerenderHistograms() |
| 124 : last_experiment_id_(kNoExperiment), | 128 : last_experiment_id_(kNoExperiment), |
| 125 last_origin_(ORIGIN_MAX), | 129 last_origin_(ORIGIN_MAX), |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return last_experiment_id_; | 385 return last_experiment_id_; |
| 382 } | 386 } |
| 383 | 387 |
| 384 bool PrerenderHistograms::IsOriginExperimentWash() const { | 388 bool PrerenderHistograms::IsOriginExperimentWash() const { |
| 385 if (!WithinWindow()) | 389 if (!WithinWindow()) |
| 386 return false; | 390 return false; |
| 387 return origin_experiment_wash_; | 391 return origin_experiment_wash_; |
| 388 } | 392 } |
| 389 | 393 |
| 390 } // namespace prerender | 394 } // namespace prerender |
| OLD | NEW |