Chromium Code Reviews| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 | 127 |
| 128 ~DetachScope() | 128 ~DetachScope() |
| 129 { | 129 { |
| 130 m_documentLifecycle.decrementDetachCount(); | 130 m_documentLifecycle.decrementDetachCount(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 DocumentLifecycle& m_documentLifecycle; | 134 DocumentLifecycle& m_documentLifecycle; |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 enum class ThrottlingMode { Disallow, Allow }; | |
| 138 | |
| 137 DocumentLifecycle(); | 139 DocumentLifecycle(); |
| 138 ~DocumentLifecycle(); | 140 ~DocumentLifecycle(); |
| 139 | 141 |
| 140 bool isActive() const { return m_state > Inactive && m_state < Stopping; } | 142 bool isActive() const { return m_state > Inactive && m_state < Stopping; } |
| 141 State state() const { return m_state; } | 143 State state() const { return m_state; } |
| 142 | 144 |
| 143 bool stateAllowsTreeMutations() const; | 145 bool stateAllowsTreeMutations() const; |
| 144 bool stateAllowsLayoutTreeMutations() const; | 146 bool stateAllowsLayoutTreeMutations() const; |
| 145 bool stateAllowsDetach() const; | 147 bool stateAllowsDetach() const; |
| 146 bool stateAllowsLayoutInvalidation() const; | 148 bool stateAllowsLayoutInvalidation() const; |
| 147 bool stateAllowsLayoutTreeNotifications() const; | 149 bool stateAllowsLayoutTreeNotifications() const; |
| 148 | 150 |
| 149 void advanceTo(State); | 151 void advanceTo(State); |
| 150 void ensureStateAtMost(State); | 152 void ensureStateAtMost(State); |
| 151 | 153 |
| 152 bool inDetach() const { return m_detachCount; } | 154 bool inDetach() const { return m_detachCount; } |
| 153 void incrementDetachCount() { m_detachCount++; } | 155 void incrementDetachCount() { m_detachCount++; } |
| 154 void decrementDetachCount() | 156 void decrementDetachCount() |
| 155 { | 157 { |
| 156 ASSERT(m_detachCount > 0); | 158 ASSERT(m_detachCount > 0); |
| 157 m_detachCount--; | 159 m_detachCount--; |
| 158 } | 160 } |
| 159 | 161 |
| 162 void setThrottlingMode(ThrottlingMode); | |
| 163 ThrottlingMode throttlingMode() const; | |
|
esprehn
2015/10/14 22:09:46
You want to add a ThrottleScope, just like the Det
Sami
2015/10/16 16:48:08
Done.
| |
| 164 | |
| 160 #if ENABLE(ASSERT) | 165 #if ENABLE(ASSERT) |
| 161 static const char* stateAsDebugString(const State); | 166 static const char* stateAsDebugString(const State); |
| 162 #endif | 167 #endif |
| 163 | 168 |
| 164 private: | 169 private: |
| 165 #if ENABLE(ASSERT) | 170 #if ENABLE(ASSERT) |
| 166 bool canAdvanceTo(State) const; | 171 bool canAdvanceTo(State) const; |
| 167 bool canRewindTo(State) const; | 172 bool canRewindTo(State) const; |
| 168 #endif | 173 #endif |
| 169 | 174 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 && m_state != InCompositingUpdate | 220 && m_state != InCompositingUpdate |
| 216 && m_state != InPaintInvalidation | 221 && m_state != InPaintInvalidation |
| 217 && m_state != InUpdatePaintProperties | 222 && m_state != InUpdatePaintProperties |
| 218 && m_state != InPaint | 223 && m_state != InPaint |
| 219 && m_state != InCompositingForSlimmingPaintV2; | 224 && m_state != InCompositingForSlimmingPaintV2; |
| 220 } | 225 } |
| 221 | 226 |
| 222 } // namespace blink | 227 } // namespace blink |
| 223 | 228 |
| 224 #endif | 229 #endif |
| OLD | NEW |