mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
34 lines
938 B
C++
34 lines
938 B
C++
// 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.
|
|
|
|
#include "sky/engine/core/dom/IncrementLoadEventDelayCount.h"
|
|
|
|
#include "sky/engine/core/dom/Document.h"
|
|
|
|
namespace blink {
|
|
|
|
PassOwnPtr<IncrementLoadEventDelayCount> IncrementLoadEventDelayCount::create(Document& document)
|
|
{
|
|
return adoptPtr(new IncrementLoadEventDelayCount(document));
|
|
}
|
|
|
|
IncrementLoadEventDelayCount::IncrementLoadEventDelayCount(Document& document)
|
|
: m_document(&document)
|
|
{
|
|
document.incrementLoadEventDelayCount();
|
|
}
|
|
|
|
IncrementLoadEventDelayCount::~IncrementLoadEventDelayCount()
|
|
{
|
|
m_document->decrementLoadEventDelayCount();
|
|
}
|
|
|
|
void IncrementLoadEventDelayCount::documentChanged(Document& newDocument)
|
|
{
|
|
newDocument.incrementLoadEventDelayCount();
|
|
m_document->decrementLoadEventDelayCount();
|
|
m_document = &newDocument;
|
|
}
|
|
}
|