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

Unified Diff: content/renderer/dom_automation_controller.cc

Issue 11975048: Native memory histograms for the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (creis) Created 7 years, 11 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: content/renderer/dom_automation_controller.cc
diff --git a/content/renderer/dom_automation_controller.cc b/content/renderer/dom_automation_controller.cc
index 6f4b27a6fadbc14d7ad39bdb7dd855501e2336d9..8c4847ccb0e34ec6bb59f7a2bc313cb4463367e3 100644
--- a/content/renderer/dom_automation_controller.cc
+++ b/content/renderer/dom_automation_controller.cc
@@ -10,6 +10,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/statistics_recorder.h"
#include "base/string_util.h"
+#include "content/common/child_process_messages.h"
#include "content/common/view_messages.h"
using webkit_glue::CppArgumentList;
@@ -33,6 +34,9 @@ DomAutomationController::DomAutomationController()
BindCallback("getHistogram",
base::Bind(&DomAutomationController::GetHistogram,
base::Unretained(this)));
+ BindCallback("getBrowserHistogram",
+ base::Bind(&DomAutomationController::GetBrowserHistogram,
+ base::Unretained(this)));
}
void DomAutomationController::Send(const CppArgumentList& args,
@@ -191,4 +195,23 @@ void DomAutomationController::GetHistogram(const CppArgumentList& args,
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

Powered by Google App Engine
This is Rietveld 408576698