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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 DocumentLifecycle::DocumentLifecycle() | 64 DocumentLifecycle::DocumentLifecycle() |
65 : m_state(Uninitialized) | 65 : m_state(Uninitialized) |
66 , m_detachCount(0) | 66 , m_detachCount(0) |
67 { | 67 { |
68 } | 68 } |
69 | 69 |
70 DocumentLifecycle::~DocumentLifecycle() | 70 DocumentLifecycle::~DocumentLifecycle() |
71 { | 71 { |
72 } | 72 } |
73 | 73 |
74 #if !ASSERT_DISABLED | 74 #if ASSERT_ENABLED |
75 | 75 |
76 bool DocumentLifecycle::canAdvanceTo(State state) const | 76 bool DocumentLifecycle::canAdvanceTo(State state) const |
77 { | 77 { |
78 if (state > m_state) | 78 if (state > m_state) |
79 return true; | 79 return true; |
80 if (m_state == Disposed) { | 80 if (m_state == Disposed) { |
81 // FIXME: We can dispose a document multiple times. This seems wrong. | 81 // FIXME: We can dispose a document multiple times. This seems wrong. |
82 // See https://code.google.com/p/chromium/issues/detail?id=301668. | 82 // See https://code.google.com/p/chromium/issues/detail?id=301668. |
83 return state == Disposed; | 83 return state == Disposed; |
84 } | 84 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 void DocumentLifecycle::ensureStateAtMost(State state) | 158 void DocumentLifecycle::ensureStateAtMost(State state) |
159 { | 159 { |
160 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); | 160 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); |
161 if (m_state <= state) | 161 if (m_state <= state) |
162 return; | 162 return; |
163 ASSERT(canRewindTo(state)); | 163 ASSERT(canRewindTo(state)); |
164 m_state = state; | 164 m_state = state; |
165 } | 165 } |
166 | 166 |
167 } | 167 } |
OLD | NEW |