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

Unified Diff: Source/core/dom/DocumentLifecycle.h

Issue 25036004: Add a lifecycle state machine for Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/DocumentLifecycle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentLifecycle.h
diff --git a/Source/core/rendering/LayoutIndicator.h b/Source/core/dom/DocumentLifecycle.h
similarity index 79%
copy from Source/core/rendering/LayoutIndicator.h
copy to Source/core/dom/DocumentLifecycle.h
index 6337da949cffa77681e9e88cfbae87eab70d0208..c3f919635e833a43521a5a7e401602671935c4f6 100644
--- a/Source/core/rendering/LayoutIndicator.h
+++ b/Source/core/dom/DocumentLifecycle.h
@@ -28,36 +28,36 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef LayoutIndicator_h
-#define LayoutIndicator_h
+#ifndef DocumentLifecycle_h
+#define DocumentLifecycle_h
-#include "wtf/Assertions.h"
+#include "wtf/Noncopyable.h"
namespace WebCore {
-#ifndef NDEBUG
-
-class LayoutIndicator {
+class DocumentLifecycle {
+ WTF_MAKE_NONCOPYABLE(DocumentLifecycle);
public:
- LayoutIndicator() { ++s_inLayout; }
- ~LayoutIndicator() { --s_inLayout; }
+ enum State {
+ Uninitialized,
+ Inactive,
+ Active,
+ Stopping,
+ Stopped,
+ Disposed,
+ };
- static bool inLayout() { return s_inLayout; }
+ DocumentLifecycle();
+ ~DocumentLifecycle();
-private:
- static size_t s_inLayout;
-};
+ State state() const { return m_state; }
-#else
+ void advanceTo(State);
-class LayoutIndicator {
-public:
- LayoutIndicator() { }
- ~LayoutIndicator() { }
+private:
+ State m_state;
};
-#endif
-
}
-#endif // LayoutIndicator_h
+#endif
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/DocumentLifecycle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698