Commit 883cddc3 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Convert ViewHostMsg_UserMetricsRecordAction to Mojo

Add RecordUserMetricsAction on the content.mojom.RendererHost interface
to replace the legacy IPC message.

Bug: 1047458
Change-Id: Ie2009fd7a0c0ca58b68e71ba278097f5f1b0b97b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047064
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#740309}
parent 6b0267e8
......@@ -3497,8 +3497,6 @@ bool RenderProcessHostImpl::OnMessageReceived(const IPC::Message& msg) {
if (msg.routing_id() == MSG_ROUTING_CONTROL) {
// Dispatch control messages.
IPC_BEGIN_MESSAGE_MAP(RenderProcessHostImpl, msg)
IPC_MESSAGE_HANDLER(ViewHostMsg_UserMetricsRecordAction,
OnUserMetricsRecordAction)
IPC_MESSAGE_HANDLER(WidgetHostMsg_Close_ACK, OnCloseACK)
// Adding single handlers for your service here is fine, but once your
// service needs more than one handler, please extract them into a new
......@@ -4561,6 +4559,10 @@ void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) {
SetSuddenTerminationAllowed(enabled);
}
void RenderProcessHostImpl::RecordUserMetricsAction(const std::string& action) {
base::RecordComputedAction(action);
}
void RenderProcessHostImpl::UpdateProcessPriorityInputs() {
int32_t new_visible_widgets_count = 0;
unsigned int new_frame_depth = kMaxFrameDepthForPriority;
......@@ -4859,11 +4861,6 @@ void RenderProcessHostImpl::OnProcessLaunchFailed(int error_code) {
ProcessDied(true, &info);
}
void RenderProcessHostImpl::OnUserMetricsRecordAction(
const std::string& action) {
base::RecordComputedAction(action);
}
void RenderProcessHostImpl::OnCloseACK(int closed_widget_route_id) {
SessionStorageHolder* holder =
static_cast<SessionStorageHolder*>(GetUserData(kSessionStorageHolderKey));
......
......@@ -722,6 +722,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
void GetBrowserHistogram(const std::string& name,
BrowserHistogramCallback callback) override;
void SuddenTerminationChanged(bool enabled) override;
void RecordUserMetricsAction(const std::string& action) override;
void BindRouteProvider(
mojo::PendingAssociatedReceiver<mojom::RouteProvider> receiver);
......@@ -769,7 +770,6 @@ class CONTENT_EXPORT RenderProcessHostImpl
client_process) override;
// Control message handlers.
void OnUserMetricsRecordAction(const std::string& action);
void OnCloseACK(int closed_widget_route_id);
// Generates a command line to be used to spawn a renderer and appends the
......
......@@ -18,4 +18,7 @@ interface RendererHost {
// Notify the browser that this render process can or can't be suddenly
// terminated.
SuddenTerminationChanged(bool enabled);
// Sends a string to be recorded by UserMetrics.
RecordUserMetricsAction(string action);
};
......@@ -231,10 +231,6 @@ IPC_MESSAGE_ROUTED1(
ViewHostMsg_NotifyTextAutosizerPageInfoChangedInLocalMainFrame,
blink::WebTextAutosizerPageInfo /* page_info */)
// Send back a string to be recorded by UserMetrics.
IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction,
std::string /* action */)
// Notifies the browser of an event occurring in the media pipeline.
IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogRecords,
std::vector<media::MediaLogRecord> /* records */)
......
......@@ -1067,11 +1067,11 @@ void RenderThreadImpl::RegisterSchemes() {
}
void RenderThreadImpl::RecordAction(const base::UserMetricsAction& action) {
Send(new ViewHostMsg_UserMetricsRecordAction(action.str_));
GetRendererHost()->RecordUserMetricsAction(action.str_);
}
void RenderThreadImpl::RecordComputedAction(const std::string& action) {
Send(new ViewHostMsg_UserMetricsRecordAction(action));
GetRendererHost()->RecordUserMetricsAction(action);
}
void RenderThreadImpl::RegisterExtension(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment