| Index: third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h
|
| diff --git a/third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h b/third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7d9df82f1c1b443c30cf747c2d969089c42a6440
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2016 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 ThrowOnDynamicMarkupInsertionCountIncrementer_h
|
| +#define ThrowOnDynamicMarkupInsertionCountIncrementer_h
|
| +
|
| +#include "core/dom/Document.h"
|
| +#include "wtf/Allocator.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class ThrowOnDynamicMarkupInsertionCountIncrementer {
|
| + STACK_ALLOCATED();
|
| + WTF_MAKE_NONCOPYABLE(ThrowOnDynamicMarkupInsertionCountIncrementer);
|
| +public:
|
| + explicit ThrowOnDynamicMarkupInsertionCountIncrementer(Document* document)
|
| + : m_count(document ? &document->m_throwOnDynamicMarkupInsertionCount : 0)
|
| + {
|
| + if (!m_count)
|
| + return;
|
| + ++(*m_count);
|
| + }
|
| +
|
| + ~ThrowOnDynamicMarkupInsertionCountIncrementer()
|
| + {
|
| + if (!m_count)
|
| + return;
|
| + --(*m_count);
|
| + }
|
| +
|
| +private:
|
| + unsigned* m_count;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif
|
|
|