| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // We can stop from anywhere. | 93 // We can stop from anywhere. |
| 94 if (nextState == Stopping) | 94 if (nextState == Stopping) |
| 95 return true; | 95 return true; |
| 96 | 96 |
| 97 switch (m_state) { | 97 switch (m_state) { |
| 98 case Uninitialized: | 98 case Uninitialized: |
| 99 return nextState == Inactive; | 99 return nextState == Inactive; |
| 100 case Inactive: | 100 case Inactive: |
| 101 if (nextState == StyleClean) | 101 if (nextState == StyleClean) |
| 102 return true; | 102 return true; |
| 103 if (nextState == Disposed) | |
| 104 return true; | |
| 105 break; | 103 break; |
| 106 case VisualUpdatePending: | 104 case VisualUpdatePending: |
| 107 if (nextState == InPreLayout) | 105 if (nextState == InPreLayout) |
| 108 return true; | 106 return true; |
| 109 if (nextState == InStyleRecalc) | 107 if (nextState == InStyleRecalc) |
| 110 return true; | 108 return true; |
| 111 if (nextState == InPerformLayout) | 109 if (nextState == InPerformLayout) |
| 112 return true; | 110 return true; |
| 113 break; | 111 break; |
| 114 case InStyleRecalc: | 112 case InStyleRecalc: |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (nextState == InStyleRecalc) | 230 if (nextState == InStyleRecalc) |
| 233 return true; | 231 return true; |
| 234 if (nextState == InPreLayout) | 232 if (nextState == InPreLayout) |
| 235 return true; | 233 return true; |
| 236 if (nextState == InCompositingUpdate) | 234 if (nextState == InCompositingUpdate) |
| 237 return true; | 235 return true; |
| 238 break; | 236 break; |
| 239 case Stopping: | 237 case Stopping: |
| 240 return nextState == Stopped; | 238 return nextState == Stopped; |
| 241 case Stopped: | 239 case Stopped: |
| 242 return nextState == Disposed; | 240 return false; |
| 243 case Disposed: | |
| 244 // FIXME: We can dispose a document multiple times. This seems wrong. | |
| 245 // See https://code.google.com/p/chromium/issues/detail?id=301668. | |
| 246 return nextState == Disposed; | |
| 247 } | 241 } |
| 248 return false; | 242 return false; |
| 249 } | 243 } |
| 250 | 244 |
| 251 bool DocumentLifecycle::canRewindTo(LifecycleState nextState) const | 245 bool DocumentLifecycle::canRewindTo(LifecycleState nextState) const |
| 252 { | 246 { |
| 253 // This transition is bogus, but we've whitelisted it anyway. | 247 // This transition is bogus, but we've whitelisted it anyway. |
| 254 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f
rom() && nextState == s_deprecatedTransitionStack->to()) | 248 if (s_deprecatedTransitionStack && m_state == s_deprecatedTransitionStack->f
rom() && nextState == s_deprecatedTransitionStack->to()) |
| 255 return true; | 249 return true; |
| 256 return m_state == StyleClean | 250 return m_state == StyleClean |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 DEBUG_STRING_CASE(InCompositingUpdate); | 307 DEBUG_STRING_CASE(InCompositingUpdate); |
| 314 DEBUG_STRING_CASE(CompositingClean); | 308 DEBUG_STRING_CASE(CompositingClean); |
| 315 DEBUG_STRING_CASE(InPaintInvalidation); | 309 DEBUG_STRING_CASE(InPaintInvalidation); |
| 316 DEBUG_STRING_CASE(PaintInvalidationClean); | 310 DEBUG_STRING_CASE(PaintInvalidationClean); |
| 317 DEBUG_STRING_CASE(InUpdatePaintProperties); | 311 DEBUG_STRING_CASE(InUpdatePaintProperties); |
| 318 DEBUG_STRING_CASE(UpdatePaintPropertiesClean); | 312 DEBUG_STRING_CASE(UpdatePaintPropertiesClean); |
| 319 DEBUG_STRING_CASE(InPaint); | 313 DEBUG_STRING_CASE(InPaint); |
| 320 DEBUG_STRING_CASE(PaintClean); | 314 DEBUG_STRING_CASE(PaintClean); |
| 321 DEBUG_STRING_CASE(Stopping); | 315 DEBUG_STRING_CASE(Stopping); |
| 322 DEBUG_STRING_CASE(Stopped); | 316 DEBUG_STRING_CASE(Stopped); |
| 323 DEBUG_STRING_CASE(Disposed); | |
| 324 } | 317 } |
| 325 | 318 |
| 326 ASSERT_NOT_REACHED(); | 319 ASSERT_NOT_REACHED(); |
| 327 return "Unknown"; | 320 return "Unknown"; |
| 328 } | 321 } |
| 329 #endif | 322 #endif |
| 330 | 323 |
| 331 } // namespace blink | 324 } // namespace blink |
| OLD | NEW |