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/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 histogram_name) | 85 histogram_name) |
86 | 86 |
87 #define PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT(histogram_name, origin, \ | 87 #define PREFIXED_HISTOGRAM_ORIGIN_EXPERIMENT(histogram_name, origin, \ |
88 experiment, HISTOGRAM) \ | 88 experiment, HISTOGRAM) \ |
89 PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, false, HISTOGRAM, \ | 89 PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, false, HISTOGRAM, \ |
90 histogram_name) | 90 histogram_name) |
91 | 91 |
92 #define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \ | 92 #define PREFIXED_HISTOGRAM_INTERNAL(origin, experiment, wash, HISTOGRAM, \ |
93 histogram_name) { \ | 93 histogram_name) { \ |
94 { \ | 94 { \ |
95 /* Do not rename. HISTOGRAM expects a local variable "name". */ \ | 95 /* Do not rename. HISTOGRAM expects a local variable "name". */ \ |
96 std::string name = ComposeHistogramName("", histogram_name); \ | 96 std::string name = ComposeHistogramName(std::string(), histogram_name); \ |
97 HISTOGRAM; \ | 97 HISTOGRAM; \ |
98 } \ | 98 } \ |
99 /* Do not rename. HISTOGRAM expects a local variable "name". */ \ | 99 /* Do not rename. HISTOGRAM expects a local variable "name". */ \ |
100 std::string name = GetHistogramName(origin, experiment, wash, \ | 100 std::string name = GetHistogramName(origin, experiment, wash, \ |
101 histogram_name); \ | 101 histogram_name); \ |
102 static uint8 recording_experiment = kNoExperiment; \ | 102 static uint8 recording_experiment = kNoExperiment; \ |
103 if (recording_experiment == kNoExperiment && experiment != kNoExperiment) \ | 103 if (recording_experiment == kNoExperiment && experiment != kNoExperiment) \ |
104 recording_experiment = experiment; \ | 104 recording_experiment = experiment; \ |
105 if (wash) { \ | 105 if (wash) { \ |
106 HISTOGRAM; \ | 106 HISTOGRAM; \ |
107 } else if (experiment != kNoExperiment && \ | 107 } else if (experiment != kNoExperiment && \ |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return last_experiment_id_; | 387 return last_experiment_id_; |
388 } | 388 } |
389 | 389 |
390 bool PrerenderHistograms::IsOriginExperimentWash() const { | 390 bool PrerenderHistograms::IsOriginExperimentWash() const { |
391 if (!WithinWindow()) | 391 if (!WithinWindow()) |
392 return false; | 392 return false; |
393 return origin_experiment_wash_; | 393 return origin_experiment_wash_; |
394 } | 394 } |
395 | 395 |
396 } // namespace prerender | 396 } // namespace prerender |
OLD | NEW |