summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_ipc_server.cc
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 20:29:36 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-24 20:29:36 +0000
commita30798372912744d643c58ddc61c6c7eabab2e51 (patch)
treee5768ac7ce0302b12780ba515fba52fe3ff4abae /chrome/service/service_ipc_server.cc
parent786d75cb93ca798afa23e1f5c548e102b7ede6d5 (diff)
downloadchromium_src-a30798372912744d643c58ddc61c6c7eabab2e51.zip
chromium_src-a30798372912744d643c58ddc61c6c7eabab2e51.tar.gz
chromium_src-a30798372912744d643c58ddc61c6c7eabab2e51.tar.bz2
Collect metrics data from service process.
MetricsService in browser process sends request for histograms to service process if service is running. Request is called in parallel with requests to other browser child processes. Service process still loses all data collected after browser process is gone. BUG=305019 Review URL: https://codereview.chromium.org/26779002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230796 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_ipc_server.cc')
-rw-r--r--chrome/service/service_ipc_server.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/service/service_ipc_server.cc b/chrome/service/service_ipc_server.cc
index f05bf4b..b700c57 100644
--- a/chrome/service/service_ipc_server.cc
+++ b/chrome/service/service_ipc_server.cc
@@ -4,6 +4,7 @@
#include "chrome/service/service_ipc_server.h"
+#include "base/metrics/histogram_delta_serialization.h"
#include "chrome/common/service_messages.h"
#include "chrome/service/cloud_print/cloud_print_proxy.h"
#include "chrome/service/service_process.h"
@@ -98,6 +99,7 @@ bool ServiceIPCServer::OnMessageReceived(const IPC::Message& msg) {
OnDisableCloudPrintProxy)
IPC_MESSAGE_HANDLER(ServiceMsg_GetCloudPrintProxyInfo,
OnGetCloudPrintProxyInfo)
+ IPC_MESSAGE_HANDLER(ServiceMsg_GetHistograms, OnGetHistograms)
IPC_MESSAGE_HANDLER(ServiceMsg_Shutdown, OnShutdown);
IPC_MESSAGE_HANDLER(ServiceMsg_UpdateAvailable, OnUpdateAvailable);
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -120,6 +122,16 @@ void ServiceIPCServer::OnGetCloudPrintProxyInfo() {
channel_->Send(new ServiceHostMsg_CloudPrintProxy_Info(info));
}
+void ServiceIPCServer::OnGetHistograms() {
+ if (!histogram_delta_serializer_) {
+ histogram_delta_serializer_.reset(
+ new base::HistogramDeltaSerialization("ServiceProcess"));
+ }
+ std::vector<std::string> deltas;
+ histogram_delta_serializer_->PrepareAndSerializeDeltas(&deltas);
+ channel_->Send(new ServiceHostMsg_Histograms(deltas));
+}
+
void ServiceIPCServer::OnDisableCloudPrintProxy() {
// User disabled CloudPrint proxy explicitly. Delete printers
// registered from this proxy and disable proxy.