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

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentLifecycle.h

Issue 1364063007: Throttle rendering pipeline for invisible frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test by not dumping throttled FrameViews. Created 5 years, 2 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 unified diff | Download patch
OLDNEW
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
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 class PreventThrottlingScope {
138 STACK_ALLOCATED();
139 WTF_MAKE_NONCOPYABLE(PreventThrottlingScope);
140 public:
141 PreventThrottlingScope(DocumentLifecycle&);
142 ~PreventThrottlingScope();
143 };
144
137 DocumentLifecycle(); 145 DocumentLifecycle();
138 ~DocumentLifecycle(); 146 ~DocumentLifecycle();
139 147
140 bool isActive() const { return m_state > Inactive && m_state < Stopping; } 148 bool isActive() const { return m_state > Inactive && m_state < Stopping; }
141 State state() const { return m_state; } 149 State state() const { return m_state; }
142 150
143 bool stateAllowsTreeMutations() const; 151 bool stateAllowsTreeMutations() const;
144 bool stateAllowsLayoutTreeMutations() const; 152 bool stateAllowsLayoutTreeMutations() const;
145 bool stateAllowsDetach() const; 153 bool stateAllowsDetach() const;
146 bool stateAllowsLayoutInvalidation() const; 154 bool stateAllowsLayoutInvalidation() const;
147 bool stateAllowsLayoutTreeNotifications() const; 155 bool stateAllowsLayoutTreeNotifications() const;
148 156
149 void advanceTo(State); 157 void advanceTo(State);
150 void ensureStateAtMost(State); 158 void ensureStateAtMost(State);
151 159
152 bool inDetach() const { return m_detachCount; } 160 bool inDetach() const { return m_detachCount; }
153 void incrementDetachCount() { m_detachCount++; } 161 void incrementDetachCount() { m_detachCount++; }
154 void decrementDetachCount() 162 void decrementDetachCount()
155 { 163 {
156 ASSERT(m_detachCount > 0); 164 ASSERT(m_detachCount > 0);
157 m_detachCount--; 165 m_detachCount--;
158 } 166 }
159 167
168 bool throttlingAllowed() const;
169
160 #if ENABLE(ASSERT) 170 #if ENABLE(ASSERT)
161 static const char* stateAsDebugString(const State); 171 static const char* stateAsDebugString(const State);
162 #endif 172 #endif
163 173
164 private: 174 private:
165 #if ENABLE(ASSERT) 175 #if ENABLE(ASSERT)
166 bool canAdvanceTo(State) const; 176 bool canAdvanceTo(State) const;
167 bool canRewindTo(State) const; 177 bool canRewindTo(State) const;
168 #endif 178 #endif
169 179
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 && m_state != InCompositingUpdate 225 && m_state != InCompositingUpdate
216 && m_state != InPaintInvalidation 226 && m_state != InPaintInvalidation
217 && m_state != InUpdatePaintProperties 227 && m_state != InUpdatePaintProperties
218 && m_state != InPaint 228 && m_state != InPaint
219 && m_state != InCompositingForSlimmingPaintV2; 229 && m_state != InCompositingForSlimmingPaintV2;
220 } 230 }
221 231
222 } // namespace blink 232 } // namespace blink
223 233
224 #endif 234 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698