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

Side by Side Diff: plugin/mac/plugin_mac.mm

Issue 2451002: Prevent Client::Tick() from causing reentrancy in the plugin on Mac OS X.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/o3d/
Patch Set: '' Created 10 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « core/cross/client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 } 231 }
232 232
233 void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) { 233 void RenderTimer::TimerCallback(CFRunLoopTimerRef timer, void* info) {
234 HANDLE_CRASHES; 234 HANDLE_CRASHES;
235 int instance_count = instances_.size(); 235 int instance_count = instances_.size();
236 for (int i = 0; i < instance_count; ++i) { 236 for (int i = 0; i < instance_count; ++i) {
237 NPP instance = instances_[i]; 237 NPP instance = instances_[i];
238 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 238 PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
239 239
240 // RenderClient() may cause events to be processed, leading to 240 // RenderClient() and Tick() may cause events to be processed,
241 // reentrant calling of this code. Detect and avoid this case. 241 // leading to reentrant calling of this code. Detect and avoid
242 if (obj->client()->IsRendering()) { 242 // this case.
243 if (obj->client()->IsRendering() || obj->client()->IsTicking()) {
243 continue; 244 continue;
244 } 245 }
245 246
246 bool in_fullscreen = obj->GetFullscreenMacWindow(); 247 bool in_fullscreen = obj->GetFullscreenMacWindow();
247 248
248 if (obj->drawing_model_ == NPDrawingModelCoreAnimation && 249 if (obj->drawing_model_ == NPDrawingModelCoreAnimation &&
249 !in_fullscreen) { 250 !in_fullscreen) {
250 O3DLayer* o3dLayer = static_cast<O3DLayer*>(obj->gl_layer_); 251 O3DLayer* o3dLayer = static_cast<O3DLayer*>(obj->gl_layer_);
251 if (o3dLayer) { 252 if (o3dLayer) {
252 obj->client()->Tick(); 253 obj->client()->Tick();
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 686
686 void PluginObject::SetMacCGLContext(CGLContextObj context) { 687 void PluginObject::SetMacCGLContext(CGLContextObj context) {
687 mac_cgl_context_ = context; 688 mac_cgl_context_ = context;
688 if (renderer_) { 689 if (renderer_) {
689 ((o3d::RendererGL*) renderer_)->set_mac_cgl_context(context); 690 ((o3d::RendererGL*) renderer_)->set_mac_cgl_context(context);
690 } 691 }
691 } 692 }
692 693
693 } // namespace glue 694 } // namespace glue
694 } // namespace o3d 695 } // namespace o3d
OLDNEW
« no previous file with comments | « core/cross/client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698