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

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: 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.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 {
abarth-chromium 2014/05/03 01:22:31 It would be nice to deploy this class in more plac
cbiesinger 2014/05/05 22:39:30 Yep :) The plugin element could easily use it.
+ 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

Powered by Google App Engine
This is Rietveld 408576698