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