| 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 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/Noncopyable.h" | 34 #include "wtf/Noncopyable.h" |
| 35 | 35 |
| 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 Active, | 44 |
| 45 // When the document is active, it traverses these states. |
| 46 Clean, |
| 47 InStyleRecalc, |
| 48 |
| 49 // Once the document starts shuting down, we cannot return |
| 50 // to the style/layout/rendering states. |
| 45 Stopping, | 51 Stopping, |
| 46 Stopped, | 52 Stopped, |
| 47 Disposed, | 53 Disposed, |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 DocumentLifecycle(); | 56 DocumentLifecycle(); |
| 51 ~DocumentLifecycle(); | 57 ~DocumentLifecycle(); |
| 52 | 58 |
| 59 bool isActive() const { return m_state > Inactive && m_state < Stopping; } |
| 53 State state() const { return m_state; } | 60 State state() const { return m_state; } |
| 54 | 61 |
| 55 void advanceTo(State); | 62 void advanceTo(State); |
| 56 | 63 |
| 57 private: | 64 private: |
| 58 State m_state; | 65 State m_state; |
| 59 }; | 66 }; |
| 60 | 67 |
| 61 } | 68 } |
| 62 | 69 |
| 63 #endif | 70 #endif |
| OLD | NEW |