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

Side by Side Diff: Source/core/dom/ChildListMutationScope.h

Issue 633573004: Replace FINAL and OVERRIDE with their C++11 counterparts in Source/core/dom (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/core/dom/CharacterData.h ('k') | Source/core/dom/ChildNodeList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 namespace blink { 42 namespace blink {
43 43
44 class MutationObserverInterestGroup; 44 class MutationObserverInterestGroup;
45 45
46 // ChildListMutationAccumulator is not meant to be used directly; ChildListMutat ionScope is the public interface. 46 // ChildListMutationAccumulator is not meant to be used directly; ChildListMutat ionScope is the public interface.
47 // 47 //
48 // One ChildListMutationAccumulator for a given Node is shared between all the 48 // One ChildListMutationAccumulator for a given Node is shared between all the
49 // active ChildListMutationScopes for that Node. Once the last ChildListMutation Scope 49 // active ChildListMutationScopes for that Node. Once the last ChildListMutation Scope
50 // is destructed the accumulator enqueues a mutation record for the recorded 50 // is destructed the accumulator enqueues a mutation record for the recorded
51 // mutations and the accumulator can be garbage collected. 51 // mutations and the accumulator can be garbage collected.
52 class ChildListMutationAccumulator FINAL : public RefCountedWillBeGarbageCollect ed<ChildListMutationAccumulator> { 52 class ChildListMutationAccumulator final : public RefCountedWillBeGarbageCollect ed<ChildListMutationAccumulator> {
53 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ChildListMutationAccumulator); 53 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ChildListMutationAccumulator);
54 public: 54 public:
55 static PassRefPtrWillBeRawPtr<ChildListMutationAccumulator> getOrCreate(Node &); 55 static PassRefPtrWillBeRawPtr<ChildListMutationAccumulator> getOrCreate(Node &);
56 56
57 void childAdded(PassRefPtrWillBeRawPtr<Node>); 57 void childAdded(PassRefPtrWillBeRawPtr<Node>);
58 void willRemoveChild(PassRefPtrWillBeRawPtr<Node>); 58 void willRemoveChild(PassRefPtrWillBeRawPtr<Node>);
59 59
60 bool hasObservers() const { return m_observers; } 60 bool hasObservers() const { return m_observers; }
61 61
62 // Register and unregister mutation scopes that are using this mutation 62 // Register and unregister mutation scopes that are using this mutation
(...skipping 17 matching lines...) Expand all
80 WillBeHeapVector<RefPtrWillBeMember<Node> > m_addedNodes; 80 WillBeHeapVector<RefPtrWillBeMember<Node> > m_addedNodes;
81 RefPtrWillBeMember<Node> m_previousSibling; 81 RefPtrWillBeMember<Node> m_previousSibling;
82 RefPtrWillBeMember<Node> m_nextSibling; 82 RefPtrWillBeMember<Node> m_nextSibling;
83 RawPtrWillBeMember<Node> m_lastAdded; 83 RawPtrWillBeMember<Node> m_lastAdded;
84 84
85 OwnPtrWillBeMember<MutationObserverInterestGroup> m_observers; 85 OwnPtrWillBeMember<MutationObserverInterestGroup> m_observers;
86 86
87 unsigned m_mutationScopes; 87 unsigned m_mutationScopes;
88 }; 88 };
89 89
90 class ChildListMutationScope FINAL { 90 class ChildListMutationScope final {
91 WTF_MAKE_NONCOPYABLE(ChildListMutationScope); 91 WTF_MAKE_NONCOPYABLE(ChildListMutationScope);
92 STACK_ALLOCATED(); 92 STACK_ALLOCATED();
93 public: 93 public:
94 explicit ChildListMutationScope(Node& target) 94 explicit ChildListMutationScope(Node& target)
95 { 95 {
96 if (target.document().hasMutationObserversOfType(MutationObserver::Child List)) { 96 if (target.document().hasMutationObserversOfType(MutationObserver::Child List)) {
97 m_accumulator = ChildListMutationAccumulator::getOrCreate(target); 97 m_accumulator = ChildListMutationAccumulator::getOrCreate(target);
98 // Register another user of the accumulator. 98 // Register another user of the accumulator.
99 m_accumulator->enterMutationScope(); 99 m_accumulator->enterMutationScope();
100 } 100 }
(...skipping 20 matching lines...) Expand all
121 m_accumulator->willRemoveChild(&child); 121 m_accumulator->willRemoveChild(&child);
122 } 122 }
123 123
124 private: 124 private:
125 RefPtrWillBeMember<ChildListMutationAccumulator> m_accumulator; 125 RefPtrWillBeMember<ChildListMutationAccumulator> m_accumulator;
126 }; 126 };
127 127
128 } // namespace blink 128 } // namespace blink
129 129
130 #endif // ChildListMutationScope_h 130 #endif // ChildListMutationScope_h
OLDNEW
« no previous file with comments | « Source/core/dom/CharacterData.h ('k') | Source/core/dom/ChildNodeList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698