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

Unified Diff: extensions/renderer/runtime_custom_bindings.cc

Issue 2316093004: [Extensions] Add metrics for renderer sync IPCs performance (Closed)
Patch Set: Mark's Created 4 years, 3 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
« no previous file with comments | « extensions/renderer/i18n_custom_bindings.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/runtime_custom_bindings.cc
diff --git a/extensions/renderer/runtime_custom_bindings.cc b/extensions/renderer/runtime_custom_bindings.cc
index 0d0d0df3f4a398cb4416cf2cb53d2592e0eb12d6..ea502a7014642dab48c82e1b8708e3483c7243e1 100644
--- a/extensions/renderer/runtime_custom_bindings.cc
+++ b/extensions/renderer/runtime_custom_bindings.cc
@@ -9,6 +9,7 @@
#include <memory>
#include "base/bind.h"
+#include "base/metrics/histogram_macros.h"
#include "base/values.h"
#include "content/public/child/v8_value_converter.h"
#include "content/public/renderer/render_frame.h"
@@ -66,10 +67,14 @@ void RuntimeCustomBindings::OpenChannelToExtension(
bool include_tls_channel_id =
args.Length() > 2 ? args[2]->BooleanValue() : false;
int port_id = -1;
- // TODO(devlin): This file is littered with sync IPCs. Yuck.
- renderframe->Send(new ExtensionHostMsg_OpenChannelToExtension(
- renderframe->GetRoutingID(), info, channel_name, include_tls_channel_id,
- &port_id));
+ {
+ SCOPED_UMA_HISTOGRAM_TIMER(
+ "Extensions.Messaging.GetPortIdSyncTime.Extension");
+ // TODO(devlin): This file is littered with sync IPCs. Yuck.
+ renderframe->Send(new ExtensionHostMsg_OpenChannelToExtension(
+ renderframe->GetRoutingID(), info, channel_name, include_tls_channel_id,
+ &port_id));
+ }
args.GetReturnValue().Set(static_cast<int32_t>(port_id));
}
@@ -90,8 +95,12 @@ void RuntimeCustomBindings::OpenChannelToNativeApp(
std::string native_app_name = *v8::String::Utf8Value(args[0]);
int port_id = -1;
- render_frame->Send(new ExtensionHostMsg_OpenChannelToNativeApp(
- render_frame->GetRoutingID(), native_app_name, &port_id));
+ {
+ SCOPED_UMA_HISTOGRAM_TIMER(
+ "Extensions.Messaging.GetPortIdSyncTime.NativeApp");
+ render_frame->Send(new ExtensionHostMsg_OpenChannelToNativeApp(
+ render_frame->GetRoutingID(), native_app_name, &port_id));
+ }
args.GetReturnValue().Set(static_cast<int32_t>(port_id));
}
« no previous file with comments | « extensions/renderer/i18n_custom_bindings.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698