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

Unified Diff: Source/core/html/HTMLFormElement.cpp

Issue 255673003: Use GenericEventQueue class in HTMLFormElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormElement.cpp
diff --git a/Source/core/html/HTMLFormElement.cpp b/Source/core/html/HTMLFormElement.cpp
index 089fde6522475add928e10b5772f182147afaf8d..56b0661d1725eb53ac8e65d2b7d241ab7e24342a 100644
--- a/Source/core/html/HTMLFormElement.cpp
+++ b/Source/core/html/HTMLFormElement.cpp
@@ -36,6 +36,7 @@
#include "core/dom/IdTargetObserverRegistry.h"
#include "core/events/AutocompleteErrorEvent.h"
#include "core/events/Event.h"
+#include "core/events/GenericEventQueue.h"
#include "core/events/ScopedEventQueue.h"
#include "core/html/HTMLCollection.h"
#include "core/html/HTMLDialogElement.h"
@@ -69,7 +70,7 @@ HTMLFormElement::HTMLFormElement(Document& document)
, m_wasUserSubmitted(false)
, m_isInResetFunction(false)
, m_wasDemoted(false)
- , m_requestAutocompleteTimer(this, &HTMLFormElement::requestAutocompleteTimerFired)
+ , m_pendingAutocompleteEventsQueue(GenericEventQueue::create(this))
{
ScriptWrappable::init(this);
}
@@ -450,19 +451,7 @@ void HTMLFormElement::finishRequestAutocomplete(AutocompleteResult result)
ASSERT_NOT_REACHED();
event->setTarget(this);
- m_pendingAutocompleteEvents.append(event.release());
-
- // Dispatch events later as this API is meant to work asynchronously in all situations and implementations.
- if (!m_requestAutocompleteTimer.isActive())
- m_requestAutocompleteTimer.startOneShot(0, FROM_HERE);
-}
-
-void HTMLFormElement::requestAutocompleteTimerFired(Timer<HTMLFormElement>*)
-{
- WillBeHeapVector<RefPtrWillBeMember<Event> > pendingEvents;
- m_pendingAutocompleteEvents.swap(pendingEvents);
- for (size_t i = 0; i < pendingEvents.size(); ++i)
- dispatchEvent(pendingEvents[i].release());
+ m_pendingAutocompleteEventsQueue->enqueueEvent(event.release());
}
void HTMLFormElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
« no previous file with comments | « Source/core/html/HTMLFormElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698