| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |