Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: content/renderer/dom_automation_controller.cc

Issue 12207058: Connect SparseHistogram with the rest of stats system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/child_histogram_message_filter.cc ('k') | dbus/signal_sender_verification_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698