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

Unified Diff: content/browser/renderer_host/accelerated_plugin_view_mac.mm

Issue 8261004: Prevent recursive calls to globalFrameDidChange. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/accelerated_plugin_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/accelerated_plugin_view_mac.mm
===================================================================
--- content/browser/renderer_host/accelerated_plugin_view_mac.mm (revision 105227)
+++ content/browser/renderer_host/accelerated_plugin_view_mac.mm (working copy)
@@ -72,6 +72,7 @@
swapInterval = 1;
[glContext_ setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
+ handlingGlobalFrameDidChange_ = NO;
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(globalFrameDidChange:)
@@ -151,15 +152,22 @@
}
- (void)globalFrameDidChange:(NSNotification*)notification {
- // This call to -update can call -globalFrameDidChange: again, see
- // http://crbug.com/55754 comments 22 and 24.
- [glContext_ update];
+ // Short-circuit recursive calls.
+ if (!handlingGlobalFrameDidChange_) {
Nico 2011/10/13 02:26:07 nit: early return instead, less nesting that way.
Ken Russell (switch to Gerrit) 2011/10/13 18:41:20 Right, thanks. Done.
+ handlingGlobalFrameDidChange_ = YES;
- // You would think that -update updates the viewport. You would be wrong.
- CGLSetCurrentContext(cglContext_);
- NSSize size = [self frame].size;
- glViewport(0, 0, size.width, size.height);
- CGLSetCurrentContext(0);
+ // This call to -update can call -globalFrameDidChange: again, see
+ // http://crbug.com/55754 comments 22 and 24.
+ [glContext_ update];
+
+ // You would think that -update updates the viewport. You would be wrong.
+ CGLSetCurrentContext(cglContext_);
+ NSSize size = [self frame].size;
+ glViewport(0, 0, size.width, size.height);
+ CGLSetCurrentContext(0);
+
+ handlingGlobalFrameDidChange_ = NO;
+ }
}
- (void)prepareForGLRendering {
« no previous file with comments | « content/browser/renderer_host/accelerated_plugin_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698