| 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
|
|
|