| 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 25 matching lines...) Expand all Loading... |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 class DocumentLifecycle { | 38 class DocumentLifecycle { |
| 39 WTF_MAKE_NONCOPYABLE(DocumentLifecycle); | 39 WTF_MAKE_NONCOPYABLE(DocumentLifecycle); |
| 40 public: | 40 public: |
| 41 enum State { | 41 enum State { |
| 42 Uninitialized, | 42 Uninitialized, |
| 43 Inactive, | 43 Inactive, |
| 44 | 44 |
| 45 // When the document is active, it traverses these states. | 45 // When the document is active, it traverses these states. |
| 46 |
| 46 StyleRecalcPending, | 47 StyleRecalcPending, |
| 47 InStyleRecalc, | 48 InStyleRecalc, |
| 48 Clean, | 49 StyleClean, |
| 50 |
| 51 InPreLayout, |
| 52 InPerformLayout, |
| 53 AfterPerformLayout, |
| 54 LayoutClean, |
| 49 | 55 |
| 50 // Once the document starts shuting down, we cannot return | 56 // Once the document starts shuting down, we cannot return |
| 51 // to the style/layout/rendering states. | 57 // to the style/layout/rendering states. |
| 52 Stopping, | 58 Stopping, |
| 53 Stopped, | 59 Stopped, |
| 54 Disposed, | 60 Disposed, |
| 55 }; | 61 }; |
| 56 | 62 |
| 63 class Scope { |
| 64 WTF_MAKE_NONCOPYABLE(Scope); |
| 65 public: |
| 66 Scope(DocumentLifecycle&, State finalState); |
| 67 ~Scope(); |
| 68 |
| 69 void setFinalState(State finalState) { m_finalState = finalState; } |
| 70 |
| 71 private: |
| 72 DocumentLifecycle& m_lifecycle; |
| 73 State m_finalState; |
| 74 }; |
| 75 |
| 76 class DeprecatedTransition { |
| 77 WTF_MAKE_NONCOPYABLE(DeprecatedTransition); |
| 78 public: |
| 79 DeprecatedTransition(State from, State to); |
| 80 ~DeprecatedTransition(); |
| 81 |
| 82 State from() const { return m_from; } |
| 83 State to() const { return m_to; } |
| 84 |
| 85 private: |
| 86 DeprecatedTransition* m_previous; |
| 87 State m_from; |
| 88 State m_to; |
| 89 }; |
| 90 |
| 57 DocumentLifecycle(); | 91 DocumentLifecycle(); |
| 58 ~DocumentLifecycle(); | 92 ~DocumentLifecycle(); |
| 59 | 93 |
| 60 bool isActive() const { return m_state > Inactive && m_state < Stopping; } | 94 bool isActive() const { return m_state > Inactive && m_state < Stopping; } |
| 61 State state() const { return m_state; } | 95 State state() const { return m_state; } |
| 62 | 96 |
| 63 void advanceTo(State); | 97 void advanceTo(State); |
| 64 void rewindTo(State); | 98 void rewindTo(State); |
| 65 | 99 |
| 66 private: | 100 private: |
| 101 #if !ASSERT_DISABLED |
| 67 bool canAdvanceTo(State) const; | 102 bool canAdvanceTo(State) const; |
| 103 #endif |
| 68 | 104 |
| 69 State m_state; | 105 State m_state; |
| 70 }; | 106 }; |
| 71 | 107 |
| 72 } | 108 } |
| 73 | 109 |
| 74 #endif | 110 #endif |
| OLD | NEW |