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

Unified Diff: trunk/src/content/renderer/dom_automation_controller.cc

Issue 16160006: Revert 202620 "Collect tab timing information for use in telemen..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/renderer/dom_automation_controller.cc
===================================================================
--- trunk/src/content/renderer/dom_automation_controller.cc (revision 202661)
+++ trunk/src/content/renderer/dom_automation_controller.cc (working copy)
@@ -31,6 +31,12 @@
base::Unretained(this)));
BindCallback("sendWithId", base::Bind(&DomAutomationController::SendWithId,
base::Unretained(this)));
+ BindCallback("getHistogram",
+ base::Bind(&DomAutomationController::GetHistogram,
+ base::Unretained(this)));
+ BindCallback("getBrowserHistogram",
+ base::Bind(&DomAutomationController::GetBrowserHistogram,
+ base::Unretained(this)));
}
void DomAutomationController::Send(const CppArgumentList& args,
@@ -171,4 +177,40 @@
result->Set(true);
}
+void DomAutomationController::GetHistogram(const CppArgumentList& args,
+ CppVariant* result) {
+ if (args.size() != 1) {
+ result->SetNull();
+ return;
+ }
+ base::HistogramBase* histogram =
+ base::StatisticsRecorder::FindHistogram(args[0].ToString());
+ std::string output;
+ if (!histogram) {
+ output = "{}";
+ } else {
+ histogram->WriteJSON(&output);
+ }
+ result->Set(output);
+}
+
+void DomAutomationController::GetBrowserHistogram(const CppArgumentList& args,
+ CppVariant* result) {
+ if (args.size() != 1) {
+ result->SetNull();
+ return;
+ }
+
+ if (!sender_) {
+ NOTREACHED();
+ result->SetNull();
+ return;
+ }
+
+ std::string histogram_json;
+ sender_->Send(new ChildProcessHostMsg_GetBrowserHistogram(
+ args[0].ToString(), &histogram_json));
+ result->Set(histogram_json);
+}
+
} // namespace content
« no previous file with comments | « trunk/src/content/renderer/dom_automation_controller.h ('k') | trunk/src/content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698