Index: third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
index e6f33b1706fda173d0eed478d76ae41fc286d48b..1c82ee9cdadb69e0f4579ec6b9489a04da39d7af 100644 |
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellCheckRequester.cpp |
@@ -34,6 +34,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Settings.h" |
#include "core/html/TextControlElement.h" |
+#include "platform/Histogram.h" |
#include "platform/text/TextCheckerClient.h" |
namespace blink { |
@@ -125,6 +126,7 @@ SpellCheckRequester::SpellCheckRequester(LocalFrame& frame) |
: frame_(&frame), |
last_request_sequence_(0), |
last_processed_sequence_(0), |
+ last_request_time_(0.0), |
timer_to_process_queued_request_( |
TaskRunnerHelper::Get(TaskType::kUnspecedTimer, &frame), |
this, |
@@ -154,6 +156,17 @@ void SpellCheckRequester::RequestCheckingFor(const EphemeralRange& range, |
if (!request) |
return; |
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, |
+ spell_checker_request_interval_histogram, |
+ ("WebCore.SpellChecker.RequestInterval", 0, 10000, 50)); |
+ const double current_request_time = MonotonicallyIncreasingTime(); |
+ if (request_num == 0 && last_request_time_ > 0) { |
+ const double interval_ms = |
+ (current_request_time - last_request_time_) * 1000.0; |
+ spell_checker_request_interval_histogram.Count(interval_ms); |
+ } |
+ last_request_time_ = current_request_time; |
+ |
DCHECK_EQ(request->Data().Sequence(), kUnrequestedTextCheckingSequence); |
int sequence = ++last_request_sequence_; |
if (sequence == kUnrequestedTextCheckingSequence) |