Bug 505847 - Fix non-MOZ_IPC builds.
authorJoe Drew <joe@drew.ca>
Wed, 28 Oct 2009 17:27:28 -0400
changeset 36022 873798f6dcdc92f8a5babda59e4825459256ab5d
parent 36021 9e1daa4eaa0967515cf91f2b9b08d6d2c1739f6a
child 36023 4052b7e616de66bfaa7f37ff3f0f892fbfe2c654
push idunknown
push userunknown
push dateunknown
bugs505847
milestone1.9.3a1pre
Bug 505847 - Fix non-MOZ_IPC builds.
content/base/src/nsFrameLoader.cpp
content/canvas/src/nsCanvasRenderingContext2D.cpp
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -1432,18 +1432,15 @@ nsFrameLoader::TryNewProcess()
 #else
 #error TODO for this platform
 #endif
 
   return PR_TRUE;
 }
 #endif
 
+#ifdef MOZ_IPC
 mozilla::dom::PIFrameEmbeddingParent*
 nsFrameLoader::GetChildProcess()
 {
-#ifdef MOZ_IPC
   return mChildProcess;
-#else
-  return nsnull;
+}
 #endif
-}
-
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -3337,16 +3337,17 @@ nsCanvasRenderingContext2D::AsyncDrawXUL
     nsCOMPtr<nsIFrameLoaderOwner> loaderOwner = do_QueryInterface(aElem);
     if (!loaderOwner)
         return NS_ERROR_FAILURE;
 
     nsCOMPtr<nsFrameLoader> frameloader = loaderOwner->GetFrameLoader();
     if (!frameloader)
         return NS_ERROR_FAILURE;
 
+#ifdef MOZ_IPC
     mozilla::dom::PIFrameEmbeddingParent *child = frameloader->GetChildProcess();
     if (!child)
         return NS_ERROR_FAILURE;
 
     // protect against too-large surfaces that will cause allocation
     // or overflow issues
     if (!gfxASurface::CheckSurfaceSize(gfxIntSize(aW, aH), 0xffff))
         return NS_ERROR_FAILURE;
@@ -3369,16 +3370,24 @@ nsCanvasRenderingContext2D::AsyncDrawXUL
 
     mozilla::ipc::PDocumentRendererParent *pdocrender =
         child->SendPDocumentRendererConstructor(x, y, w, h, nsString(aBGColor), renderDocFlags, flush);
     mozilla::ipc::DocumentRendererParent *docrender = static_cast<mozilla::ipc::DocumentRendererParent *>(pdocrender);
 
     docrender->SetCanvasContext(this, mThebes);
 
     return NS_OK;
+#else
+    nsCOMPtr<nsIDOMWindow> window =
+        do_GetInterface(frameloader->GetExistingDocShell());
+    if (!window)
+        return NS_ERROR_FAILURE;
+
+    return DrawWindow(window, aX, aY, aW, aH, aBGColor, flags);
+#endif
 }
 
 //
 // device pixel getting/setting
 //
 extern "C" {
 #include "jstypes.h"
 JS_FRIEND_API(JSBool)