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

Unified Diff: third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp

Issue 2644083005: Use a frame-specific timer task runner for ValidationMessageClientImpl. (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/Source/web/ValidationMessageClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp b/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp
index d2f3f731956c5992c6701e94e75e1a82f4e8ae61..294af072b5f51f7b529614fbedc162655bf87a40 100644
--- a/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ValidationMessageClientImpl.cpp
@@ -26,6 +26,7 @@
#include "web/ValidationMessageClientImpl.h"
#include "core/dom/Element.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/FrameView.h"
#include "platform/HostWindow.h"
#include "public/platform/WebRect.h"
@@ -41,8 +42,7 @@ ValidationMessageClientImpl::ValidationMessageClientImpl(WebViewImpl& webView)
: m_webView(webView),
m_currentAnchor(nullptr),
m_lastPageScaleFactor(1),
- m_finishTime(0),
- m_timer(this, &ValidationMessageClientImpl::checkAnchorStatus) {}
+ m_finishTime(0) {}
ValidationMessageClientImpl* ValidationMessageClientImpl::create(
WebViewImpl& webView) {
@@ -90,13 +90,16 @@ void ValidationMessageClientImpl::showValidationMessage(
(message.length() + subMessage.length()) * secondPerCharacter);
// FIXME: We should invoke checkAnchorStatus actively when layout, scroll,
// or page scale change happen.
- m_timer.startRepeating(statusCheckInterval, BLINK_FROM_HERE);
+ m_timer = WTF::makeUnique<TaskRunnerTimer<ValidationMessageClientImpl>>(
+ TaskRunnerHelper::get(TaskType::UnspecedTimer, &anchor.document()), this,
+ &ValidationMessageClientImpl::checkAnchorStatus);
+ m_timer->startRepeating(statusCheckInterval, BLINK_FROM_HERE);
}
void ValidationMessageClientImpl::hideValidationMessage(const Element& anchor) {
if (!m_currentAnchor || !isValidationMessageVisible(anchor))
return;
- m_timer.stop();
+ m_timer = nullptr;
m_currentAnchor = nullptr;
m_message = String();
m_finishTime = 0;
« no previous file with comments | « third_party/WebKit/Source/web/ValidationMessageClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698