From c45c44020656aad5a5c1672a2b50213e73fc7ec3 Mon Sep 17 00:00:00 2001 From: Chiajung Hung Date: Thu, 30 May 2013 08:10:02 -0400 Subject: [PATCH] Bug 875246 - Ensure that UpdateTexture DispatchImageClientUpdate only dispatches if not in the ImageBridge thread. r=kchen DispatchImageClientUpdate is a helper function to dispatch IPC message, only dispatch when not in the ImageBridge thread can improve responsibility. --- gfx/layers/ipc/ImageBridgeChild.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index c5d60c1dba40..6b13c19cc741 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -310,6 +310,10 @@ static void UpdateImageClientNow(ImageClient* aClient, ImageContainer* aContaine void ImageBridgeChild::DispatchImageClientUpdate(ImageClient* aClient, ImageContainer* aContainer) { + if (InImageBridgeChildThread()) { + UpdateImageClientNow(aClient, aContainer); + return; + } sImageBridgeChildSingleton->GetMessageLoop()->PostTask( FROM_HERE, NewRunnableFunction(&UpdateImageClientNow, aClient, aContainer));