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

Unified Diff: third_party/WebKit/Source/core/html/HTMLStyleElement.cpp

Issue 2269043002: Reland of Remove EventSender from HTMLStyleElement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove t.step() Created 4 years, 1 month 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/core/html/HTMLStyleElement.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/core/html/HTMLStyleElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
index a62e1e9c417e23705102dd17553a32bf94a60870..d3b1f7f60e7d91a49bc874ca05ee8f9b2a3de1bc 100644
--- a/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLStyleElement.cpp
@@ -27,20 +27,14 @@
#include "core/css/MediaList.h"
#include "core/dom/Document.h"
#include "core/dom/StyleEngine.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/events/Event.h"
-#include "core/events/EventSender.h"
namespace blink {
using namespace HTMLNames;
-static StyleEventSender& styleLoadEventSender() {
- DEFINE_STATIC_LOCAL(StyleEventSender, sharedLoadEventSender,
- (StyleEventSender::create(EventTypeNames::load)));
- return sharedLoadEventSender;
-}
-
inline HTMLStyleElement::HTMLStyleElement(Document& document,
bool createdByParser)
: HTMLElement(styleTag, document),
@@ -113,12 +107,8 @@ const AtomicString& HTMLStyleElement::type() const {
return getAttribute(typeAttr);
}
-void HTMLStyleElement::dispatchPendingLoadEvents() {
- styleLoadEventSender().dispatchPendingEvents();
-}
-
-void HTMLStyleElement::dispatchPendingEvent(StyleEventSender* eventSender) {
- DCHECK_EQ(eventSender, &styleLoadEventSender());
+void HTMLStyleElement::dispatchPendingEvent(
+ std::unique_ptr<IncrementLoadEventDelayCount>) {
dispatchEvent(Event::create(m_loadedSheet ? EventTypeNames::load
: EventTypeNames::error));
}
@@ -129,7 +119,12 @@ void HTMLStyleElement::notifyLoadedSheetAndAllCriticalSubresources(
if (m_firedLoad && isLoadEvent)
return;
m_loadedSheet = isLoadEvent;
- styleLoadEventSender().dispatchEventSoon(this);
+ TaskRunnerHelper::get(TaskType::DOMManipulation, &document())
+ ->postTask(
+ BLINK_FROM_HERE,
+ WTF::bind(&HTMLStyleElement::dispatchPendingEvent,
+ wrapPersistent(this),
+ passed(IncrementLoadEventDelayCount::create(document()))));
m_firedLoad = true;
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLStyleElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698