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

Side by Side Diff: third_party/WebKit/Source/core/dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h

Issue 2369853002: HTML parser: implementing throw-on-dynamic-markup-insertion counter (Closed)
Patch Set: copyright comment update Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ThrowOnDynamicMarkupInsertionCountIncrementer_h
6 #define ThrowOnDynamicMarkupInsertionCountIncrementer_h
7
8 #include "core/dom/Document.h"
9 #include "wtf/Allocator.h"
10
11 namespace blink {
12
13 class ThrowOnDynamicMarkupInsertionCountIncrementer {
14 STACK_ALLOCATED();
15 WTF_MAKE_NONCOPYABLE(ThrowOnDynamicMarkupInsertionCountIncrementer);
16 public:
17 explicit ThrowOnDynamicMarkupInsertionCountIncrementer(Document* document)
18 : m_count(document ? &document->m_throwOnDynamicMarkupInsertionCount : 0 )
19 {
20 if (!m_count)
21 return;
22 ++(*m_count);
23 }
24
25 ~ThrowOnDynamicMarkupInsertionCountIncrementer()
26 {
27 if (!m_count)
28 return;
29 --(*m_count);
30 }
31
32 private:
33 unsigned* m_count;
34 };
35
36 } // namespace blink
37
38 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698