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/renderer/dom_automation_controller.h" | 5 #include "content/renderer/dom_automation_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/json/json_string_value_serializer.h" | 9 #include "base/json/json_string_value_serializer.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 automation_id_ = args[0].ToInt32(); | 176 automation_id_ = args[0].ToInt32(); |
177 result->Set(true); | 177 result->Set(true); |
178 } | 178 } |
179 | 179 |
180 void DomAutomationController::GetHistogram(const CppArgumentList& args, | 180 void DomAutomationController::GetHistogram(const CppArgumentList& args, |
181 CppVariant* result) { | 181 CppVariant* result) { |
182 if (args.size() != 1) { | 182 if (args.size() != 1) { |
183 result->SetNull(); | 183 result->SetNull(); |
184 return; | 184 return; |
185 } | 185 } |
186 base::Histogram* histogram = | 186 base::HistogramBase* histogram = |
187 base::StatisticsRecorder::FindHistogram(args[0].ToString()); | 187 base::StatisticsRecorder::FindHistogram(args[0].ToString()); |
188 std::string output; | 188 std::string output; |
189 if (!histogram) { | 189 if (!histogram) { |
190 output = "{}"; | 190 output = "{}"; |
191 } else { | 191 } else { |
192 histogram->WriteJSON(&output); | 192 histogram->WriteJSON(&output); |
193 } | 193 } |
194 result->Set(output); | 194 result->Set(output); |
195 } | 195 } |
196 | 196 |
(...skipping 10 matching lines...) Expand all Loading... |
207 return; | 207 return; |
208 } | 208 } |
209 | 209 |
210 std::string histogram_json; | 210 std::string histogram_json; |
211 sender_->Send(new ChildProcessHostMsg_GetBrowserHistogram( | 211 sender_->Send(new ChildProcessHostMsg_GetBrowserHistogram( |
212 args[0].ToString(), &histogram_json)); | 212 args[0].ToString(), &histogram_json)); |
213 result->Set(histogram_json); | 213 result->Set(histogram_json); |
214 } | 214 } |
215 | 215 |
216 } // namespace content | 216 } // namespace content |
OLD | NEW |