Chromium Code Reviews| Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm |
| diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
| index bf4ce950865f2af8515c63ac99c92a43520098c6..439bd8a04dabb94795ab3632fd5fe6d2037aec67 100644 |
| --- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
| +++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm |
| @@ -574,6 +574,7 @@ void RenderWidgetHostViewMac::RenderViewGone(base::TerminationStatus status, |
| } |
| void RenderWidgetHostViewMac::Destroy() { |
| + TRACE_EVENT0("browser", "RenderWidgetHostViewMac::Destroy"); |
| // On Windows, popups are implemented with a popup window style, so that when |
| // an event comes in that would "cancel" it, it receives the OnCancelMode |
| // message and can kill itself. Alas, on the Mac, views cannot capture events |
| @@ -703,6 +704,9 @@ RenderWidgetHostViewMac::AllocateFakePluginWindowHandle(bool opaque, |
| // Create an NSView to host the plugin's/compositor's pixels. |
| gfx::PluginWindowHandle handle = |
| plugin_container_manager_.AllocateFakePluginWindowHandle(opaque, root); |
| + TRACE_EVENT1("browser", |
| + "RenderWidgetHostViewMac::AllocateFakePluginWindowHandle", |
| + "window", handle); |
| scoped_nsobject<AcceleratedPluginView> plugin_view( |
| [[AcceleratedPluginView alloc] initWithRenderWidgetHostViewMac:this |
| @@ -718,6 +722,9 @@ RenderWidgetHostViewMac::AllocateFakePluginWindowHandle(bool opaque, |
| void RenderWidgetHostViewMac::DestroyFakePluginWindowHandle( |
| gfx::PluginWindowHandle window) { |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + TRACE_EVENT1("browser", |
| + "RenderWidgetHostViewMac::DestroyFakePluginWindowHandle", |
| + "window", window); |
| PluginViewMap::iterator it = plugin_views_.find(window); |
| DCHECK(plugin_views_.end() != it); |
| if (plugin_views_.end() == it) { |
| @@ -734,6 +741,9 @@ void RenderWidgetHostViewMac::DestroyFakePluginWindowHandle( |
| // This is called by AcceleratedPluginView's -dealloc. |
| void RenderWidgetHostViewMac::DeallocFakePluginWindowHandle( |
| gfx::PluginWindowHandle window) { |
| + TRACE_EVENT1("browser", |
| + "RenderWidgetHostViewMac::DeallocFakePluginWindowHandle", |
| + "window", window); |
| // When a browser window with a GpuScheduler is closed, the render process |
| // will attempt to finish all GL commands. It will busy-wait on the GPU |
| // process until the command queue is empty. If a paint is pending, the GPU |
| @@ -759,7 +769,6 @@ void RenderWidgetHostViewMac::DeallocFakePluginWindowHandle( |
| AcceleratedPluginView* RenderWidgetHostViewMac::ViewForPluginWindowHandle( |
| gfx::PluginWindowHandle window) { |
| PluginViewMap::iterator it = plugin_views_.find(window); |
| - DCHECK(plugin_views_.end() != it); |
| if (plugin_views_.end() == it) |
| return nil; |
| return it->second; |
| @@ -810,13 +819,20 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped( |
| int32 route_id, |
| int gpu_host_id, |
| uint64 swap_buffers_count) { |
| - TRACE_EVENT0("browser", |
| - "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped"); |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| AcceleratedPluginView* view = ViewForPluginWindowHandle(window); |
| - DCHECK(view); |
| - if (!view) |
| + TRACE_EVENT1("browser", |
| + "RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped", |
| + "view", view); |
| + if (!view) { |
| + // This happens, and we can't let the GPU go without an ack. |
| + // TODO: Why does this happen? Does it matter? |
|
jbates
2011/06/07 16:47:52
Looks like this may be a recent ToT bug. It does n
|
| + AcknowledgeSwapBuffers(renderer_id, |
| + route_id, |
| + gpu_host_id, |
| + swap_buffers_count); |
| return; |
| + } |
| plugin_container_manager_.SetSurfaceWasPaintedTo(window, surface_id); |
| @@ -863,7 +879,7 @@ void RenderWidgetHostViewMac::AcknowledgeSwapBuffers( |
| int32 route_id, |
| int gpu_host_id, |
| uint64 swap_buffers_count) { |
| - TRACE_EVENT1("gpu", "RenderWidgetHostViewMac::AcknowledgeSwapBuffers", |
| + TRACE_EVENT1("browser", "RenderWidgetHostViewMac::AcknowledgeSwapBuffers", |
| "swap_buffers_count", swap_buffers_count); |
| // Called on the display link thread. Hand actual work off to the IO thread, |
| // because |GpuProcessHost::Get()| can only be called there. |