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

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

Issue 2605383002: Introduce IncrementLoadEventDelayCount::clearAndCheckLoadEvent() (Closed)
Patch Set: Rebase Created 3 years, 11 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: third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h
diff --git a/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h b/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h
index c1256148b5eb9e3d1e7b562b6e62d12cf34f921a..23f9eb03830067a7451faa788016617e577a5a6c 100644
--- a/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h
+++ b/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h
@@ -24,6 +24,13 @@ class IncrementLoadEventDelayCount {
static std::unique_ptr<IncrementLoadEventDelayCount> create(Document&);
~IncrementLoadEventDelayCount();
+ // Decrements the loadEventDelayCount and checks load event synchronously,
+ // and thus can cause synchronous Document load event/JavaScript execution.
+ // Call this only when it is safe, e.g. at the top of an async task.
+ // After calling this, |this| no longer blocks document's load event and
+ // will not decrement loadEventDelayCount at destruction.
+ void clearAndCheckLoadEvent();
+
// Increments the new document's count and decrements the old count.
void documentChanged(Document& newDocument);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698