Bug 1331509 - Rearrange TabChild::RecvShow to make it a bit more obvious how InitRenderingState can be extracted. r?dvander
MozReview-Commit-ID: AnOnBd5Wqs9
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1219,43 +1219,40 @@ mozilla::ipc::IPCResult
TabChild::RecvShow(const ScreenIntSize& aSize,
const ShowInfo& aInfo,
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame,
const bool& aParentIsActive,
const nsSizeMode& aSizeMode)
{
- MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame));
-
- mPuppetWidget->SetSizeMode(aSizeMode);
- if (mDidFakeShow) {
- ApplyShowInfo(aInfo);
- RecvParentActivated(aParentIsActive);
- return IPC_OK();
- }
-
+ MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame));
+ bool res = true;
+
+ mPuppetWidget->SetSizeMode(aSizeMode);
+ if (!mDidFakeShow) {
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(WebNavigation());
if (!baseWindow) {
NS_ERROR("WebNavigation() doesn't QI to nsIBaseWindow");
return IPC_FAIL_NO_REASON(this);
}
InitRenderingState(aTextureFactoryIdentifier, aLayersId, aRenderFrame);
baseWindow->SetVisibility(true);
-
- bool res = InitTabChildGlobal();
- ApplyShowInfo(aInfo);
- RecvParentActivated(aParentIsActive);
-
- if (!res) {
- return IPC_FAIL_NO_REASON(this);
- }
- return IPC_OK();
+ res = InitTabChildGlobal();
+ }
+
+ ApplyShowInfo(aInfo);
+ RecvParentActivated(aParentIsActive);
+
+ if (!res) {
+ return IPC_FAIL_NO_REASON(this);
+ }
+ return IPC_OK();
}
mozilla::ipc::IPCResult
TabChild::RecvUpdateDimensions(const CSSRect& rect, const CSSSize& size,
const ScreenOrientationInternal& orientation,
const LayoutDeviceIntPoint& clientOffset,
const LayoutDeviceIntPoint& chromeDisp)
{