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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 DocumentLifecycle::DeprecatedTransition::~DeprecatedTransition() | 60 DocumentLifecycle::DeprecatedTransition::~DeprecatedTransition() |
61 { | 61 { |
62 s_deprecatedTransitionStack = m_previous; | 62 s_deprecatedTransitionStack = m_previous; |
63 } | 63 } |
64 | 64 |
65 DocumentLifecycle::DocumentLifecycle() | 65 DocumentLifecycle::DocumentLifecycle() |
66 : m_state(Uninitialized) | 66 : m_state(Uninitialized) |
67 , m_detachCount(0) | 67 , m_detachCount(0) |
| 68 , m_throttlingMode(ThrottlingMode::Disallow) |
68 { | 69 { |
69 } | 70 } |
70 | 71 |
71 DocumentLifecycle::~DocumentLifecycle() | 72 DocumentLifecycle::~DocumentLifecycle() |
72 { | 73 { |
73 } | 74 } |
74 | 75 |
75 #if ENABLE(ASSERT) | 76 #if ENABLE(ASSERT) |
76 | 77 |
77 bool DocumentLifecycle::canAdvanceTo(State nextState) const | 78 bool DocumentLifecycle::canAdvanceTo(State nextState) const |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 void DocumentLifecycle::ensureStateAtMost(State state) | 285 void DocumentLifecycle::ensureStateAtMost(State state) |
285 { | 286 { |
286 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); | 287 ASSERT(state == VisualUpdatePending || state == StyleClean || state == Layou
tClean); |
287 if (m_state <= state) | 288 if (m_state <= state) |
288 return; | 289 return; |
289 ASSERT_WITH_MESSAGE(canRewindTo(state), | 290 ASSERT_WITH_MESSAGE(canRewindTo(state), |
290 "Cannot rewind document lifecycle from %s to %s.", stateAsDebugString(m_
state), stateAsDebugString(state)); | 291 "Cannot rewind document lifecycle from %s to %s.", stateAsDebugString(m_
state), stateAsDebugString(state)); |
291 m_state = state; | 292 m_state = state; |
292 } | 293 } |
293 | 294 |
| 295 void DocumentLifecycle::setThrottlingMode(ThrottlingMode throttlingMode) |
| 296 { |
| 297 m_throttlingMode = throttlingMode; |
| 298 } |
| 299 |
| 300 DocumentLifecycle::ThrottlingMode DocumentLifecycle::throttlingMode() const |
| 301 { |
| 302 return m_throttlingMode; |
| 303 } |
| 304 |
294 #if ENABLE(ASSERT) | 305 #if ENABLE(ASSERT) |
295 #define DEBUG_STRING_CASE(StateName) \ | 306 #define DEBUG_STRING_CASE(StateName) \ |
296 case StateName: return #StateName | 307 case StateName: return #StateName |
297 | 308 |
298 const char* DocumentLifecycle::stateAsDebugString(const State state) | 309 const char* DocumentLifecycle::stateAsDebugString(const State state) |
299 { | 310 { |
300 switch (state) { | 311 switch (state) { |
301 DEBUG_STRING_CASE(Uninitialized); | 312 DEBUG_STRING_CASE(Uninitialized); |
302 DEBUG_STRING_CASE(Inactive); | 313 DEBUG_STRING_CASE(Inactive); |
303 DEBUG_STRING_CASE(VisualUpdatePending); | 314 DEBUG_STRING_CASE(VisualUpdatePending); |
(...skipping 19 matching lines...) Expand all Loading... |
323 DEBUG_STRING_CASE(Stopped); | 334 DEBUG_STRING_CASE(Stopped); |
324 DEBUG_STRING_CASE(Disposed); | 335 DEBUG_STRING_CASE(Disposed); |
325 } | 336 } |
326 | 337 |
327 ASSERT_NOT_REACHED(); | 338 ASSERT_NOT_REACHED(); |
328 return "Unknown"; | 339 return "Unknown"; |
329 } | 340 } |
330 #endif | 341 #endif |
331 | 342 |
332 } | 343 } |
OLD | NEW |