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

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

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
« no previous file with comments | « third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.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/dom/IncrementLoadEventDelayCount.cpp
diff --git a/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp b/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp
index 86b68d16f902219b921c60613365417f06873a91..fc85a1c9a8f6710c3a74ed38490df12fbbb8641a 100644
--- a/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp
+++ b/third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.cpp
@@ -21,12 +21,19 @@ IncrementLoadEventDelayCount::IncrementLoadEventDelayCount(Document& document)
}
IncrementLoadEventDelayCount::~IncrementLoadEventDelayCount() {
- m_document->decrementLoadEventDelayCount();
+ if (m_document)
+ m_document->decrementLoadEventDelayCount();
+}
+
+void IncrementLoadEventDelayCount::clearAndCheckLoadEvent() {
+ m_document->decrementLoadEventDelayCountAndCheckLoadEvent();
+ m_document = nullptr;
}
void IncrementLoadEventDelayCount::documentChanged(Document& newDocument) {
newDocument.incrementLoadEventDelayCount();
- m_document->decrementLoadEventDelayCount();
+ if (m_document)
+ m_document->decrementLoadEventDelayCount();
m_document = &newDocument;
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/IncrementLoadEventDelayCount.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698