Commit 4995be9c authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

[blink] Remove usage of blink::SparseHistogram in editing code.

Replace both uses with base::UmaHistogramSparse, since neither metric is
recorded in a hot code path.

Bug: 1047547
Change-Id: I7237163b9918ef933756627f0191e756b8304f06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2499804
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820984}
parent 6bf7e04f
......@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/core/dom/document.h"
#include "base/auto_reset.h"
#include "base/metrics/histogram_functions.h"
#include "third_party/blink/renderer/core/dom/events/scoped_event_queue.h"
#include "third_party/blink/renderer/core/editing/commands/editing_commands_utilities.h"
#include "third_party/blink/renderer/core/editing/commands/editor_command.h"
......@@ -40,9 +41,7 @@
#include "third_party/blink/renderer/core/html/forms/text_control_element.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
namespace blink {
......@@ -95,9 +94,8 @@ bool Document::execCommand(const String& command_name,
TidyUpHTMLStructure(*this);
const EditorCommand editor_command = GetCommand(this, command_name);
DEFINE_STATIC_LOCAL(SparseHistogram, editor_command_histogram,
("WebCore.Document.execCommand"));
editor_command_histogram.Sample(editor_command.IdForHistogram());
base::UmaHistogramSparse("WebCore.Document.execCommand",
editor_command.IdForHistogram());
return editor_command.Execute(value);
}
......
......@@ -27,6 +27,7 @@
#include "third_party/blink/renderer/core/editing/commands/editor_command.h"
#include "base/metrics/histogram_functions.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/core/css/css_property_names.h"
......@@ -71,7 +72,6 @@
#include "third_party/blink/renderer/core/scroll/scrollbar.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
......@@ -1963,9 +1963,8 @@ bool EditorCommand::Execute(const String& parameter,
GetFrame().GetDocument()->UpdateStyleAndLayout(
DocumentUpdateReason::kEditing);
DEFINE_STATIC_LOCAL(SparseHistogram, command_histogram,
("WebCore.Editing.Commands"));
command_histogram.Sample(static_cast<int>(command_->command_type));
base::UmaHistogramSparse("WebCore.Editing.Commands",
static_cast<int>(command_->command_type));
return command_->execute(*frame_, triggering_event, source_, parameter);
}
......
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