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

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

Issue 200923002: Post a microtask to load <img> elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix last test failure Created 6 years, 7 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/core.gypi ('k') | Source/core/dom/IncrementLoadEventDelayCount.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/IncrementLoadEventDelayCount.h
diff --git a/Source/core/dom/IncrementLoadEventDelayCount.h b/Source/core/dom/IncrementLoadEventDelayCount.h
new file mode 100644
index 0000000000000000000000000000000000000000..d588de22a6181a920dbe918b2c8f59de97c1ef8c
--- /dev/null
+++ b/Source/core/dom/IncrementLoadEventDelayCount.h
@@ -0,0 +1,32 @@
+// 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.
+
+#ifndef IncrementLoadEventDelayCount_h
+#define IncrementLoadEventDelayCount_h
+
+#include "wtf/Noncopyable.h"
+#include "wtf/RefPtr.h"
+
+namespace WebCore {
+
+class Document;
+
+// A helper class that will increment a document's loadEventDelayCount on
+// contruction and decrement it on destruction (semantics similar to RefPtr).
+class IncrementLoadEventDelayCount {
+ WTF_MAKE_NONCOPYABLE(IncrementLoadEventDelayCount);
+
+public:
+ IncrementLoadEventDelayCount(Document&);
+ ~IncrementLoadEventDelayCount();
+
+ // Increments the new document's count and decrements the old count.
+ void documentChanged(Document& newDocument);
+
+private:
+ RefPtr<Document> m_document;
+};
+}
+
+#endif
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/IncrementLoadEventDelayCount.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698