| 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 "content/browser/histogram_message_filter.h" | 5 #include "content/browser/histogram_message_filter.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/metrics/statistics_recorder.h" | 9 #include "base/metrics/statistics_recorder.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 CommandLine::ForCurrentProcess()->HasSwitch( | 56 CommandLine::ForCurrentProcess()->HasSwitch( |
| 57 switches::kReduceSecurityForDomAutomationTests); | 57 switches::kReduceSecurityForDomAutomationTests); |
| 58 | 58 |
| 59 if (!using_dom_controller || !reduced_security) { | 59 if (!using_dom_controller || !reduced_security) { |
| 60 LOG(ERROR) << "Attempt at reading browser histogram without specifying " | 60 LOG(ERROR) << "Attempt at reading browser histogram without specifying " |
| 61 << "--" << switches::kDomAutomationController << " and " | 61 << "--" << switches::kDomAutomationController << " and " |
| 62 << "--" << switches::kReduceSecurityForDomAutomationTests | 62 << "--" << switches::kReduceSecurityForDomAutomationTests |
| 63 << " switches."; | 63 << " switches."; |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 base::Histogram* histogram = base::StatisticsRecorder::FindHistogram(name); | 66 base::HistogramBase* histogram = |
| 67 base::StatisticsRecorder::FindHistogram(name); |
| 67 if (!histogram) { | 68 if (!histogram) { |
| 68 *histogram_json = "{}"; | 69 *histogram_json = "{}"; |
| 69 } else { | 70 } else { |
| 70 histogram->WriteJSON(histogram_json); | 71 histogram->WriteJSON(histogram_json); |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 | 74 |
| 74 } // namespace content | 75 } // namespace content |
| OLD | NEW |