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

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

Issue 1304043002: Make classes and structures in core/dom fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/DocumentFullscreen.h ('k') | Source/core/dom/DocumentOrderedMap.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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef DocumentLifecycle_h 31 #ifndef DocumentLifecycle_h
32 #define DocumentLifecycle_h 32 #define DocumentLifecycle_h
33 33
34 #include "core/CoreExport.h" 34 #include "core/CoreExport.h"
35 #include "wtf/Allocator.h"
35 #include "wtf/Assertions.h" 36 #include "wtf/Assertions.h"
36 #include "wtf/Noncopyable.h" 37 #include "wtf/Noncopyable.h"
37 38
38 namespace blink { 39 namespace blink {
39 40
40 class CORE_EXPORT DocumentLifecycle { 41 class CORE_EXPORT DocumentLifecycle {
42 DISALLOW_ALLOCATION();
41 WTF_MAKE_NONCOPYABLE(DocumentLifecycle); 43 WTF_MAKE_NONCOPYABLE(DocumentLifecycle);
42 public: 44 public:
43 enum State { 45 enum State {
44 Uninitialized, 46 Uninitialized,
45 Inactive, 47 Inactive,
46 48
47 // When the document is active, it traverses these states. 49 // When the document is active, it traverses these states.
48 50
49 VisualUpdatePending, 51 VisualUpdatePending,
50 52
(...skipping 21 matching lines...) Expand all
72 CompositingForSlimmingPaintV2Clean, 74 CompositingForSlimmingPaintV2Clean,
73 75
74 // Once the document starts shuting down, we cannot return 76 // Once the document starts shuting down, we cannot return
75 // to the style/layout/compositing states. 77 // to the style/layout/compositing states.
76 Stopping, 78 Stopping,
77 Stopped, 79 Stopped,
78 Disposed, 80 Disposed,
79 }; 81 };
80 82
81 class Scope { 83 class Scope {
84 STACK_ALLOCATED();
82 WTF_MAKE_NONCOPYABLE(Scope); 85 WTF_MAKE_NONCOPYABLE(Scope);
83 public: 86 public:
84 Scope(DocumentLifecycle&, State finalState); 87 Scope(DocumentLifecycle&, State finalState);
85 ~Scope(); 88 ~Scope();
86 89
87 private: 90 private:
88 DocumentLifecycle& m_lifecycle; 91 DocumentLifecycle& m_lifecycle;
89 State m_finalState; 92 State m_finalState;
90 }; 93 };
91 94
92 class DeprecatedTransition { 95 class DeprecatedTransition {
96 DISALLOW_ALLOCATION();
93 WTF_MAKE_NONCOPYABLE(DeprecatedTransition); 97 WTF_MAKE_NONCOPYABLE(DeprecatedTransition);
94 public: 98 public:
95 DeprecatedTransition(State from, State to); 99 DeprecatedTransition(State from, State to);
96 ~DeprecatedTransition(); 100 ~DeprecatedTransition();
97 101
98 State from() const { return m_from; } 102 State from() const { return m_from; }
99 State to() const { return m_to; } 103 State to() const { return m_to; }
100 104
101 private: 105 private:
102 DeprecatedTransition* m_previous; 106 DeprecatedTransition* m_previous;
103 State m_from; 107 State m_from;
104 State m_to; 108 State m_to;
105 }; 109 };
106 110
107 class DetachScope { 111 class DetachScope {
112 STACK_ALLOCATED();
108 WTF_MAKE_NONCOPYABLE(DetachScope); 113 WTF_MAKE_NONCOPYABLE(DetachScope);
109 public: 114 public:
110 explicit DetachScope(DocumentLifecycle& documentLifecycle) 115 explicit DetachScope(DocumentLifecycle& documentLifecycle)
111 : m_documentLifecycle(documentLifecycle) 116 : m_documentLifecycle(documentLifecycle)
112 { 117 {
113 m_documentLifecycle.incrementDetachCount(); 118 m_documentLifecycle.incrementDetachCount();
114 } 119 }
115 120
116 ~DetachScope() 121 ~DetachScope()
117 { 122 {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 return m_state != InPerformLayout 201 return m_state != InPerformLayout
197 && m_state != InCompositingUpdate 202 && m_state != InCompositingUpdate
198 && m_state != InPaintInvalidation 203 && m_state != InPaintInvalidation
199 && m_state != InPaintForSlimmingPaintV2 204 && m_state != InPaintForSlimmingPaintV2
200 && m_state != InCompositingForSlimmingPaintV2; 205 && m_state != InCompositingForSlimmingPaintV2;
201 } 206 }
202 207
203 } // namespace blink 208 } // namespace blink
204 209
205 #endif 210 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DocumentFullscreen.h ('k') | Source/core/dom/DocumentOrderedMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698