Commit 71ac6f83 authored by Ehsan Karamad's avatar Ehsan Karamad Committed by Commit Bot

[ MimeHandlerView ] Add a new UMA bucket

This CL adds one more bucket to MimeHandlerViewUMATypes which counts the usage
of internal calls (from C++) to postMessage (used for printing).

TBR=wjmaclean@chromium.org

Bug: 659750
Change-Id: I08c5194012c97f0a603dd338e454b201dfafd1da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1576204Reviewed-by: default avatarEhsan Karamad <ekaramad@chromium.org>
Commit-Queue: Ehsan Karamad <ekaramad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652748}
parent 6ce33412
...@@ -36,7 +36,10 @@ class MimeHandlerViewUMATypes { ...@@ -36,7 +36,10 @@ class MimeHandlerViewUMATypes {
// For recording postMessage to embedded MimeHandlerViews (e.g., MHVs not // For recording postMessage to embedded MimeHandlerViews (e.g., MHVs not
// created due to navigations to the resource). // created due to navigations to the resource).
kPostMessageToEmbeddedMimeHandlerView = 10, kPostMessageToEmbeddedMimeHandlerView = 10,
kMaxValue = kPostMessageToEmbeddedMimeHandlerView, // For recording postMessage from internal APIs (includes 'print' messages
// full page MimeHandlerView).
kPostMessageInternal = 11,
kMaxValue = kPostMessageInternal,
}; };
private: private:
......
...@@ -276,6 +276,7 @@ void MimeHandlerViewContainerBase::PostMessageFromValue( ...@@ -276,6 +276,7 @@ void MimeHandlerViewContainerBase::PostMessageFromValue(
v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::HandleScope handle_scope(isolate); v8::HandleScope handle_scope(isolate);
v8::Context::Scope context_scope(frame->MainWorldScriptContext()); v8::Context::Scope context_scope(frame->MainWorldScriptContext());
RecordInteraction(UMAType::kPostMessageInternal);
base::AutoReset<bool> avoid_recording_internal_messages( base::AutoReset<bool> avoid_recording_internal_messages(
&should_report_internal_messages_, false); &should_report_internal_messages_, false);
PostJavaScriptMessage(isolate, PostJavaScriptMessage(isolate,
......
...@@ -37507,6 +37507,9 @@ Called by update_use_counter_css.py.--> ...@@ -37507,6 +37507,9 @@ Called by update_use_counter_css.py.-->
Any message posted to a MimeHandlerViewContainerBase that is embedded; i.e., Any message posted to a MimeHandlerViewContainerBase that is embedded; i.e.,
is not created as a result of navigating a frame to the resource. is not created as a result of navigating a frame to the resource.
</int> </int>
<int value="11" label="PostMessageInternal">
Emitted when an internal postMesasge to 'print' is issued from C++ code.
</int>
</enum> </enum>
<enum name="MissingStartType"> <enum name="MissingStartType">
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