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

Unified Diff: Source/core/dom/IncrementLoadEventDelayCount.cpp

Issue 200923002: Post a microtask to load <img> elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments (retry) 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
Index: Source/core/dom/IncrementLoadEventDelayCount.cpp
diff --git a/Source/core/dom/IncrementLoadEventDelayCount.cpp b/Source/core/dom/IncrementLoadEventDelayCount.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..36fc264d0a6096344e502c43e27f6fb91824205c
--- /dev/null
+++ b/Source/core/dom/IncrementLoadEventDelayCount.cpp
@@ -0,0 +1,29 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/dom/IncrementLoadEventDelayCount.h"
+
+#include "core/dom/Document.h"
+
+namespace WebCore {
+
+IncrementLoadEventDelayCount::IncrementLoadEventDelayCount(Document& document)
+ : m_document(&document)
+{
+ document.incrementLoadEventDelayCount();
+}
+
+IncrementLoadEventDelayCount::~IncrementLoadEventDelayCount()
+{
+ m_document->decrementLoadEventDelayCount();
+}
+
+void IncrementLoadEventDelayCount::documentChanged(Document& newDocument)
+{
+ newDocument.incrementLoadEventDelayCount();
+ m_document->decrementLoadEventDelayCount();
+ m_document = &newDocument;
+}
+}

Powered by Google App Engine
This is Rietveld 408576698