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

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 388793003: Mac ÜC: Fix white page hangs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index a7c3aa703d3acd057cb54484394b309f3a7b6f72..d4a89662d008c30a3e5183774cb46746df1de41a 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -903,6 +903,8 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
// RenderWidgetHostImpl.
ViewHostMsg_CompositorSurfaceBuffersSwapped_Params view_params;
view_params.use_native_widget = native_widget;
+ view_params.native_widget_token = native_widget ?
+ RenderWidgetHelper::CreateNativeWidgetSwapToken() : 0;
view_params.surface_id = params.surface_id;
view_params.surface_handle = params.surface_handle;
view_params.route_id = params.route_id;
@@ -910,18 +912,22 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
view_params.scale_factor = params.scale_factor;
view_params.gpu_process_host_id = host_id_;
view_params.latency_info = params.latency_info;
- if (helper) {
- helper->DidReceiveBackingStoreMsg(
- ViewHostMsg_CompositorSurfaceBuffersSwapped(
- render_widget_id,
- view_params));
- } else if (native_widget) {
+ // Always post a task to handle native widget messages, in case the helper
+ // that the message is sent to is destroyed before the message is handled.
+ if (native_widget) {
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
base::Bind(&RenderWidgetHelper::OnNativeSurfaceBuffersSwappedOnUIThread,
view_params));
}
+ if (helper) {
+ helper->DidReceiveBackingStoreMsg(
+ ViewHostMsg_CompositorSurfaceBuffersSwapped(
+ render_widget_id,
+ view_params));
+ }
+
}
#endif // OS_MACOSX

Powered by Google App Engine
This is Rietveld 408576698