Back out this line of unwanted changesets.
authorBlake Kaplan <mrbkap@gmail.com>
Wed, 30 Jun 2010 18:36:02 -0700
changeset 46953 6c6168cbf011cd169c985dc47fdb57849f56eb3f
parent 46826 55597db07ca7c6ce6f49f78293642517b4833bec
child 46954 ac7c39e41b1da5f1b19cc9bad82fa2c2eb9b8349
push idunknown
push userunknown
push dateunknown
milestone1.9.3a4pre
Back out this line of unwanted changesets.
chrome/src/ChromeTypes.h
chrome/src/Makefile.in
chrome/src/RegistryMessageUtils.h
chrome/src/nsChromeRegistry.cpp
chrome/src/nsChromeRegistry.h
configure.in
content/base/src/nsFrameLoader.cpp
content/base/src/nsFrameLoader.h
content/canvas/public/DocumentRendererShmemChild.h
content/canvas/public/DocumentRendererShmemParent.h
content/canvas/public/Makefile.in
content/canvas/public/nsICanvasRenderingContextInternal.h
content/canvas/src/DocumentRendererShmemChild.cpp
content/canvas/src/DocumentRendererShmemParent.cpp
content/canvas/src/Makefile.in
content/canvas/src/WebGLContext.cpp
content/canvas/src/WebGLContext.h
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/html/content/src/nsHTMLCanvasElement.cpp
dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
dom/ipc/ContentProcessChild.cpp
dom/ipc/ContentProcessChild.h
dom/ipc/ContentProcessParent.cpp
dom/ipc/ContentProcessParent.h
dom/ipc/Makefile.in
dom/ipc/PContentProcess.ipdl
dom/ipc/PDocumentRenderer.ipdl
dom/ipc/PDocumentRendererShmem.ipdl
dom/ipc/PIFrameEmbedding.ipdl
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/ipdl.mk
gfx/cairo/cairo/src/cairo-deprecated.h
gfx/cairo/cairo/src/cairo-image-surface.c
gfx/cairo/cairo/src/cairo-qpainter-surface.cpp
gfx/cairo/cairo/src/cairo.h
gfx/cairo/cairo/src/cairoint.h
gfx/cairo/libpixman/src/Makefile.in
gfx/cairo/libpixman/src/pixman-bits-image.c
gfx/cairo/libpixman/src/pixman-fast-path-scale.c
gfx/cairo/libpixman/src/pixman-fast-path.c
gfx/cairo/libpixman/src/pixman-private.h
gfx/thebes/public/gfxASurface.h
gfx/thebes/src/gfxASurface.cpp
gfx/thebes/src/gfxImageSurface.cpp
gfx/thebes/src/gfxQtPlatform.cpp
gfx/thebes/src/gfxSharedImageSurface.cpp
ipc/glue/IPCMessageUtils.h
ipc/glue/ProtocolUtils.h
ipc/glue/Shmem.h
ipc/ipdl/ipdl/lower.py
netwerk/protocol/res/src/nsResProtocolHandler.cpp
netwerk/protocol/res/src/nsResProtocolHandler.h
toolkit/components/places/src/History.cpp
toolkit/components/places/src/History.h
toolkit/components/places/src/Makefile.in
toolkit/xre/Makefile.in
toolkit/xre/nsEmbedFunctions.cpp
widget/src/qt/nsIdleServiceQt.cpp
widget/src/qt/nsNativeThemeQt.cpp
widget/src/qt/nsWidgetFactory.cpp
widget/src/qt/nsWindow.cpp
widget/src/qt/nsWindow.h
xpcom/build/nsXULAppAPI.h
deleted file mode 100644
--- a/chrome/src/ChromeTypes.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Josh Matthews <josh@joshmatthews.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef ChromeTypes_h__
-#define ChromeTypes_h__
-
-#ifndef MOZILLA_INTERNAL_API
-#include "nsStringAPI.h"
-#else
-#include "nsString.h"
-#endif
-
-#include "nsCOMPtr.h"
-#include "nsIURI.h"
-
-struct ChromePackage {
-  nsCString package;
-  nsCOMPtr<nsIURI> baseURI;
-  PRUint32 flags;
-};
-
-struct ChromeResource {
-  nsCString package;
-  nsCOMPtr<nsIURI> resolvedURI;
-};
-
-#endif //ChromeTypes_h__
--- a/chrome/src/Makefile.in
+++ b/chrome/src/Makefile.in
@@ -45,22 +45,16 @@ include $(DEPTH)/config/autoconf.mk
 MODULE          = chrome
 LIBRARY_NAME    = chrome
 EXPORT_LIBRARY = 1
 IS_COMPONENT    = 1
 MODULE_NAME     = nsChromeModule
 GRE_MODULE      = 1
 LIBXUL_LIBRARY  = 1
 
-EXPORTS_NAMESPACES = mozilla/chrome
-
-EXPORTS_mozilla/chrome = \
-		ChromeTypes.h \
-		RegistryMessageUtils.h \
-		$(NULL)
 
 CPPSRCS		= \
 		nsChromeFactory.cpp \
 		nsChromeRegistry.cpp \
 		nsChromeProtocolHandler.cpp \
 		$(NULL)
 
 EXTRA_DSO_LDOPTS = \
@@ -71,22 +65,14 @@ EXTRA_DSO_LDOPTS = \
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LDOPTS += $(TK_LIBS)
 endif
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES += \
-		-I$(topsrcdir)/dom/ipc \
-		-I$(topsrcdir)/netwerk/protocol/res/src \
-		-I$(topsrcdir)/netwerk/base/src \
-		$(NULL)
-
 ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
 CXXFLAGS          += $(MOZ_GTK2_CFLAGS)
 endif
 
deleted file mode 100644
--- a/chrome/src/RegistryMessageUtils.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * the Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Josh Matthews <josh@joshmatthews.net>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef RegistryMessageUtils_h__
-#define RegistryMessageUtils_h__
-
-#include "IPC/IPCMessageUtils.h"
-#include "nsIURI.h"
-#include "nsNetUtil.h"
-
-#ifndef MOZILLA_INTERNAL_API
-#include "nsStringAPI.h"
-#else
-#include "nsString.h"
-#endif
-
-namespace IPC {
-
-inline void WriteURI(Message* aMsg, nsIURI* aURI)
-{
-  nsCString spec;
-  if (aURI)
-    aURI->GetSpec(spec);
-  WriteParam(aMsg, spec);
-}
-
-inline bool ReadURI(const Message* aMsg, void** aIter, nsIURI* *aURI)
-{
-  *aURI = nsnull;
-  
-  nsCString spec;
-  if (!ReadParam(aMsg, aIter, &spec))
-    return false;
-
-  if (spec.Length()) {
-    nsresult rv = NS_NewURI(aURI, spec);
-    NS_ENSURE_SUCCESS(rv, false);
-  }
-
-  return true;
-}
-  
-template <>
-struct ParamTraits<ChromePackage>
-{
-  typedef ChromePackage paramType;
-  
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, aParam.package);
-    WriteURI(aMsg, aParam.baseURI);
-    WriteParam(aMsg, aParam.flags);
-  }
-  
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    nsCString package;
-    nsCOMPtr<nsIURI> uri;
-    PRUint32 flags;
-    
-    if (ReadParam(aMsg, aIter, &package) &&
-        ReadURI(aMsg, aIter, getter_AddRefs(uri)) &&
-        ReadParam(aMsg, aIter, &flags)) {
-      aResult->package = package;
-      aResult->baseURI = uri;
-      aResult->flags = flags;
-      return true;
-    }
-    return false;
-  }
-
-  static void Log(const paramType& aParam, std::wstring* aLog)
-  {
-    nsCString spec;
-    aParam.baseURI->GetSpec(spec);
-    aLog->append(StringPrintf(L"[%s, %s, %u]", aParam.package.get(),
-                             spec.get(), aParam.flags));
-  }
-};
-
-template <>
-struct ParamTraits<ChromeResource>
-{
-  typedef ChromeResource paramType;
-  
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, aParam.package);
-    WriteURI(aMsg, aParam.resolvedURI);
-  }
-  
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    nsCString package;
-    nsCOMPtr<nsIURI> uri;
-    
-    if (ReadParam(aMsg, aIter, &package) &&
-        ReadURI(aMsg, aIter, getter_AddRefs(uri))) {
-      aResult->package = package;
-      aResult->resolvedURI = uri;
-      return true;
-    }
-    return false;
-  }
-
-  static void Log(const paramType& aParam, std::wstring* aLog)
-  {
-    nsCString spec;
-    aParam.resolvedURI->GetSpec(spec);
-    aLog->append(StringPrintf(L"[%s, %s, %u]", aParam.package.get(),
-                             spec.get()));
-  }
-};
-
-}
-
-#endif // RegistryMessageUtils_h__
--- a/chrome/src/nsChromeRegistry.cpp
+++ b/chrome/src/nsChromeRegistry.cpp
@@ -34,22 +34,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifdef MOZ_IPC
-#include "mozilla/dom/TabParent.h"
-#include "mozilla/dom/ContentProcessParent.h"
-#include "RegistryMessageUtils.h"
-#endif
-
 #include "nsChromeRegistry.h"
 
 #include <string.h>
 
 #include "prio.h"
 #include "prprf.h"
 #if defined(XP_WIN)
 #include <windows.h>
@@ -102,17 +96,16 @@
 #include "nsILookAndFeel.h"
 #include "nsIObserverService.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIPrefBranch2.h"
 #include "nsIPresShell.h"
 #include "nsIProtocolHandler.h"
 #include "nsIResProtocolHandler.h"
-#include "nsResProtocolHandler.h"
 #include "nsIScriptError.h"
 #include "nsIServiceManager.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIStyleSheet.h"
 #include "nsISupportsArray.h"
 #include "nsIVersionComparator.h"
 #include "nsIWindowMediator.h"
 #include "nsIXPConnect.h"
@@ -455,30 +448,16 @@ getUILangCountry(nsACString& aUILang)
   nsAutoString uiLang;
   rv = localeService->GetLocaleComponentForUserAgent(uiLang);
   NS_ENSURE_SUCCESS(rv, rv);
 
   CopyUTF16toUTF8(uiLang, aUILang);
   return NS_OK;
 }
 
-nsChromeRegistry*
-nsChromeRegistry::GetService()
-{
-  if (!nsChromeRegistry::gChromeRegistry)
-  {
-    // We don't actually want this ref, we just want the service to
-    // initialize if it hasn't already.
-    nsCOMPtr<nsIChromeRegistry> reg(
-        do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
-    NS_ENSURE_TRUE(nsChromeRegistry::gChromeRegistry, NULL);
-  }
-  return gChromeRegistry;
-}
-
 nsresult
 nsChromeRegistry::Init()
 {
   nsresult rv;
 
   // Check to see if necko and the JAR protocol handler are registered yet
   // if not, somebody is doing work during XPCOM registration that they
   // shouldn't be doing. See bug 292549, where JS components are trying
@@ -1161,212 +1140,16 @@ nsChromeRegistry::AllowContentToAccess(n
 }
 
 static PLDHashOperator
 RemoveAll(PLDHashTable *table, PLDHashEntryHdr *entry, PRUint32 number, void *arg)
 {
   return (PLDHashOperator) (PL_DHASH_NEXT | PL_DHASH_REMOVE);
 }
 
-PLDHashOperator
-nsChromeRegistry::SendAllToChildProcess(PLDHashTable *table, PLDHashEntryHdr *entry, PRUint32 number, void *arg)
-{
-  mozilla::dom::TabParent* tabParent = static_cast<mozilla::dom::TabParent*>(arg);
-  nsChromeRegistry::PackageEntry* package = static_cast<PackageEntry*>(entry);
-  nsString packageName(NS_ConvertUTF8toUTF16(package->package).get());
-  nsString baseURI;
-  nsCAutoString prePath, path;
-
-  if(package->baseURI)
-  {
-    package->baseURI->GetPrePath(prePath);
-    package->baseURI->GetPath(path);
-  }
-  CopyUTF8toUTF16(prePath, baseURI);
-  AppendUTF8toUTF16(path, baseURI);
-  
-  if(!tabParent->SendregisterChromePackage(packageName, baseURI, package->flags))
-  {
-    //XXXjdm error
-  }
-  return (PLDHashOperator)PL_DHASH_NEXT;
-}
-
-PLDHashOperator
-nsChromeRegistry::SendResourceToChildProcess(const nsACString& aKey, nsIURI* aURI, void* aArg)
-{
-  mozilla::dom::TabParent* tabParent = static_cast<mozilla::dom::TabParent*>(aArg);
-  nsString resolved, packageName(NS_ConvertUTF8toUTF16(aKey).get());
-  nsCAutoString prePath, path;
-
-  aURI->GetPrePath(prePath);
-  aURI->GetPath(path);
-  CopyUTF8toUTF16(prePath, resolved);
-  AppendUTF8toUTF16(path, resolved);
-
-  if(!tabParent->SendregisterChromeResource(packageName, resolved))
-  {
-    //XXXjdm error
-  }
-  return (PLDHashOperator)PL_DHASH_NEXT;
-}
-
-void
-nsChromeRegistry::SendRegisteredPackages(mozilla::dom::TabParent* aParent)
-{
-  PL_DHashTableEnumerate(&mPackagesHash, SendAllToChildProcess, aParent);
-
-  nsCOMPtr<nsIIOService> io (do_GetIOService());
-  //if (!io) return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIProtocolHandler> ph;
-  nsresult rv = io->GetProtocolHandler("resource", getter_AddRefs(ph));
-  //    NS_ENSURE_SUCCESS(rv, rv);
-  nsCOMPtr<nsIResProtocolHandler> irph (do_QueryInterface(ph));
-  nsResProtocolHandler* rph = static_cast<nsResProtocolHandler*>(irph.get());
-  rph->EnumerateSubstitutions(SendResourceToChildProcess, aParent);
-}
-
-void
-nsChromeRegistry::RegisterPackage(const nsString& aPackage,
-                                  const nsString& aBaseURI,
-                                  const PRUint32& aFlags)
-{
-  const char *package = NS_ConvertUTF16toUTF8(aPackage).get();
-  PackageEntry* entry =
-      static_cast<PackageEntry*>(PL_DHashTableOperate(&mPackagesHash,
-                                                      & (const nsACString&) nsDependentCString(package),
-                                                      PL_DHASH_ADD));
-  entry->flags = aFlags;
-  NS_NewURI(getter_AddRefs(entry->baseURI), NS_ConvertUTF16toUTF8(aBaseURI));
-}
-
-void
-nsChromeRegistry::RegisterResource(const nsString& aPackage,
-                                   const nsString& aResolvedURI)
-{
-  nsCOMPtr<nsIIOService> io (do_GetIOService());
-  //if (!io) return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIProtocolHandler> ph;
-  nsresult rv = io->GetProtocolHandler("resource", getter_AddRefs(ph));
-  //    NS_ENSURE_SUCCESS(rv, rv);
-  
-  nsCOMPtr<nsIResProtocolHandler> rph (do_QueryInterface(ph));
-  //if (!rph) return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIURI> resolved;
-  NS_NewURI(getter_AddRefs(resolved), NS_ConvertUTF16toUTF8(aResolvedURI));
-
-  rv = rph->SetSubstitution(NS_ConvertUTF16toUTF8(aPackage), resolved);
-}
-
-#ifdef MOZ_IPC
-PLDHashOperator
-nsChromeRegistry::CollectPackages(PLDHashTable *table,
-                                  PLDHashEntryHdr *entry,
-                                  PRUint32 number,
-                                  void *arg)
-{
-  nsTArray<ChromePackage>* packages =
-      static_cast<nsTArray<ChromePackage>*>(arg);
-  nsChromeRegistry::PackageEntry* package = static_cast<PackageEntry*>(entry);
-  ChromePackage chromePackage = {
-    package->package,
-    package->baseURI,
-    package->flags
-  };
-  packages->AppendElement(chromePackage);
-  return (PLDHashOperator)PL_DHASH_NEXT;
-}
-
-PLDHashOperator
-nsChromeRegistry::CollectResources(const nsACString& aKey,
-                                   nsIURI* aURI,
-                                   void* aArg)
-{
-  nsTArray<ChromeResource>* resources =
-      static_cast<nsTArray<ChromeResource>*>(aArg);
-  ChromeResource resource = {
-    nsDependentCString(aKey), aURI
-  };
-  resources->AppendElement(resource);
-  return (PLDHashOperator)PL_DHASH_NEXT;
-}
-
-void
-nsChromeRegistry::SendRegisteredChrome(
-    mozilla::dom::ContentProcessParent* aParent)
-{
-  nsTArray<ChromePackage> packages;
-  nsTArray<ChromeResource> resources;
-  
-  PL_DHashTableEnumerate(&mPackagesHash, CollectPackages, &packages);
-
-  nsCOMPtr<nsIIOService> io (do_GetIOService());
-  NS_ENSURE_TRUE(io, );
-
-  nsCOMPtr<nsIProtocolHandler> ph;
-  nsresult rv = io->GetProtocolHandler("resource", getter_AddRefs(ph));
-  NS_ENSURE_SUCCESS(rv, );
-  
-  nsCOMPtr<nsIResProtocolHandler> irph (do_QueryInterface(ph));
-  nsResProtocolHandler* rph = static_cast<nsResProtocolHandler*>(irph.get());
-  rph->EnumerateSubstitutions(CollectResources, &resources);
-
-  bool success = aParent->SendregisterChrome(packages, resources);
-  NS_ENSURE_TRUE(success, );
-}
-
-void
-nsChromeRegistry::RegisterRemoteChrome(const nsTArray<ChromePackage>& aPackages,
-                                       const nsTArray<ChromeResource>& aResources)
-{
-  for (PRUint32 i = aPackages.Length(); i > 0; ) {
-    --i;
-    RegisterPackage(aPackages[i]);
-  }
-
-  for (PRUint32 i = aResources.Length(); i > 0; ) {
-    --i;
-    RegisterResource(aResources[i]);
-  }
-}
-
-void
-nsChromeRegistry::RegisterPackage(const ChromePackage& aPackage)
-{
-  PackageEntry* entry =
-      static_cast<PackageEntry*>(PL_DHashTableOperate(&mPackagesHash,
-                                                      &aPackage.package,
-                                                      PL_DHASH_ADD));
-  NS_ENSURE_TRUE(entry, );
-  entry->flags = aPackage.flags;
-  entry->baseURI = aPackage.baseURI;
-}
-
-void
-nsChromeRegistry::RegisterResource(const ChromeResource& aResource)
-{
-  nsCOMPtr<nsIIOService> io (do_GetIOService());
-  NS_ENSURE_TRUE(io, );
-
-  nsCOMPtr<nsIProtocolHandler> ph;
-  nsresult rv = io->GetProtocolHandler("resource", getter_AddRefs(ph));
-  NS_ENSURE_SUCCESS(rv, );
-  
-  nsCOMPtr<nsIResProtocolHandler> rph (do_QueryInterface(ph));
-  NS_ENSURE_TRUE(rph, );
-
-  rv = rph->SetSubstitution(aResource.package, aResource.resolvedURI);
-  NS_ENSURE_SUCCESS(rv, );
-}
-#endif // MOZ_IPC
-
-
 NS_IMETHODIMP
 nsChromeRegistry::CheckForNewChrome()
 {
   nsresult rv;
 
   PL_DHashTableEnumerate(&mPackagesHash, RemoveAll, nsnull);
   mOverlayHash.Clear();
   mStyleHash.Clear();
--- a/chrome/src/nsChromeRegistry.h
+++ b/chrome/src/nsChromeRegistry.h
@@ -50,36 +50,28 @@
 
 #include "nsCOMArray.h"
 #include "nsString.h"
 #include "nsTHashtable.h"
 #include "nsURIHashKey.h"
 #include "nsVoidArray.h"
 #include "nsTArray.h"
 #include "nsInterfaceHashtable.h"
-#include "ChromeTypes.h"
 
 struct PRFileDesc;
 class nsIAtom;
 class nsIDOMWindowInternal;
 class nsILocalFile;
 class nsIPrefBranch;
 class nsIRDFDataSource;
 class nsIRDFResource;
 class nsIRDFService;
 class nsISimpleEnumerator;
 class nsIURL;
 
-namespace mozilla {
-namespace dom {
-  class TabParent;
-  class ContentProcessParent;
-}
-}
-
 // for component registration
 // {47049e42-1d87-482a-984d-56ae185e367a}
 #define NS_CHROMEREGISTRY_CID \
 { 0x47049e42, 0x1d87, 0x482a, { 0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a } }
 
 class nsChromeRegistry : public nsIToolkitChromeRegistry,
 #ifdef MOZ_XUL
                          public nsIXULOverlayProvider,
@@ -104,59 +96,30 @@ public:
   // nsChromeRegistry methods:
   nsChromeRegistry() : mInitialized(PR_FALSE), mProfileLoaded(PR_FALSE) {
     mPackagesHash.ops = nsnull;
   }
   ~nsChromeRegistry();
 
   nsresult Init();
 
-  static nsChromeRegistry* GetService();
-
   static nsChromeRegistry* gChromeRegistry;
 
   static nsresult Canonify(nsIURL* aChromeURL);
 
-  void SendRegisteredChrome(mozilla::dom::ContentProcessParent* aChild);
-  void RegisterRemoteChrome(const nsTArray<ChromePackage>& aPackages,
-                            const nsTArray<ChromeResource>& aResources);
-
-  void SendRegisteredPackages(mozilla::dom::TabParent* aChild);
-  void RegisterPackage(const nsString& aPackage,
-                       const nsString& aBaseURI,
-                       const PRUint32& aFlags);
-  void RegisterResource(const nsString& aPackage,
-                        const nsString& aResolvedURI);
-  static PLDHashOperator SendAllToChildProcess(PLDHashTable *table,
-                                               PLDHashEntryHdr *entry,
-                                               PRUint32 number, void *arg);
-  static PLDHashOperator SendResourceToChildProcess(const nsACString& aKey,
-                                                    nsIURI* aURI, void* aArg);
-
 protected:
   nsresult GetDynamicInfo(nsIURI *aChromeURL, PRBool aIsOverlay, nsISimpleEnumerator **aResult);
 
   nsresult LoadInstallDataSource();
   nsresult LoadProfileDataSource();
 
   void FlushSkinCaches();
   void FlushAllCaches();
 
 private:
-#ifdef MOZ_IPC
-  void RegisterPackage(const ChromePackage& aPackage);
-  void RegisterResource(const ChromeResource& aResource);
-  static PLDHashOperator CollectPackages(PLDHashTable *table,
-                                         PLDHashEntryHdr *entry,
-                                         PRUint32 number, void *arg);
-  static PLDHashOperator CollectResources(const nsACString& aKey,
-                                          nsIURI* aURI, void* aArg);
-#endif
-  
-
   nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
 
   static nsresult RefreshWindow(nsIDOMWindowInternal* aWindow);
   static nsresult GetProviderAndPath(nsIURL* aChromeURL,
                                      nsACString& aProvider, nsACString& aPath);
 
 #ifdef MOZ_XUL
   NS_HIDDEN_(void) ProcessProvider(PRFileDesc *fd, nsIRDFService* aRDFs,
--- a/configure.in
+++ b/configure.in
@@ -5080,27 +5080,26 @@ then
     MOZ_ARG_WITH_STRING(qtdir,
     [  --with-qtdir=\$dir       Specify Qt directory ],
     [ QTDIR=$withval])
 
     if test -z "$QTDIR"; then
         PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore)
         AC_CHECK_PROGS(HOST_MOC, moc, "")
     else
-        MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml"
+        MOZ_QT_LIBS="-L$QTDIR/qt/lib/ -lQtGui -lQtNetwork -lQtCore"
 
         MOZ_QT_CFLAGS="-DQT_SHARED"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDBus"
-        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
-        HOST_MOC="$QTDIR/bin/moc"
+        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/qt/include"
+        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/qt/include/Qt"
+        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/qt/include/QtGui"
+        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/qt/include/QtCore"
+        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/qt/include/QtNetwork"
+
+        HOST_MOC="$QTDIR/qt/bin/moc"
     fi
     if test -z "$HOST_MOC"; then
         AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
 incorrect])
     fi
     MOC=$HOST_MOC
 fi
 
--- a/content/base/src/nsFrameLoader.cpp
+++ b/content/base/src/nsFrameLoader.cpp
@@ -114,18 +114,16 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 #endif
 
 #ifdef MOZ_IPC
 #include "ContentProcessParent.h"
 #include "TabParent.h"
 
-#include "nsXULAppAPI.h"
-
 using namespace mozilla;
 using namespace mozilla::dom;
 #endif
 
 class nsAsyncDocShellDestroyer : public nsRunnable
 {
 public:
   nsAsyncDocShellDestroyer(nsIDocShell* aDocShell)
@@ -1503,37 +1501,30 @@ nsFrameLoader::TryNewProcess()
   mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
 
   if (!value.LowerCaseEqualsLiteral("content") &&
       !StringBeginsWith(value, NS_LITERAL_STRING("content-"),
                         nsCaseInsensitiveStringComparator())) {
     return false;
   }
 
-  ContentProcessParent* parent = ContentProcessParent::GetSingleton();
-  NS_ASSERTION(parent->IsAlive(), "Process parent should be alive; something is very wrong!");
-  mChildProcess = parent->CreateTab();
-
+  mChildProcess = ContentProcessParent::GetSingleton()->CreateTab();
   if (mChildProcess) {
     nsCOMPtr<nsIDOMElement> element = do_QueryInterface(mOwnerContent);
     mChildProcess->SetOwnerElement(element);
 
     nsCOMPtr<nsIDocShellTreeItem> rootItem;
     parentAsItem->GetRootTreeItem(getter_AddRefs(rootItem));
     nsCOMPtr<nsIDOMWindow> rootWin = do_GetInterface(rootItem);
     nsCOMPtr<nsIDOMChromeWindow> rootChromeWin = do_QueryInterface(rootWin);
     NS_ABORT_IF_FALSE(rootChromeWin, "How did we not get a chrome window here?");
 
     nsCOMPtr<nsIBrowserDOMWindow> browserDOMWin;
     rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
     mChildProcess->SetBrowserDOMWindow(browserDOMWin);
-
-    mChildHost = parent;
-
-    XRE_SendParentChromeRegistry(mChildProcess);
   }
   return true;
 }
 #endif
 
 #ifdef MOZ_IPC
 mozilla::dom::PIFrameEmbeddingParent*
 nsFrameLoader::GetChildProcess()
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -184,17 +184,16 @@ private:
   PRPackedBool mDestroyCalled : 1;
   PRPackedBool mNeedsAsyncDestroy : 1;
   PRPackedBool mInSwap : 1;
 
 #ifdef MOZ_IPC
   PRPackedBool mRemoteWidgetCreated : 1;
   bool mRemoteFrame;
   // XXX leaking
-  nsCOMPtr<nsIObserver> mChildHost;
   mozilla::dom::TabParent* mChildProcess;
 
 #ifdef MOZ_WIDGET_GTK2
   GtkWidget* mRemoteSocket;
 #elif defined(MOZ_WIDGET_QT)
   QX11EmbedContainer* mRemoteSocket;
 #endif
 #endif
deleted file mode 100644
--- a/content/canvas/public/DocumentRendererShmemChild.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef mozilla_dom_DocumentRendererShmemChild
-#define mozilla_dom_DocumentRendererShmemChild
-
-#include "mozilla/ipc/PDocumentRendererShmemChild.h"
-
-class nsIDOMWindow;
-class gfxMatrix;
-
-namespace mozilla {
-namespace ipc {
-
-class DocumentRendererShmemChild : public PDocumentRendererShmemChild
-{
-public:
-    DocumentRendererShmemChild();
-    virtual ~DocumentRendererShmemChild();
-
-    bool RenderDocument(nsIDOMWindow *window, const PRInt32& x,
-                        const PRInt32& y, const PRInt32& w,
-                        const PRInt32& h, const nsString& aBGColor,
-                        const PRUint32& flags, const PRBool& flush,
-			const gfxMatrix &aMatrix,
-                        const PRInt32& bufw, const PRInt32& bufh,
-                        Shmem& data);
-
-private:
-
-    DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererShmemChild);
-};
-
-}
-}
-
-#endif
deleted file mode 100644
--- a/content/canvas/public/DocumentRendererShmemParent.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef mozilla_dom_DocumentRendererShmemParent
-#define mozilla_dom_DocumentRendererShmemParent
-
-#include "mozilla/ipc/PDocumentRendererShmemParent.h"
-#include "nsICanvasRenderingContextInternal.h"
-#include "nsCOMPtr.h"
-
-namespace mozilla {
-namespace ipc {
-
-class DocumentRendererShmemParent : public PDocumentRendererShmemParent
-{
-public:
-    DocumentRendererShmemParent();
-    virtual ~DocumentRendererShmemParent();
-
-    void SetCanvas(nsICanvasRenderingContextInternal* aCanvas);
-    virtual bool Recv__delete__(const PRInt32& x, const PRInt32& y,
-                                const PRInt32& w, const PRInt32& h,
-                                Shmem& data);
-
-private:
-    nsCOMPtr<nsICanvasRenderingContextInternal> mCanvas;
-
-    DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererShmemParent);
-};
-
-}
-}
-
-#endif
--- a/content/canvas/public/Makefile.in
+++ b/content/canvas/public/Makefile.in
@@ -51,17 +51,15 @@ EXPORTS		= \
 		nsICanvasRenderingContextInternal.h \
 		nsICanvasElement.h \
 		WebGLArray.h \
 		$(NULL)
 
 EXPORTS_mozilla/ipc = \
 		DocumentRendererChild.h \
 		DocumentRendererParent.h \
-		DocumentRendererShmemChild.h \
-		DocumentRendererShmemParent.h \
 		$(NULL)
 
 XPIDLSRCS	= \
 		nsICanvasGLPrivate.idl \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
--- a/content/canvas/public/nsICanvasRenderingContextInternal.h
+++ b/content/canvas/public/nsICanvasRenderingContextInternal.h
@@ -39,29 +39,23 @@
 #define nsICanvasRenderingContextInternal_h___
 
 #include "nsISupports.h"
 #include "nsICanvasElement.h"
 #include "nsIInputStream.h"
 #include "nsIDocShell.h"
 #include "gfxPattern.h"
 
-// {3c4632ab-8443-4082-a8a310e7cfba4c74}
+// {ed741c16-4039-469b-91da-dca742c51a9f}
 #define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \
-  { 0x3c4632ab, 0x8443, 0x4082, { 0xa8, 0xa3, 0x10, 0xe7, 0xcf, 0xba, 0x4c, 0x74 } }
+  { 0xed741c16, 0x4039, 0x469b, { 0x91, 0xda, 0xdc, 0xa7, 0x42, 0xc5, 0x1a, 0x9f } }
 
 class gfxContext;
 class gfxASurface;
 
-namespace mozilla {
-namespace ipc {
-class Shmem;
-}
-}
-
 class nsICanvasRenderingContextInternal : public nsISupports {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASRENDERINGCONTEXTINTERNAL_IID)
 
   // This method should NOT hold a ref to aParentCanvas; it will be called
   // with nsnull when the element is going away.
   NS_IMETHOD SetCanvasElement(nsICanvasElement* aParentCanvas) = 0;
 
@@ -91,25 +85,14 @@ public:
   // If this context is opaque, the backing store of the canvas should
   // be created as opaque; all compositing operators should assume the
   // dst alpha is always 1.0.  If this is never called, the context
   // defaults to false (not opaque).
   NS_IMETHOD SetIsOpaque(PRBool isOpaque) = 0;
 
   // Redraw the dirty rectangle of this canvas.
   NS_IMETHOD Redraw(const gfxRect &dirty) = 0;
-
-  // If this context can be set to use Mozilla's Shmem segments as its backing
-  // store, this will set it to that state. Note that if you have drawn
-  // anything into this canvas before changing the shmem state, it will be
-  // lost.
-  NS_IMETHOD SetIsShmem(PRBool isShmem) = 0;
-
-  // Swap this back buffer with the front, and copy its contents to the new
-  // back. x, y, w, and h specify the area of |back| that is dirty.
-  NS_IMETHOD Swap(mozilla::ipc::Shmem &back,
-                  PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal,
                               NS_ICANVASRENDERINGCONTEXTINTERNAL_IID)
 
 #endif /* nsICanvasRenderingContextInternal_h___ */
deleted file mode 100644
--- a/content/canvas/src/DocumentRendererShmemChild.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "base/basictypes.h"
-
-#include "gfxImageSurface.h"
-#include "gfxPattern.h"
-#include "nsPIDOMWindow.h"
-#include "nsIDOMWindow.h"
-#include "nsIDOMDocument.h"
-#include "nsIDocShell.h"
-#include "nsIDocShellTreeNode.h"
-#include "nsIDocShellTreeItem.h"
-#include "nsIDocument.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsComponentManagerUtils.h"
-#include "nsCSSParser.h"
-#include "nsPresContext.h"
-#include "nsCOMPtr.h"
-#include "nsColor.h"
-#include "gfxContext.h"
-#include "gfxImageSurface.h"
-#include "nsLayoutUtils.h"
-
-#include "mozilla/ipc/DocumentRendererShmemChild.h"
-
-using namespace mozilla::ipc;
-
-DocumentRendererShmemChild::DocumentRendererShmemChild()
-{}
-
-DocumentRendererShmemChild::~DocumentRendererShmemChild()
-{}
-
-static void
-FlushLayoutForTree(nsIDOMWindow* aWindow)
-{
-    nsCOMPtr<nsPIDOMWindow> piWin = do_QueryInterface(aWindow);
-    if (!piWin)
-        return;
-
-    // Note that because FlushPendingNotifications flushes parents, this
-    // is O(N^2) in docshell tree depth.  However, the docshell tree is
-    // usually pretty shallow.
-
-    nsCOMPtr<nsIDOMDocument> domDoc;
-    aWindow->GetDocument(getter_AddRefs(domDoc));
-    nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
-    if (doc) {
-        doc->FlushPendingNotifications(Flush_Layout);
-    }
-
-    nsCOMPtr<nsIDocShellTreeNode> node =
-        do_QueryInterface(piWin->GetDocShell());
-    if (node) {
-        PRInt32 i = 0, i_end;
-        node->GetChildCount(&i_end);
-        for (; i < i_end; ++i) {
-            nsCOMPtr<nsIDocShellTreeItem> item;
-            node->GetChildAt(i, getter_AddRefs(item));
-            nsCOMPtr<nsIDOMWindow> win = do_GetInterface(item);
-            if (win) {
-                FlushLayoutForTree(win);
-            }
-        }
-    }
-}
-
-bool
-DocumentRendererShmemChild::RenderDocument(nsIDOMWindow *window, const PRInt32& x,
-                                      const PRInt32& y, const PRInt32& w,
-                                      const PRInt32& h, const nsString& aBGColor,
-                                      const PRUint32& flags, const PRBool& flush,
-				      const gfxMatrix &aMatrix,
-                                      const PRInt32& bufw, const PRInt32& bufh,
-                                      Shmem& data)
-{
-    if (flush)
-        FlushLayoutForTree(window);
-
-    nsCOMPtr<nsPresContext> presContext;
-    nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(window);
-    if (win) {
-        nsIDocShell* docshell = win->GetDocShell();
-        if (docshell) {
-            docshell->GetPresContext(getter_AddRefs(presContext));
-        }
-    }
-    if (!presContext)
-        return false;
-
-    nscolor bgColor;
-    nsCSSParser parser;
-    nsresult rv = parser.ParseColorString(PromiseFlatString(aBGColor),
-					  nsnull, 0, &bgColor);
-    if (NS_FAILED(rv))
-        return false;
-
-    nsIPresShell* presShell = presContext->PresShell();
-
-    nsRect r(x, y, w, h);
-
-    // Draw directly into the output array.
-    nsRefPtr<gfxImageSurface> surf = new gfxImageSurface(data.get<PRUint8>(),
-                                                         gfxIntSize(bufw, bufh),
-                                                         4 * bufw,
-                                                         gfxASurface::ImageFormatARGB32);
-    nsRefPtr<gfxContext> ctx = new gfxContext(surf);
-    ctx->SetMatrix(aMatrix);
-
-    presShell->RenderDocument(r, flags, bgColor, ctx);
-    return true;
-}
deleted file mode 100644
--- a/content/canvas/src/DocumentRendererShmemParent.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Fennec Electrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "mozilla/ipc/DocumentRendererShmemParent.h"
-
-using namespace mozilla::ipc;
-
-DocumentRendererShmemParent::DocumentRendererShmemParent()
-{}
-
-DocumentRendererShmemParent::~DocumentRendererShmemParent()
-{}
-
-void
-DocumentRendererShmemParent::SetCanvas(nsICanvasRenderingContextInternal* aCanvas)
-{
-    mCanvas = aCanvas;
-}
-
-bool
-DocumentRendererShmemParent::Recv__delete__(const PRInt32& x, const PRInt32& y,
-                                            const PRInt32& w, const PRInt32& h,
-                                            Shmem& data)
-{
-    mCanvas->Swap(data, x, y, w, h);
-    return true;
-}
--- a/content/canvas/src/Makefile.in
+++ b/content/canvas/src/Makefile.in
@@ -55,18 +55,16 @@ CPPSRCS	= \
 	CanvasUtils.cpp \
 	nsCanvasRenderingContext2D.cpp \
 	$(NULL)
 
 ifdef MOZ_IPC
 CPPSRCS += \
 	DocumentRendererParent.cpp \
 	DocumentRendererChild.cpp \
-	DocumentRendererShmemParent.cpp \
-	DocumentRendererShmemChild.cpp \
 	$(NULL)
 endif
 
 # Canvas 3D Pieces
 
 ifdef MOZ_WEBGL
 
 ifdef MOZ_X11
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -354,16 +354,17 @@ WebGLContext::GetThebesSurface(gfxASurfa
         return NS_ERROR_NOT_AVAILABLE;
     }
 
     *surface = mGLPbuffer->ThebesSurface();
     NS_IF_ADDREF(*surface);
     return NS_OK;
 }
 
+
 //
 // XPCOM goop
 //
 
 NS_IMPL_ADDREF(WebGLContext)
 NS_IMPL_RELEASE(WebGLContext)
 
 NS_INTERFACE_MAP_BEGIN(WebGLContext)
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -238,21 +238,17 @@ public:
     NS_IMETHOD InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height)
         { return NS_ERROR_NOT_IMPLEMENTED; }
     NS_IMETHOD Render(gfxContext *ctx, gfxPattern::GraphicsFilter f);
     NS_IMETHOD GetInputStream(const char* aMimeType,
                               const PRUnichar* aEncoderOptions,
                               nsIInputStream **aStream);
     NS_IMETHOD GetThebesSurface(gfxASurface **surface);
     NS_IMETHOD SetIsOpaque(PRBool b) { return NS_OK; };
-    NS_IMETHOD SetIsShmem(PRBool b) { return NS_OK; }
     NS_IMETHOD Redraw(const gfxRect&) { return NS_ERROR_NOT_IMPLEMENTED; }
-    NS_IMETHOD Swap(mozilla::ipc::Shmem &aBack,
-                    PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h)
-                    { return NS_ERROR_NOT_IMPLEMENTED; }
 
 protected:
     GLES20Wrap *gl;
 
     nsICanvasElement* mCanvasElement;
 
     nsGLPbuffer *mGLPbuffer;
     PRInt32 mWidth, mHeight;
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -111,22 +111,19 @@
 
 #include "nsFrameLoader.h"
 
 #include "nsBidiPresUtils.h"
 
 #include "CanvasUtils.h"
 
 #ifdef MOZ_IPC
-#  include "mozilla/dom/ContentProcessParent.h"
 #  include "mozilla/ipc/PDocumentRendererParent.h"
-#  include "mozilla/ipc/PDocumentRendererShmemParent.h"
 #  include "mozilla/dom/PIFrameEmbeddingParent.h"
 #  include "mozilla/ipc/DocumentRendererParent.h"
-#  include "mozilla/ipc/DocumentRendererShmemParent.h"
 // windows.h (included by chromium code) defines this, in its infinite wisdom
 #  undef DrawText
 #endif
 
 using namespace mozilla;
 
 #ifndef M_PI
 #define M_PI		3.14159265358979323846
@@ -169,38 +166,16 @@ static PRBool FloatValidate (double f1, 
 
 static PRBool FloatValidate (double f1, double f2, double f3, double f4, double f5, double f6) {
     VALIDATE(f1); VALIDATE(f2); VALIDATE(f3); VALIDATE(f4); VALIDATE(f5); VALIDATE(f6);
     return PR_TRUE;
 }
 
 #undef VALIDATE
 
-static void
-CopyContext(gfxContext* dest, gfxContext* src)
-{
-    dest->Multiply(src->CurrentMatrix());
-
-    nsRefPtr<gfxPath> path = src->CopyPath();
-    dest->NewPath();
-    dest->AppendPath(path);
-
-    nsRefPtr<gfxPattern> pattern = src->GetPattern();
-    dest->SetPattern(pattern);
-
-    dest->SetLineWidth(src->CurrentLineWidth());
-    dest->SetLineCap(src->CurrentLineCap());
-    dest->SetLineJoin(src->CurrentLineJoin());
-    dest->SetMiterLimit(src->CurrentMiterLimit());
-    dest->SetFillRule(src->CurrentFillRule());
-
-    dest->SetAntialiasMode(src->CurrentAntialiasMode());
-}
-
-
 /**
  ** nsCanvasGradient
  **/
 #define NS_CANVASGRADIENT_PRIVATE_IID \
     { 0x491d39d8, 0x4058, 0x42bd, { 0xac, 0x76, 0x70, 0xd5, 0x62, 0x7f, 0x02, 0x10 } }
 class nsCanvasGradient : public nsIDOMCanvasGradient
 {
 public:
@@ -359,23 +334,18 @@ public:
     NS_IMETHOD SetDimensions(PRInt32 width, PRInt32 height);
     NS_IMETHOD InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, PRInt32 width, PRInt32 height);
     NS_IMETHOD Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter);
     NS_IMETHOD GetInputStream(const char* aMimeType,
                               const PRUnichar* aEncoderOptions,
                               nsIInputStream **aStream);
     NS_IMETHOD GetThebesSurface(gfxASurface **surface);
     NS_IMETHOD SetIsOpaque(PRBool isOpaque);
-    NS_IMETHOD SetIsShmem(PRBool isShmem);
     // this rect is in CSS pixels
     NS_IMETHOD Redraw(const gfxRect &r);
-    // Swap this back buffer with the front, and copy its contents to the new back.
-    // x, y, w, and h specify the area of |back| that is dirty.
-    NS_IMETHOD Swap(mozilla::ipc::Shmem &back, PRInt32 x, PRInt32 y, 
-                    PRInt32 w, PRInt32 h);
 
     // nsISupports interface
     NS_DECL_ISUPPORTS
 
     // nsIDOMCanvasRenderingContext2D interface
     NS_DECL_NSIDOMCANVASRENDERINGCONTEXT2D
 
     enum Style {
@@ -430,32 +400,16 @@ protected:
      */
     void EnsurePremultiplyTable();
 
     // Member vars
     PRInt32 mWidth, mHeight;
     PRPackedBool mValid;
     PRPackedBool mOpaque;
 
-#ifdef MOZ_IPC
-    PRPackedBool mShmem;
-
-    // We always have a front buffer. We hand the back buffer to the other
-    // process to render to, and then swap our two buffers when it finishes.
-    mozilla::ipc::Shmem mFrontBuffer;
-    mozilla::ipc::Shmem mBackBuffer;
-    nsRefPtr<gfxASurface> mFrontSurface;
-    nsRefPtr<gfxASurface> mBackSurface;
-
-    // Creates a new mFrontBuffer and mBackBuffer of the correct size.
-    // Returns false if this wasn't possible, for whatever reason.
-    bool CreateShmemSegments(PRInt32 width, PRInt32 height,
-                             gfxASurface::gfxImageFormat format);
-#endif
-
     // the canvas element informs us when it's going away,
     // so these are not nsCOMPtrs
     nsICanvasElement* mCanvasElement;
 
     // If mCanvasElement is not provided, then a docshell is
     nsCOMPtr<nsIDocShell> mDocShell;
 
     // yay thebes
@@ -738,17 +692,17 @@ NS_NewCanvasRenderingContext2D(nsIDOMCan
     if (!ctx)
         return NS_ERROR_OUT_OF_MEMORY;
 
     *aResult = ctx.forget().get();
     return NS_OK;
 }
 
 nsCanvasRenderingContext2D::nsCanvasRenderingContext2D()
-    : mValid(PR_FALSE), mOpaque(PR_FALSE), mShmem(PR_FALSE), mCanvasElement(nsnull),
+    : mValid(PR_FALSE), mOpaque(PR_FALSE), mCanvasElement(nsnull),
       mSaveCount(0), mIsEntireFrameInvalid(PR_FALSE), mInvalidateCount(0),
       mLastStyle(STYLE_MAX), mStyleStack(20)
 {
     sNumLivingContexts++;
 }
 
 nsCanvasRenderingContext2D::~nsCanvasRenderingContext2D()
 {
@@ -946,63 +900,35 @@ nsCanvasRenderingContext2D::Redraw(const
         return NS_OK;
 
     if (++mInvalidateCount > kCanvasMaxInvalidateCount)
         return Redraw();
 
     return mCanvasElement->InvalidateFrameSubrect(r);
 }
 
-#ifdef MOZ_IPC
-bool
-nsCanvasRenderingContext2D::CreateShmemSegments(PRInt32 width, PRInt32 height,
-                                                gfxASurface::gfxImageFormat format)
-{
-    if (!mozilla::dom::ContentProcessParent::GetSingleton()->
-                AllocShmem(width * height * 4, &mFrontBuffer))
-        return false;
-    if (!mozilla::dom::ContentProcessParent::GetSingleton()->
-                AllocShmem(width * height * 4, &mBackBuffer))
-        return false;
-
-    mBackSurface = new gfxImageSurface(mBackBuffer.get<unsigned char>(),
-                                       gfxIntSize(width, height),
-                                       width * 4, format);
-    mFrontSurface = new gfxImageSurface(mFrontBuffer.get<unsigned char>(),
-                                        gfxIntSize(width, height),
-                                        width * 4, format);
-
-    return true;
-}
-#endif
-
 NS_IMETHODIMP
 nsCanvasRenderingContext2D::SetDimensions(PRInt32 width, PRInt32 height)
 {
     Destroy();
 
     nsRefPtr<gfxASurface> surface;
 
     // Check that the dimensions are sane
     if (gfxASurface::CheckSurfaceSize(gfxIntSize(width, height), 0xffff)) {
         gfxASurface::gfxImageFormat format = gfxASurface::ImageFormatARGB32;
         if (mOpaque)
             format = gfxASurface::ImageFormatRGB24;
 
-	
-#ifdef MOZ_IPC
-	if (mShmem)
-	    CreateShmemSegments(width, height, format);
-#endif
-
-	surface = gfxPlatform::GetPlatform()->CreateOffscreenSurface
-	    (gfxIntSize(width, height), format);
-
-        if (surface && surface->CairoStatus() != 0)
-            surface = NULL;
+        surface = gfxPlatform::GetPlatform()->CreateOffscreenSurface
+            (gfxIntSize(width, height), format);
+
+        if (surface->CairoStatus() != 0) {
+          surface = NULL;
+        }
     }
     return InitializeWithSurface(NULL, surface, width, height);
 }
 
 NS_IMETHODIMP
 nsCanvasRenderingContext2D::InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, PRInt32 width, PRInt32 height) {
     Destroy();
 
@@ -1071,89 +997,16 @@ nsCanvasRenderingContext2D::SetIsOpaque(
          */
         return SetDimensions(mWidth, mHeight);
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
-nsCanvasRenderingContext2D::SetIsShmem(PRBool isShmem)
-{
-    if (isShmem == mShmem)
-        return NS_OK;
-
-    mShmem = isShmem;
-
-    if (mValid) {
-        /* If we've already been created, let SetDimensions take care of
-         * recreating our surface
-         */
-        return SetDimensions(mWidth, mHeight);
-    }
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-nsCanvasRenderingContext2D::Swap(mozilla::ipc::Shmem &aBack, 
-                                 PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h)
-{
-#ifndef MOZ_IPC
-    return NS_ERROR_NOT_IMPLEMENTED;
-#else
-    // Our front buffer is always the correct size. If this back buffer doesn't
-    // match the front buffer's size, it's out of date (we've resized since
-    // this message was sent) and we should just ignore it.
-    if (mFrontBuffer.Size<unsigned char>() != aBack.Size<unsigned char>())
-        return NS_OK;
-
-    // Swap back and front.
-    // mBackBuffer should be null here, since we've previously sent it to the
-    // child process.
-    mBackBuffer = mFrontBuffer;
-    mFrontBuffer = aBack;
-
-    // do want mozilla::Swap
-    nsRefPtr<gfxASurface> tmp = mFrontSurface;
-    mFrontSurface = mBackSurface;
-    mBackSurface = tmp;
-
-    nsRefPtr<gfxPattern> pat = new gfxPattern(mFrontSurface);
-
-    mThebes->NewPath();
-    mThebes->PixelSnappedRectangleAndSetPattern(gfxRect(x, y, w, h), pat);
-    mThebes->Fill();
-
-    // get rid of the pattern surface ref
-    mThebes->SetColor(gfxRGBA(1,1,1,1));
-
-    Redraw(gfxRect(x, y, w, h));
-
-    // Copy the new contents to the old to keep them in sync. 
-    memcpy(mBackBuffer.get<unsigned char>(), mFrontBuffer.get<unsigned char>(),
-           mWidth * mHeight * 4);
-
-    // Notify listeners that we've finished drawing
-    nsCOMPtr<nsIContent> content = do_QueryInterface(mCanvasElement);
-    nsIDocument* ownerDoc = nsnull;
-    if (content)
-	ownerDoc = content->GetOwnerDoc();
-
-    if (ownerDoc && mCanvasElement) {
-	nsContentUtils::DispatchTrustedEvent(ownerDoc, mCanvasElement, 
-					     NS_LITERAL_STRING("MozAsyncCanvasRender"),
-					     /* aCanBubble = */ PR_TRUE, /* aCancelable = */ PR_TRUE);
-    }
-
-    return NS_OK;
-#endif
-}
-
-NS_IMETHODIMP
 nsCanvasRenderingContext2D::Render(gfxContext *ctx, gfxPattern::GraphicsFilter aFilter)
 {
     nsresult rv = NS_OK;
 
     if (!mValid || !mSurface ||
         mSurface->CairoStatus() ||
         mThebes->HasError())
         return NS_ERROR_FAILURE;
@@ -1678,16 +1531,37 @@ nsCanvasRenderingContext2D::SetShadowCol
 NS_IMETHODIMP
 nsCanvasRenderingContext2D::GetShadowColor(nsAString& color)
 {
     StyleColorToString(CurrentState().colorStyles[STYLE_SHADOW], color);
 
     return NS_OK;
 }
 
+static void
+CopyContext(gfxContext* dest, gfxContext* src)
+{
+    dest->Multiply(src->CurrentMatrix());
+
+    nsRefPtr<gfxPath> path = src->CopyPath();
+    dest->NewPath();
+    dest->AppendPath(path);
+
+    nsRefPtr<gfxPattern> pattern = src->GetPattern();
+    dest->SetPattern(pattern);
+
+    dest->SetLineWidth(src->CurrentLineWidth());
+    dest->SetLineCap(src->CurrentLineCap());
+    dest->SetLineJoin(src->CurrentLineJoin());
+    dest->SetMiterLimit(src->CurrentMiterLimit());
+    dest->SetFillRule(src->CurrentFillRule());
+
+    dest->SetAntialiasMode(src->CurrentAntialiasMode());
+}
+
 static const gfxFloat SIGMA_MAX = 25;
 
 gfxContext*
 nsCanvasRenderingContext2D::ShadowInitialize(const gfxRect& extents, gfxAlphaBoxBlur& blur)
 {
     gfxIntSize blurRadius;
 
     gfxFloat sigma = CurrentState().shadowBlur > 8 ? sqrt(CurrentState().shadowBlur) : CurrentState().shadowBlur / 2;
@@ -3582,47 +3456,21 @@ nsCanvasRenderingContext2D::AsyncDrawXUL
         renderDocFlags &= ~nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING;
     }
 
     PRInt32 x = nsPresContext::CSSPixelsToAppUnits(aX),
             y = nsPresContext::CSSPixelsToAppUnits(aY),
             w = nsPresContext::CSSPixelsToAppUnits(aW),
             h = nsPresContext::CSSPixelsToAppUnits(aH);
 
-    if (mShmem) {
-        if (!mBackBuffer.IsWritable())
-            return NS_ERROR_FAILURE;
-
-        mozilla::ipc::PDocumentRendererShmemParent *pdocrender =
-            child->SendPDocumentRendererShmemConstructor(x, y, w, h,
-                                                         nsString(aBGColor),
-                                                         renderDocFlags, flush,
-							 mThebes->CurrentMatrix(),
-                                                         mWidth, mHeight,
-                                                         mBackBuffer);
-        if (!pdocrender)
-            return NS_ERROR_FAILURE;
-
-        mozilla::ipc::DocumentRendererShmemParent *docrender = 
-            static_cast<mozilla::ipc::DocumentRendererShmemParent *>(pdocrender);
-
-        docrender->SetCanvas(this);
-    } else {
-        mozilla::ipc::PDocumentRendererParent *pdocrender =
-            child->SendPDocumentRendererConstructor(x, y, w, h,
-                                                    nsString(aBGColor),
-                                                    renderDocFlags, flush);
-        if (!pdocrender)
-            return NS_ERROR_FAILURE;
-
-        mozilla::ipc::DocumentRendererParent *docrender =
-            static_cast<mozilla::ipc::DocumentRendererParent *>(pdocrender);
-
-        docrender->SetCanvasContext(this, mThebes);
-    }
+    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;
 
--- a/content/html/content/src/nsHTMLCanvasElement.cpp
+++ b/content/html/content/src/nsHTMLCanvasElement.cpp
@@ -121,18 +121,16 @@ public:
   nsresult CopyInnerTo(nsGenericElement* aDest) const;
 protected:
   nsIntSize GetWidthHeight();
 
   nsresult UpdateContext();
   nsresult ToDataURLImpl(const nsAString& aMimeType,
                          const nsAString& aEncoderOptions,
                          nsAString& aDataURL);
-  nsresult GetContextHelper(const nsAString &aContextId,
-                            nsICanvasRenderingContextInternal **aContext);
 
   nsString mCurrentContextId;
   nsCOMPtr<nsICanvasRenderingContextInternal> mCurrentContext;
   
 public:
   // Record whether this canvas should be write-only or not.
   // We set this when script paints an image from a different origin.
   // We also transitively set it when script paints a canvas which
@@ -409,114 +407,55 @@ nsHTMLCanvasElement::ToDataURLImpl(const
   aDataURL = NS_LITERAL_STRING("data:") + aMimeType +
     NS_LITERAL_STRING(";base64,") + NS_ConvertUTF8toUTF16(encodedImg);
 
   PR_Free(encodedImg);
 
   return NS_OK;
 }
 
-nsresult
-nsHTMLCanvasElement::GetContextHelper(const nsAString &aContextId,
-                                      nsICanvasRenderingContextInternal **aContext)
-{
-  NS_ENSURE_ARG(aContext);
-
-  nsCString ctxId;
-  ctxId.Assign(NS_LossyConvertUTF16toASCII(aContextId));
-
-  // check that ctxId is clamped to A-Za-z0-9_-
-  for (PRUint32 i = 0; i < ctxId.Length(); i++) {
-    if ((ctxId[i] < 'A' || ctxId[i] > 'Z') &&
-        (ctxId[i] < 'a' || ctxId[i] > 'z') &&
-        (ctxId[i] < '0' || ctxId[i] > '9') &&
-        (ctxId[i] != '-') &&
-        (ctxId[i] != '_'))
-    {
-      // XXX ERRMSG we need to report an error to developers here! (bug 329026)
-      return NS_ERROR_INVALID_ARG;
-    }
-  }
-
-  nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id=");
-  ctxString.Append(ctxId);
-
-  nsresult rv;
-  nsCOMPtr<nsICanvasRenderingContextInternal> ctx =
-    do_CreateInstance(nsPromiseFlatCString(ctxString).get(), &rv);
-  if (rv == NS_ERROR_OUT_OF_MEMORY) {
-    *aContext = nsnull;
-    return NS_ERROR_OUT_OF_MEMORY;
-  }
-  if (NS_FAILED(rv)) {
-    *aContext = nsnull;
-    // XXX ERRMSG we need to report an error to developers here! (bug 329026)
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  rv = ctx->SetCanvasElement(this);
-  if (NS_FAILED(rv)) {
-    *aContext = nsnull;
-    return rv;
-  }
-
-  *aContext = ctx.forget().get();
-
-  return rv;
-}
-
 NS_IMETHODIMP
 nsHTMLCanvasElement::GetContext(const nsAString& aContextId,
                                 nsISupports **aContext)
 {
   nsresult rv;
 
   if (mCurrentContextId.IsEmpty()) {
-    rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext));
+    nsCString ctxId;
+    ctxId.Assign(NS_LossyConvertUTF16toASCII(aContextId));
+
+    // check that ctxId is clamped to A-Za-z0-9_-
+    for (PRUint32 i = 0; i < ctxId.Length(); i++) {
+      if ((ctxId[i] < 'A' || ctxId[i] > 'Z') &&
+          (ctxId[i] < 'a' || ctxId[i] > 'z') &&
+          (ctxId[i] < '0' || ctxId[i] > '9') &&
+          (ctxId[i] != '-') &&
+          (ctxId[i] != '_'))
+      {
+        // XXX ERRMSG we need to report an error to developers here! (bug 329026)
+        return NS_ERROR_INVALID_ARG;
+      }
+    }
+
+    nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id=");
+    ctxString.Append(ctxId);
+
+    mCurrentContext = do_CreateInstance(nsPromiseFlatCString(ctxString).get(), &rv);
+    if (rv == NS_ERROR_OUT_OF_MEMORY)
+      return NS_ERROR_OUT_OF_MEMORY;
     if (NS_FAILED(rv))
-      return rv;
+      // XXX ERRMSG we need to report an error to developers here! (bug 329026)
+      return NS_ERROR_INVALID_ARG;
 
-    rv = UpdateContext();
+    rv = mCurrentContext->SetCanvasElement(this);
     if (NS_FAILED(rv)) {
       mCurrentContext = nsnull;
       return rv;
     }
 
-    mCurrentContextId.Assign(aContextId);
-  } else if (!mCurrentContextId.Equals(aContextId)) {
-    //XXX eventually allow for more than one active context on a given canvas
-    return NS_ERROR_INVALID_ARG;
-  }
-
-  NS_ADDREF (*aContext = mCurrentContext);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsHTMLCanvasElement::MozGetShmemContext(const nsAString& aContextId,
-                                        nsISupports **aContext)
-{
-  if(!nsContentUtils::IsCallerTrustedForRead()) {
-    // XXX ERRMSG we need to report an error to developers here! (bug 329026)
-    return NS_ERROR_DOM_SECURITY_ERR;
-  }
-
-  // We only support 2d shmem contexts for now.
-  if (!aContextId.Equals(NS_LITERAL_STRING("2d")))
-    return NS_ERROR_INVALID_ARG;
-
-  nsresult rv;
-
-  if (mCurrentContextId.IsEmpty()) {
-    rv = GetContextHelper(aContextId, getter_AddRefs(mCurrentContext));
-    if (NS_FAILED(rv))
-      return rv;
-
-    mCurrentContext->SetIsShmem(PR_TRUE);
-
     rv = UpdateContext();
     if (NS_FAILED(rv)) {
       mCurrentContext = nsnull;
       return rv;
     }
 
     mCurrentContextId.Assign(aContextId);
   } else if (!mCurrentContextId.Equals(aContextId)) {
--- a/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
+++ b/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl
@@ -42,17 +42,17 @@
  * <canvas> element.
  *
  * For more information on this interface, please see
  * http://www.whatwg.org/specs/web-apps/current-work/#graphics
  *
  * @status UNDER_DEVELOPMENT
  */
 
-[scriptable, uuid(5ef1c2ee-4b3a-4015-8e38-c27ddb306c39)]
+[scriptable, uuid(b5f8239b-2abf-4896-b772-71e1e374a661)]
 interface nsIDOMHTMLCanvasElement : nsIDOMHTMLElement
 {
   attribute long width;
   attribute long height;
   attribute boolean mozOpaque;
 
   nsISupports getContext(in DOMString contextId);
 
@@ -65,14 +65,10 @@ interface nsIDOMHTMLCanvasElement : nsID
                                       [optional] in DOMString params);
 
   // This version lets you specify different image types and pass parameters
   // to the encoder. For example toDataURLAs("image/png", "transparency=none")
   // gives you a PNG with the alpha channel discarded. See the encoder for
   // the options string that it supports. Separate multiple options with
   // semicolons.
   [noscript] DOMString toDataURLAs(in DOMString mimeType, in DOMString encoderOptions);
-
-  // A Mozilla-only extension to get a canvas context backed by double-buffered
-  // shared memory. Only privileged callers can call this.
-  nsISupports MozGetShmemContext(in DOMString contextId);
 };
 
--- a/dom/ipc/ContentProcessChild.cpp
+++ b/dom/ipc/ContentProcessChild.cpp
@@ -36,30 +36,24 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "ContentProcessChild.h"
 #include "TabChild.h"
 
 #include "mozilla/ipc/TestShellChild.h"
 #include "mozilla/net/NeckoChild.h"
-#include "History.h"
 
 #include "nsXULAppAPI.h"
 
-#include "nsDocShellCID.h"
-#include "nsNetUtil.h"
 #include "base/message_loop.h"
 #include "base/task.h"
 
-#include "nsChromeRegistry.h"
-
 using namespace mozilla::ipc;
 using namespace mozilla::net;
-using namespace mozilla::places;
 
 namespace mozilla {
 namespace dom {
 
 ContentProcessChild* ContentProcessChild::sSingleton;
 
 ContentProcessChild::ContentProcessChild()
     : mQuit(PR_FALSE)
@@ -129,25 +123,16 @@ ContentProcessChild::AllocPNecko()
 
 bool 
 ContentProcessChild::DeallocPNecko(PNeckoChild* necko)
 {
     delete necko;
     return true;
 }
 
-bool
-ContentProcessChild::RecvregisterChrome(const nsTArray<ChromePackage>& packages,
-                                        const nsTArray<ChromeResource>& resources)
-{
-    nsChromeRegistry* chromeRegistry = nsChromeRegistry::GetService();
-    chromeRegistry->RegisterRemoteChrome(packages, resources);
-    return true;
-}
-
 void
 ContentProcessChild::Quit()
 {
     NS_ASSERTION(mQuit, "Exiting uncleanly!");
     mIFrames.Clear();
     mTestShells.Clear();
 }
 
@@ -158,29 +143,10 @@ ContentProcessChild::ActorDestroy(ActorD
         NS_WARNING("shutting down because of crash!");
 
     mQuit = PR_TRUE;
     Quit();
 
     XRE_ShutdownChildProcess();
 }
 
-bool
-ContentProcessChild::RecvNotifyVisited(const nsCString& aURISpec, 
-                                       const bool& mIsVisited)
-{
-    nsresult rv;
-
-    // reconstruct our IPDL-passed nsIURI
-    nsCOMPtr<nsIURI> newURI;
-    rv = NS_NewURI(getter_AddRefs(newURI), aURISpec);
-    // Our failure mode is to consider the link unvisited.
-    if (NS_SUCCEEDED(rv)) {
-        History *hs = History::GetSingleton();
-        if (hs) {
-            hs->NotifyVisited(newURI, mIsVisited);
-        }
-    }
-    return true;
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/ContentProcessChild.h
+++ b/dom/ipc/ContentProcessChild.h
@@ -38,17 +38,16 @@
 
 #ifndef mozilla_dom_ContentProcessChild_h
 #define mozilla_dom_ContentProcessChild_h
 
 #include "mozilla/dom/PContentProcessChild.h"
 
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
-#include "mozilla/chrome/ChromeTypes.h"
 
 namespace mozilla {
 namespace dom {
 
 class ContentProcessChild : public PContentProcessChild
 {
 public:
     ContentProcessChild();
@@ -67,24 +66,16 @@ public:
     virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingChild*);
 
     virtual PTestShellChild* AllocPTestShell();
     virtual bool DeallocPTestShell(PTestShellChild*);
 
     virtual PNeckoChild* AllocPNecko();
     virtual bool DeallocPNecko(PNeckoChild*);
 
-    virtual bool RecvDummy(Shmem& foo) { return true; }
-
-    virtual bool RecvregisterChrome(const nsTArray<ChromePackage>& packages,
-                                    const nsTArray<ChromeResource>& resources);
-
-    virtual bool
-    RecvNotifyVisited(const nsCString& aURISpec, const bool& mIsVisited);
-
 private:
     NS_OVERRIDE
     virtual void ActorDestroy(ActorDestroyReason why);
 
     void Quit();
 
     static ContentProcessChild* sSingleton;
 
--- a/dom/ipc/ContentProcessParent.cpp
+++ b/dom/ipc/ContentProcessParent.cpp
@@ -36,44 +36,41 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "ContentProcessParent.h"
 
 #include "TabParent.h"
 #include "mozilla/ipc/TestShellParent.h"
 #include "mozilla/net/NeckoParent.h"
-#include "mozilla/IHistory.h"
 
 #include "nsIObserverService.h"
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
-#include "nsDocShellCID.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
-#include "nsNetUtil.h"
-#include "nsChromeRegistry.h"
 
 using namespace mozilla::ipc;
 using namespace mozilla::net;
 using mozilla::MonitorAutoEnter;
 
+namespace {
+PRBool gSingletonDied = PR_FALSE;
+}
+
 namespace mozilla {
 namespace dom {
 
 ContentProcessParent* ContentProcessParent::gSingleton;
 
 ContentProcessParent*
 ContentProcessParent::GetSingleton()
 {
-    if (gSingleton && !gSingleton->IsAlive())
-        gSingleton = nsnull;
-
-    if (!gSingleton) {
+    if (!gSingleton && !gSingletonDied) {
         nsRefPtr<ContentProcessParent> parent = new ContentProcessParent();
         if (parent) {
             nsCOMPtr<nsIObserverService> obs =
                 do_GetService("@mozilla.org/observer-service;1");
             if (obs) {
                 if (NS_SUCCEEDED(obs->AddObserver(parent, "xpcom-shutdown",
                                                   PR_FALSE))) {
                     gSingleton = parent;
@@ -100,18 +97,16 @@ ContentProcessParent::ActorDestroy(Actor
     if (obs)
         obs->RemoveObserver(static_cast<nsIObserver*>(this), "xpcom-shutdown");
     nsCOMPtr<nsIThreadInternal>
         threadInt(do_QueryInterface(NS_GetCurrentThread()));
     if (threadInt)
         threadInt->SetObserver(mOldObserver);
     if (mRunToCompletionDepth)
         mRunToCompletionDepth = 0;
-
-    mIsAlive = false;
 }
 
 TabParent*
 ContentProcessParent::CreateTab()
 {
   return static_cast<TabParent*>(SendPIFrameEmbeddingConstructor());
 }
 
@@ -125,40 +120,29 @@ bool
 ContentProcessParent::DestroyTestShell(TestShellParent* aTestShell)
 {
     return PTestShellParent::Send__delete__(aTestShell);
 }
 
 ContentProcessParent::ContentProcessParent()
     : mMonitor("ContentProcessParent::mMonitor")
     , mRunToCompletionDepth(0)
-    , mIsAlive(true)
 {
     NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
     mSubprocess = new GeckoChildProcessHost(GeckoProcessType_Content);
     mSubprocess->AsyncLaunch();
     Open(mSubprocess->GetChannel(), mSubprocess->GetChildProcessHandle());
-
-    nsChromeRegistry* chromeRegistry = nsChromeRegistry::GetService();
-    chromeRegistry->SendRegisteredChrome(this);
 }
 
 ContentProcessParent::~ContentProcessParent()
 {
     NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
-    //If the previous content process has died, a new one could have
-    //been started since.
-    if (gSingleton == this)
-        gSingleton = nsnull;
-}
-
-bool
-ContentProcessParent::IsAlive()
-{
-    return mIsAlive;
+    NS_ASSERTION(gSingleton == this, "More than one singleton?!");
+    gSingletonDied = PR_TRUE;
+    gSingleton = nsnull;
 }
 
 NS_IMPL_THREADSAFE_ISUPPORTS2(ContentProcessParent,
                               nsIObserver,
                               nsIThreadObserver)
 
 namespace {
 void
@@ -231,33 +215,16 @@ ContentProcessParent::RequestRunToComple
         printf("Running to completion...\n");
 #endif
         mRunToCompletionDepth = 1;
     }
 
     return !!mRunToCompletionDepth;
 }
 
-bool
-ContentProcessParent::RecvStartVisitedQuery(const nsCString& aURISpec, nsresult* rv)
-{
-    // reconstruct our IPDL-passed nsIURI
-    nsCOMPtr<nsIURI> newURI;
-    *rv = NS_NewURI(getter_AddRefs(newURI), aURISpec);
-    if (NS_SUCCEEDED(*rv)) {
-        nsCOMPtr<IHistory> history = do_GetService(NS_IHISTORY_CONTRACTID);
-        if (history) {
-            *rv = history->RegisterVisitedCallback(newURI, nsnull);
-        }
-    } else {
-        *rv = NS_ERROR_UNEXPECTED; 
-    }  
-    return true;
-}
-
 /* void onDispatchedEvent (in nsIThreadInternal thread); */
 NS_IMETHODIMP
 ContentProcessParent::OnDispatchedEvent(nsIThreadInternal *thread)
 {
     if (mOldObserver)
         return mOldObserver->OnDispatchedEvent(thread);
 
     return NS_OK;
--- a/dom/ipc/ContentProcessParent.h
+++ b/dom/ipc/ContentProcessParent.h
@@ -80,18 +80,16 @@ public:
 
     TabParent* CreateTab();
 
     TestShellParent* CreateTestShell();
     bool DestroyTestShell(TestShellParent* aTestShell);
 
     bool RequestRunToCompletion();
 
-    bool IsAlive();
-
 protected:
     virtual void ActorDestroy(ActorDestroyReason why);
 
 private:
     static ContentProcessParent* gSingleton;
 
     // Hide the raw constructor methods since we don't want client code
     // using them.
@@ -105,24 +103,21 @@ private:
     virtual bool DeallocPIFrameEmbedding(PIFrameEmbeddingParent* frame);
 
     virtual PTestShellParent* AllocPTestShell();
     virtual bool DeallocPTestShell(PTestShellParent* shell);
 
     virtual PNeckoParent* AllocPNecko();
     virtual bool DeallocPNecko(PNeckoParent* necko);
 
-    virtual bool RecvStartVisitedQuery(const nsCString& aURISpec, nsresult* rv);
-
     mozilla::Monitor mMonitor;
 
     GeckoChildProcessHost* mSubprocess;
 
     int mRunToCompletionDepth;
     nsCOMPtr<nsIThreadObserver> mOldObserver;
 
-    bool mIsAlive;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif
--- a/dom/ipc/Makefile.in
+++ b/dom/ipc/Makefile.in
@@ -54,32 +54,29 @@ EXPORTS_NAMESPACES = mozilla mozilla/dom
 EXPORTS_mozilla = \
   TabTypes.h \
   $(NULL)
 
 EXPORTS_mozilla/dom = \
   ContentProcessChild.h \
   ContentProcessParent.h \
   ContentProcessThread.h \
-  TabParent.h \
   $(NULL)
 
 CPPSRCS = \
   ContentProcessThread.cpp \
   ContentProcessParent.cpp \
   ContentProcessChild.cpp \
   TabParent.cpp \
   TabChild.cpp \
   TabMessageUtils.cpp \
   $(NULL)
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
-		-I$(srcdir)/../../toolkit/components/places/src \
 		-I$(srcdir)/../../content/base/src \
 		-I$(srcdir)/../../content/events/src \
-		-I$(topsrcdir)/chrome/src \
 		$(NULL)
 
 DEFINES += -DBIN_SUFFIX='"$(BIN_SUFFIX)"'
--- a/dom/ipc/PContentProcess.ipdl
+++ b/dom/ipc/PContentProcess.ipdl
@@ -36,42 +36,29 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 include protocol "PIFrameEmbedding.ipdl";
 include protocol "PTestShell.ipdl";
 include protocol "PNecko.ipdl";
 
 include "mozilla/TabTypes.h";
-include "mozilla/chrome/ChromeTypes.h";
-include "mozilla/chrome/RegistryMessageUtils.h";
-
-using ChromePackage;
-using ChromeResource;
 
 namespace mozilla {
 namespace dom {
 
 rpc protocol PContentProcess
 {
     manages PIFrameEmbedding;
     manages PTestShell;
     manages PNecko;
 
 child:
     PIFrameEmbedding();
 
     PTestShell();
 
-    registerChrome(ChromePackage[] packages, ChromeResource[] resources);
-
-    // A dummy message to make sure PContentProcess contains methods to create
-    // Shmem segments.
-    async Dummy(Shmem foo);
-    async NotifyVisited(nsCString aURISpec, bool mIsVisited);
-
 parent:
     PNecko();
-    sync StartVisitedQuery(nsCString aURISpec) returns (nsresult rv);
 };
 
 }
 }
--- a/dom/ipc/PDocumentRenderer.ipdl
+++ b/dom/ipc/PDocumentRenderer.ipdl
@@ -40,14 +40,13 @@ include protocol "PIFrameEmbedding.ipdl"
 namespace mozilla {
 namespace ipc {
 
 protocol PDocumentRenderer
 {
   manager PIFrameEmbedding;
 
 parent:
-    // Returns the width and height, in pixels, of the returned ARGB32 data.
     __delete__(PRUint32 w, PRUint32 h, nsCString data);
 };
 
 } // namespace ipc
 } // namespace mozilla
deleted file mode 100644
--- a/dom/ipc/PDocumentRendererShmem.ipdl
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Fenntrolysis.
- *
- * The Initial Developer of the Original Code is
- *   The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-include protocol "PIFrameEmbedding.ipdl";
-
-namespace mozilla {
-namespace ipc {
-
-protocol PDocumentRendererShmem
-{
-  manager PIFrameEmbedding;
-
-parent:
-    // Returns the offset, width and height, in pixels, of the area in the
-    // buffer that was drawn.
-    __delete__(PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h, Shmem data);
-};
-
-} // namespace ipc
-} // namespace mozilla
--- a/dom/ipc/PIFrameEmbedding.ipdl
+++ b/dom/ipc/PIFrameEmbedding.ipdl
@@ -34,33 +34,30 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 include protocol "PContentProcess.ipdl";
 include protocol "PDocumentRenderer.ipdl";
-include protocol "PDocumentRendererShmem.ipdl";
 
 include "mozilla/TabTypes.h";
 include "TabMessageUtils.h";
 
 using MagicWindowHandle;
 using RemoteDOMEvent;
-using gfxMatrix;
 
 namespace mozilla {
 namespace dom {
 
 rpc protocol PIFrameEmbedding
 {
     manager PContentProcess;
     manages PDocumentRenderer;
-    manages PDocumentRendererShmem;
 
 child:
     __delete__();
 
 parent:
     /**
      * When child sends this message, parent should move focus to
      * the next or previous focusable element.
@@ -113,21 +110,12 @@ child:
      */
     activateFrameEvent(nsString aType, bool capture);
 
     loadRemoteScript(nsString aURL);
 
     sendAsyncMessageToChild(nsString aMessage, nsString aJSON);
 
     PDocumentRenderer(PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h, nsString bgcolor, PRUint32 flags, bool flush);
-
-    // @param matrix the transformation matrix the context we're going to draw into should have.
-    // @param bufw the width of @buf, in pixels
-    // @param bufh the height of @buf, in pixels
-    PDocumentRendererShmem(PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h, nsString bgcolor, PRUint32 flags, bool flush,
-                           gfxMatrix matrix, PRInt32 bufw, PRInt32 bufh, Shmem buf);
-
-    registerChromePackage(nsString aPackage, nsString aBaseURI, PRUint32 aFlags);
-    registerChromeResource(nsString aPackage, nsString aResolvedURI);
 };
 
 }
 }
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -42,39 +42,35 @@
 #include "nsEmbedCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIBaseWindow.h"
 #include "nsIDOMWindow.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsThreadUtils.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "mozilla/ipc/DocumentRendererChild.h"
-#include "mozilla/ipc/DocumentRendererShmemChild.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMWindowUtils.h"
 #include "nsISupportsImpl.h"
 #include "nsIWebBrowserFocus.h"
 #include "nsIDOMEvent.h"
 #include "nsIPrivateDOMEvent.h"
-#include "nsXULAppAPI.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
 #include "nsIJSRuntimeService.h"
 #include "nsContentUtils.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIXPCSecurityManager.h"
 #include "nsIJSContextStack.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsScriptLoader.h"
 #include "nsPIWindowRoot.h"
 #include "nsIScriptContext.h"
-#include "nsXULAppAPI.h"
-#include "nsPresContext.h"
 
 #ifdef MOZ_WIDGET_QT
 #include <QX11EmbedWidget>
 #include <QApplication>
 #include <QGraphicsView>
 #include <QGraphicsWidget>
 #endif
 
@@ -499,99 +495,16 @@ TabChild::RecvPDocumentRendererConstruct
     bool ret = render->RenderDocument(window, aX, aY, aW, aH, bgcolor, flags, flush,
                                       width, height, data);
     if (!ret)
         return true; // silently ignore
 
     return PDocumentRendererChild::Send__delete__(__a, width, height, data);
 }
 
-mozilla::ipc::PDocumentRendererShmemChild*
-TabChild::AllocPDocumentRendererShmem(
-        const PRInt32& x,
-        const PRInt32& y,
-        const PRInt32& w,
-        const PRInt32& h,
-        const nsString& bgcolor,
-        const PRUint32& flags,
-        const bool& flush,
-	const gfxMatrix& aMatrix,
-        const PRInt32& bufw,
-        const PRInt32& bufh,
-        Shmem& buf)
-{
-    return new mozilla::ipc::DocumentRendererShmemChild();
-}
-
-bool
-TabChild::DeallocPDocumentRendererShmem(PDocumentRendererShmemChild* actor)
-{
-    delete actor;
-    return true;
-}
-
-bool
-TabChild::RecvPDocumentRendererShmemConstructor(
-        mozilla::ipc::PDocumentRendererShmemChild *__a,
-        const PRInt32& aX,
-        const PRInt32& aY,
-        const PRInt32& aW,
-        const PRInt32& aH,
-        const nsString& bgcolor,
-        const PRUint32& flags,
-        const bool& flush,
-	const gfxMatrix& aMatrix,
-        const PRInt32& aBufW,
-        const PRInt32& aBufH,
-        Shmem& aBuf)
-{
-    mozilla::ipc::DocumentRendererShmemChild *render = 
-        static_cast<mozilla::ipc::DocumentRendererShmemChild *>(__a);
-
-    nsCOMPtr<nsIWebBrowser> browser = do_QueryInterface(mWebNav);
-    if (!browser)
-        return true; // silently ignore
-    nsCOMPtr<nsIDOMWindow> window;
-    if (NS_FAILED(browser->GetContentDOMWindow(getter_AddRefs(window))) ||
-        !window)
-    {
-        return true; // silently ignore
-    }
-
-    render->RenderDocument(window, aX, aY, aW, aH, bgcolor, flags, flush,
-                           aMatrix, aBufW, aBufH, aBuf);
-
-    gfxRect dirtyArea(0, 0, nsPresContext::AppUnitsToIntCSSPixels(aW), 
-		      nsPresContext::AppUnitsToIntCSSPixels(aH));
-
-    dirtyArea = aMatrix.Transform(dirtyArea);
-
-    return PDocumentRendererShmemChild::Send__delete__(__a, dirtyArea.X(), dirtyArea.Y(), 
-						       dirtyArea.Width(), dirtyArea.Height(),
-                                                       aBuf);
-}
-
-
-bool
-TabChild::RecvregisterChromePackage(const nsString& aPackage,
-                                    const nsString& aBaseURI,
-                                    const PRUint32& aFlags)
-{
-	XRE_RegisterChromePackage(aPackage, aBaseURI, aFlags);
-	return true;
-}
-
-bool
-TabChild::RecvregisterChromeResource(const nsString& aPackage,
-                                     const nsString& aResolvedURI)
-{
-	XRE_RegisterChromeResource(aPackage, aResolvedURI);
-	return true;
-}
-
 bool
 TabChild::RecvactivateFrameEvent(const nsString& aType, const bool& capture)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(mWebNav);
   NS_ENSURE_TRUE(window, true);
   nsCOMPtr<nsIDOMEventTarget> chromeHandler =
     do_QueryInterface(window->GetChromeEventHandler());
   NS_ENSURE_TRUE(chromeHandler, true);
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -61,18 +61,16 @@
 #include "nsNetUtil.h"
 #include "nsFrameMessageManager.h"
 #include "nsIScriptContext.h"
 #include "nsDOMEventTargetHelper.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptObjectPrincipal.h"
 #include "nsIScriptContext.h"
 
-class gfxMatrix;
-
 namespace mozilla {
 namespace dom {
 
 class TabChild;
 
 class TabChildGlobal : public nsDOMEventTargetHelper,
                        public nsIContentFrameMessageManager,
                        public nsIScriptObjectPrincipal,
@@ -191,55 +189,21 @@ public:
             const PRInt32& x,
             const PRInt32& y,
             const PRInt32& w,
             const PRInt32& h,
             const nsString& bgcolor,
             const PRUint32& flags,
             const bool& flush);
 
-    virtual mozilla::ipc::PDocumentRendererShmemChild* AllocPDocumentRendererShmem(
-            const PRInt32& x,
-            const PRInt32& y,
-            const PRInt32& w,
-            const PRInt32& h,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush,
-	    const gfxMatrix& aMatrix,
-            const PRInt32& bufw,
-            const PRInt32& bufh,
-            Shmem& buf);
-    virtual bool DeallocPDocumentRendererShmem(PDocumentRendererShmemChild* actor);
-    virtual bool RecvPDocumentRendererShmemConstructor(
-            mozilla::ipc::PDocumentRendererShmemChild *__a,
-            const PRInt32& aX,
-            const PRInt32& aY,
-            const PRInt32& aW,
-            const PRInt32& aH,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush,
-	    const gfxMatrix& aMatrix,
-            const PRInt32& aBufW,
-            const PRInt32& aBufH,
-            Shmem& aBuf);
-
     nsIWebNavigation* WebNavigation() { return mWebNav; }
 
     JSContext* GetJSContext() { return mCx; }
 
     nsIPrincipal* GetPrincipal() { return mPrincipal; }
-
-    virtual bool RecvregisterChromePackage(const nsString& aPackage,
-                                           const nsString& aBaseURI,
-                                           const PRUint32& aFlags);
-    virtual bool RecvregisterChromeResource(const nsString& aPackage,
-                                            const nsString& aResolvedURI);
-
 private:
     bool InitTabChildGlobal();
 
     nsCOMPtr<nsIWebNavigation> mWebNav;
 
     nsCOMPtr<nsIXPConnectJSObjectHolder> mRootGlobal;
 
     JSContext* mCx;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -34,31 +34,29 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "TabParent.h"
 
 #include "mozilla/ipc/DocumentRendererParent.h"
-#include "mozilla/ipc/DocumentRendererShmemParent.h"
 
 #include "nsIURI.h"
 #include "nsFocusManager.h"
 #include "nsCOMPtr.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDOMElement.h"
 #include "nsEventDispatcher.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMEvent.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsFrameLoader.h"
 
 using mozilla::ipc::DocumentRendererParent;
-using mozilla::ipc::DocumentRendererShmemParent;
 
 namespace mozilla {
 namespace dom {
 
 TabParent::TabParent()
 {
 }
 
@@ -152,32 +150,16 @@ TabParent::AllocPDocumentRenderer(const 
 
 bool
 TabParent::DeallocPDocumentRenderer(PDocumentRendererParent* actor)
 {
     delete actor;
     return true;
 }
 
-mozilla::ipc::PDocumentRendererShmemParent*
-TabParent::AllocPDocumentRendererShmem(const PRInt32& x,
-        const PRInt32& y, const PRInt32& w, const PRInt32& h, const nsString& bgcolor,
-        const PRUint32& flags, const bool& flush, const gfxMatrix& aMatrix,
-        const PRInt32& bufw, const PRInt32& bufh, Shmem &buf)
-{
-    return new DocumentRendererShmemParent();
-}
-
-bool
-TabParent::DeallocPDocumentRendererShmem(PDocumentRendererShmemParent* actor)
-{
-    delete actor;
-    return true;
-}
-
 void
 TabParent::SendMouseEvent(const nsAString& aType, float aX, float aY,
                           PRInt32 aButton, PRInt32 aClickCount,
                           PRInt32 aModifiers, PRBool aIgnoreRootScrollFrame)
 {
   SendsendMouseEvent(nsString(aType), aX, aY, aButton, aClickCount,
                      aModifiers, aIgnoreRootScrollFrame);
 }
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -43,17 +43,16 @@
 
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 
 #include "nsCOMPtr.h"
 #include "nsIBrowserDOMWindow.h"
 
 class nsIURI;
 class nsIDOMElement;
-class gfxMatrix;
 
 namespace mozilla {
 namespace dom {
 
 class TabParent : public PIFrameEmbeddingParent
 {
 public:
     TabParent();
@@ -86,31 +85,16 @@ public:
             const PRInt32& x,
             const PRInt32& y,
             const PRInt32& w,
             const PRInt32& h,
             const nsString& bgcolor,
             const PRUint32& flags,
             const bool& flush);
     virtual bool DeallocPDocumentRenderer(PDocumentRendererParent* actor);
-
-    virtual mozilla::ipc::PDocumentRendererShmemParent* AllocPDocumentRendererShmem(
-            const PRInt32& x,
-            const PRInt32& y,
-            const PRInt32& w,
-            const PRInt32& h,
-            const nsString& bgcolor,
-            const PRUint32& flags,
-            const bool& flush,
-	    const gfxMatrix& aMatrix,
-            const PRInt32& bufw,
-            const PRInt32& bufh,
-            Shmem &buf);
-    virtual bool DeallocPDocumentRendererShmem(PDocumentRendererShmemParent* actor);
-
 protected:
     nsIDOMElement* mFrameElement;
     nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/ipc/ipdl.mk
+++ b/dom/ipc/ipdl.mk
@@ -33,10 +33,9 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 IPDLSRCS = \
   PContentProcess.ipdl \
   PIFrameEmbedding.ipdl \
   PDocumentRenderer.ipdl \
-  PDocumentRendererShmem.ipdl \
   $(NULL)
--- a/gfx/cairo/cairo/src/cairo-deprecated.h
+++ b/gfx/cairo/cairo/src/cairo-deprecated.h
@@ -43,17 +43,17 @@
  * backend can work fine with 16-bit visuals in the same way it works
  * with BGR visuals without any BGR formats in
  * #cairo_format_t).
  *
  * Additionally, the support for the RGB16_565 format was never
  * completely implemented. So while this format value is currently
  * deprecated, it may eventually acquire complete support in the future.
  */
-//#define CAIRO_FORMAT_RGB16_565 4
+#define CAIRO_FORMAT_RGB16_565 4
 
 #define CAIRO_FONT_TYPE_ATSUI CAIRO_FONT_TYPE_QUARTZ
 
 /* Obsolete functions. These definitions exist to coerce the compiler
  * into providing a little bit of guidance with its error
  * messages. The idea is to help users port their old code without
  * having to dig through lots of documentation.
  *
--- a/gfx/cairo/cairo/src/cairo-image-surface.c
+++ b/gfx/cairo/cairo/src/cairo-image-surface.c
@@ -44,20 +44,18 @@ static cairo_format_t
     case PIXMAN_a8r8g8b8:
 	return CAIRO_FORMAT_ARGB32;
     case PIXMAN_x8r8g8b8:
 	return CAIRO_FORMAT_RGB24;
     case PIXMAN_a8:
 	return CAIRO_FORMAT_A8;
     case PIXMAN_a1:
 	return CAIRO_FORMAT_A1;
-    case PIXMAN_r5g6b5:
-	return CAIRO_FORMAT_RGB16_565;
     case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8:
-    case PIXMAN_b8g8r8:   case PIXMAN_b5g6r5:
+    case PIXMAN_b8g8r8:   case PIXMAN_r5g6b5:   case PIXMAN_b5g6r5:
     case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5:
     case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4:
     case PIXMAN_a4b4g4r4: case PIXMAN_x4b4g4r4: case PIXMAN_r3g3b2:
     case PIXMAN_b2g3r3:   case PIXMAN_a2r2g2b2: case PIXMAN_a2b2g2r2:
     case PIXMAN_c8:       case PIXMAN_g8:       case PIXMAN_x4a4:
     case PIXMAN_a4:       case PIXMAN_r1g2b1:   case PIXMAN_b1g2r1:
     case PIXMAN_a1r1g1b1: case PIXMAN_a1b1g1r1: case PIXMAN_c4:
     case PIXMAN_g4:       case PIXMAN_g1:
@@ -303,19 +301,16 @@ static pixman_format_code_t
 	ret = PIXMAN_a1;
 	break;
     case CAIRO_FORMAT_A8:
 	ret = PIXMAN_a8;
 	break;
     case CAIRO_FORMAT_RGB24:
 	ret = PIXMAN_x8r8g8b8;
 	break;
-    case CAIRO_FORMAT_RGB16_565:
-	ret = PIXMAN_r5g6b5;
-	break;
     case CAIRO_FORMAT_ARGB32:
     default:
 	ret = PIXMAN_a8r8g8b8;
 	break;
     }
     return ret;
 }
 
@@ -651,18 +646,16 @@ cairo_image_surface_get_stride (cairo_su
     return image_surface->stride;
 }
 slim_hidden_def (cairo_image_surface_get_stride);
 
 cairo_format_t
 _cairo_format_from_content (cairo_content_t content)
 {
     switch (content) {
-    case CAIRO_CONTENT_COLOR16:
-	return CAIRO_FORMAT_RGB16_565;
     case CAIRO_CONTENT_COLOR:
 	return CAIRO_FORMAT_RGB24;
     case CAIRO_CONTENT_ALPHA:
 	return CAIRO_FORMAT_A8;
     case CAIRO_CONTENT_COLOR_ALPHA:
 	return CAIRO_FORMAT_ARGB32;
     }
 
@@ -673,18 +666,16 @@ cairo_format_t
 cairo_content_t
 _cairo_content_from_format (cairo_format_t format)
 {
     switch (format) {
     case CAIRO_FORMAT_ARGB32:
 	return CAIRO_CONTENT_COLOR_ALPHA;
     case CAIRO_FORMAT_RGB24:
 	return CAIRO_CONTENT_COLOR;
-    case CAIRO_FORMAT_RGB16_565:
-	return CAIRO_CONTENT_COLOR16;
     case CAIRO_FORMAT_A8:
     case CAIRO_FORMAT_A1:
 	return CAIRO_CONTENT_ALPHA;
     }
 
     ASSERT_NOT_REACHED;
     return CAIRO_CONTENT_COLOR_ALPHA;
 }
@@ -692,18 +683,16 @@ cairo_content_t
 int
 _cairo_format_bits_per_pixel (cairo_format_t format)
 {
     switch (format) {
     case CAIRO_FORMAT_ARGB32:
 	return 32;
     case CAIRO_FORMAT_RGB24:
 	return 32;
-    case CAIRO_FORMAT_RGB16_565:
-	return 16;
     case CAIRO_FORMAT_A8:
 	return 8;
     case CAIRO_FORMAT_A1:
 	return 1;
     default:
 	ASSERT_NOT_REACHED;
 	return 0;
     }
--- a/gfx/cairo/cairo/src/cairo-qpainter-surface.cpp
+++ b/gfx/cairo/cairo/src/cairo-qpainter-surface.cpp
@@ -116,17 +116,17 @@ typedef struct {
 
     bool has_clipping;
     // if this is true, calls to intersect_clip_path won't
     // update the clip_bounds rect
     bool no_update_clip_bounds;
 
     cairo_bool_t supports_porter_duff;
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
     /* temporary, so that we can share the xlib surface's glyphs code */
     bool xlib_has_clipping;
     cairo_surface_t *xlib_equiv;
     QRect xlib_clip_bounds;
     int xlib_clip_serial;
     QPoint redir_offset;
 #endif
     
@@ -433,17 +433,17 @@ static cairo_status_t
     if (qs->image || qs->pixmap)
         delete qs->p;
     else
         qs->p->restore();
 
     if (qs->image_equiv)
         cairo_surface_destroy ((cairo_surface_t*) qs->image_equiv);
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
     if (qs->xlib_equiv)
         cairo_surface_destroy (qs->xlib_equiv);
 #endif
 
     if (qs->image)
         delete qs->image;
 
     if (qs->pixmap)
@@ -1360,17 +1360,17 @@ static cairo_int_status_t
                                      int num_glyphs,
                                      cairo_scaled_font_t *scaled_font,
                                      int *remaining_glyphs,
                                      cairo_rectangle_int_t * extends)
 {
     Q_UNUSED(extends);
     cairo_qpainter_surface_t *qs = (cairo_qpainter_surface_t *) abstract_surface;
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
     /* If we have an equivalent X surface, let the xlib surface handle this
      * until we figure out how to do this natively with Qt.
      */
     if (qs->xlib_equiv) {
 
         D(fprintf(stderr, "q[%p] show_glyphs (x11 equiv) op:%s nglyphs: %d\n", abstract_surface, _opstr(op), num_glyphs));
 
         for (int i = 0; i < num_glyphs; i++) {
@@ -1582,17 +1582,17 @@ static const cairo_surface_backend_t cai
     NULL, /* reset */
     NULL, /* fill_stroke */
     NULL, /* create_solid_pattern_surface */
     NULL, /* can_repaint_solid_pattern_surface */
     NULL, /* has_show_text_glyphs */
     NULL, /* show_text_glyphs */
 };
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
 void
 _cairo_qpainter_create_xlib_surface (cairo_qpainter_surface_t *qs)
 {
     Drawable d = None;
     QX11Info xinfo;
     int width, height;
 
     if (!qs->p)
@@ -1656,17 +1656,17 @@ cairo_qpainter_surface_create (QPainter 
     else
         qs->supports_porter_duff = FALSE;
 
     // Save so that we can always get back to the original state
     qs->p->save();
 
     qs->window = painter->window();
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
     _cairo_qpainter_create_xlib_surface (qs);
 #endif
 
     D(fprintf(stderr, "qpainter_surface_create: window: [%d %d %d %d] pd:%d\n",
               qs->window.x(), qs->window.y(), qs->window.width(), qs->window.height(),
               qs->supports_porter_duff));
 
     return &qs->base;
@@ -1743,17 +1743,17 @@ cairo_qpainter_surface_create_with_qpixm
 
     if (!pixmap->isNull()) {
         qs->p = new QPainter(pixmap);
         qs->supports_porter_duff = qs->p->paintEngine()->hasFeature(QPaintEngine::PorterDuff);
     }
 
     qs->window = QRect(0, 0, width, height);
 
-#if defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
+#if defined(Q_WS_X11) && defined(CAIRO_HAS_XLIB_XRENDER_SURFACE)
     _cairo_qpainter_create_xlib_surface (qs);
 #endif
 
     D(fprintf(stderr, "qpainter_surface_create: qpixmap: [%d %d %d %d] pd:%d\n",
               qs->window.x(), qs->window.y(), qs->window.width(), qs->window.height(),
               qs->supports_porter_duff));
 
     return &qs->base;
--- a/gfx/cairo/cairo/src/cairo.h
+++ b/gfx/cairo/cairo/src/cairo.h
@@ -307,18 +307,17 @@ typedef enum _cairo_status {
  *
  * Note: The large values here are designed to keep #cairo_content_t
  * values distinct from #cairo_format_t values so that the
  * implementation can detect the error if users confuse the two types.
  **/
 typedef enum _cairo_content {
     CAIRO_CONTENT_COLOR		= 0x1000,
     CAIRO_CONTENT_ALPHA		= 0x2000,
-    CAIRO_CONTENT_COLOR_ALPHA	= 0x3000,
-    CAIRO_CONTENT_COLOR16	= 0x4000
+    CAIRO_CONTENT_COLOR_ALPHA	= 0x3000
 } cairo_content_t;
 
 /**
  * cairo_write_func_t:
  * @closure: the output closure
  * @data: the buffer containing the data to write
  * @length: the amount of data to write
  *
@@ -2062,18 +2061,21 @@ cairo_surface_has_show_text_glyphs (cair
  * image data.
  *
  * New entries may be added in future versions.
  **/
 typedef enum _cairo_format {
     CAIRO_FORMAT_ARGB32,
     CAIRO_FORMAT_RGB24,
     CAIRO_FORMAT_A8,
-    CAIRO_FORMAT_A1,
-    CAIRO_FORMAT_RGB16_565
+    CAIRO_FORMAT_A1
+    /* The value of 4 is reserved by a deprecated enum value.
+     * The next format added must have an explicit value of 5.
+    CAIRO_FORMAT_RGB16_565 = 4,
+    */
 } cairo_format_t;
 
 cairo_public cairo_surface_t *
 cairo_image_surface_create (cairo_format_t	format,
 			    int			width,
 			    int			height);
 
 cairo_public int
--- a/gfx/cairo/cairo/src/cairoint.h
+++ b/gfx/cairo/cairo/src/cairoint.h
@@ -2146,27 +2146,26 @@ cairo_private cairo_bool_t
  *
  * If we do decide to start fully supporting RGB16_565 as an external
  * format, then %CAIRO_FORMAT_VALID needs to be adjusted to include
  * it. But that should not happen before all necessary code is fixed
  * to support it (at least cairo_surface_write_to_png() and a few spots
  * in cairo-xlib-surface.c--again see -Wswitch-enum).
  */
 #define CAIRO_FORMAT_INVALID ((unsigned int) -1)
-#define CAIRO_FORMAT_VALID(format) ((format) <= CAIRO_FORMAT_RGB16_565)
+#define CAIRO_FORMAT_VALID(format) ((format) <= CAIRO_FORMAT_A1)
 
 /* pixman-required stride alignment in bytes. */
 #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
 #define CAIRO_STRIDE_FOR_WIDTH_BPP(w,bpp) \
    ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
 
 #define CAIRO_CONTENT_VALID(content) ((content) && 			         \
 				      (((content) & ~(CAIRO_CONTENT_COLOR |      \
 						      CAIRO_CONTENT_ALPHA |      \
-						      CAIRO_CONTENT_COLOR16 |    \
 						      CAIRO_CONTENT_COLOR_ALPHA))\
 				       == 0))
 
 cairo_private int
 _cairo_format_bits_per_pixel (cairo_format_t format) cairo_const;
 
 cairo_private cairo_format_t
 _cairo_format_from_content (cairo_content_t content) cairo_const;
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -105,17 +105,16 @@ CSRCS	= \
 	pixman-bits-image.c \
 	pixman.c \
 	pixman-combine32.c \
 	pixman-combine64.c \
 	pixman-conical-gradient.c \
 	pixman-cpu.c \
 	pixman-edge.c \
 	pixman-edge-accessors.c \
-	pixman-fast-path-scale.c \
 	pixman-fast-path.c \
 	pixman-general.c \
 	pixman-gradient-walker.c \
 	pixman-image.c \
 	pixman-implementation.c \
 	pixman-linear-gradient.c \
 	pixman-matrix.c \
 	pixman-radial-gradient.c \
--- a/gfx/cairo/libpixman/src/pixman-bits-image.c
+++ b/gfx/cairo/libpixman/src/pixman-bits-image.c
@@ -529,222 +529,16 @@ bits_image_fetch_bilinear_no_repeat_8888
 	mask += mask_inc;
     }
 
     /* Zero fill to the left of the image */
     while (buffer < end)
 	*buffer++ = 0;
 }
 
-static void
-bits_image_fetch_bilinear_no_repeat_0565 (pixman_image_t * ima,
-					  int              offset,
-					  int              line,
-					  int              width,
-					  uint32_t *       buffer,
-					  const uint32_t * mask,
-					  uint32_t         mask_bits)
-{
-    bits_image_t *bits = &ima->bits;
-    pixman_fixed_t x_top, x_bottom, x;
-    pixman_fixed_t ux_top, ux_bottom, ux;
-    pixman_vector_t v;
-    uint32_t top_mask, bottom_mask;
-    uint16_t *top_row;
-    uint16_t *bottom_row;
-    uint32_t *end;
-    uint16_t zero[2] = { 0, 0 };
-    int y, y1, y2;
-    int disty;
-    int mask_inc;
-    int w;
-
-    /* reference point is the center of the pixel */
-    v.vector[0] = pixman_int_to_fixed (offset) + pixman_fixed_1 / 2;
-    v.vector[1] = pixman_int_to_fixed (line) + pixman_fixed_1 / 2;
-    v.vector[2] = pixman_fixed_1;
-
-    if (!pixman_transform_point_3d (bits->common.transform, &v))
-	return;
-
-    ux = ux_top = ux_bottom = bits->common.transform->matrix[0][0];
-    x = x_top = x_bottom = v.vector[0] - pixman_fixed_1/2;
-
-    y = v.vector[1] - pixman_fixed_1/2;
-    disty = (y >> 8) & 0xff;
-
-    /* Load the pointers to the first and second lines from the source
-     * image that bilinear code must read.
-     *
-     * The main trick in this code is about the check if any line are
-     * outside of the image;
-     *
-     * When I realize that a line (any one) is outside, I change
-     * the pointer to a dummy area with zeros. Once I change this, I
-     * must be sure the pointer will not change, so I set the
-     * variables to each pointer increments inside the loop.
-     */
-    y1 = pixman_fixed_to_int (y);
-    y2 = y1 + 1;
-
-    if (y1 < 0 || y1 >= bits->height)
-    {
-	top_row = zero;
-	x_top = 0;
-	ux_top = 0;
-    }
-    else
-    {
-	top_row = bits->bits + y1 * bits->rowstride;
-	x_top = x;
-	ux_top = ux;
-    }
-
-    if (y2 < 0 || y2 >= bits->height)
-    {
-	bottom_row = zero;
-	x_bottom = 0;
-	ux_bottom = 0;
-    }
-    else
-    {
-	bottom_row = bits->bits + y2 * bits->rowstride;
-	x_bottom = x;
-	ux_bottom = ux;
-    }
-
-    /* Instead of checking whether the operation uses the mast in
-     * each loop iteration, verify this only once and prepare the
-     * variables to make the code smaller inside the loop.
-     */
-    if (!mask)
-    {
-        mask_inc = 0;
-        mask_bits = 1;
-        mask = &mask_bits;
-    }
-    else
-    {
-        /* If have a mask, prepare the variables to check it */
-        mask_inc = 1;
-    }
-
-    /* If both are zero, then the whole thing is zero */
-    if (top_row == zero && bottom_row == zero)
-    {
-	memset (buffer, 0, width * sizeof (uint32_t));
-	return;
-    }
-    else
-    {
-	if (top_row == zero)
-	{
-	    top_mask = 0;
-	    bottom_mask = 0xff000000;
-	}
-	else if (bottom_row == zero)
-	{
-	    top_mask = 0xff000000;
-	    bottom_mask = 0;
-	}
-	else
-	{
-	    top_mask = 0xff000000;
-	    bottom_mask = 0xff000000;
-	}
-    }
-
-    end = buffer + width;
-
-    /* Zero fill to the left of the image */
-    while (buffer < end && x < pixman_fixed_minus_1)
-    {
-	*buffer++ = 0;
-	x += ux;
-	x_top += ux_top;
-	x_bottom += ux_bottom;
-	mask += mask_inc;
-    }
-
-    /* Left edge
-     */
-    while (buffer < end && x < 0)
-    {
-	uint32_t tr, br;
-	int32_t distx;
-
-	tr = CONVERT_0565_TO_0888 (top_row[pixman_fixed_to_int (x_top) + 1]) | top_mask;
-	br = CONVERT_0565_TO_0888 (bottom_row[pixman_fixed_to_int (x_bottom) + 1]) | bottom_mask;
-
-	distx = (x >> 8) & 0xff;
-
-	*buffer++ = bilinear_interpolation (0, tr, 0, br, distx, disty);
-
-	x += ux;
-	x_top += ux_top;
-	x_bottom += ux_bottom;
-	mask += mask_inc;
-    }
-
-    /* Main part */
-    w = pixman_int_to_fixed (bits->width - 1);
-
-    while (buffer < end  &&  x < w)
-    {
-	if (*mask)
-	{
-	    uint32_t tl, tr, bl, br;
-	    int32_t distx;
-
-	    tl = CONVERT_0565_TO_0888 (top_row [pixman_fixed_to_int (x_top)]) | top_mask;
-	    tr = CONVERT_0565_TO_0888 (top_row [pixman_fixed_to_int (x_top) + 1]) | top_mask;
-	    bl = CONVERT_0565_TO_0888 (bottom_row [pixman_fixed_to_int (x_bottom)]) | bottom_mask;
-	    br = CONVERT_0565_TO_0888 (bottom_row [pixman_fixed_to_int (x_bottom) + 1]) | bottom_mask;
-
-	    distx = (x >> 8) & 0xff;
-
-	    *buffer = bilinear_interpolation (tl, tr, bl, br, distx, disty);
-	}
-
-	buffer++;
-	x += ux;
-	x_top += ux_top;
-	x_bottom += ux_bottom;
-	mask += mask_inc;
-    }
-
-    /* Right Edge */
-    w = pixman_int_to_fixed (bits->width);
-    while (buffer < end  &&  x < w)
-    {
-	if (*mask)
-	{
-	    uint32_t tl, bl;
-	    int32_t distx;
-
-	    tl = CONVERT_0565_TO_0888 (top_row [pixman_fixed_to_int (x_top)]) | top_mask;
-	    bl = CONVERT_0565_TO_0888 (bottom_row [pixman_fixed_to_int (x_bottom)]) | bottom_mask;
-
-	    distx = (x >> 8) & 0xff;
-
-	    *buffer = bilinear_interpolation (tl, 0, bl, 0, distx, disty);
-	}
-
-	buffer++;
-	x += ux;
-	x_top += ux_top;
-	x_bottom += ux_bottom;
-	mask += mask_inc;
-    }
-
-    /* Zero fill to the left of the image */
-    while (buffer < end)
-	*buffer++ = 0;
-}
-
 static force_inline uint32_t
 bits_image_fetch_pixel_convolution (bits_image_t   *image,
 				    pixman_fixed_t  x,
 				    pixman_fixed_t  y)
 {
     pixman_fixed_t *params = image->common.filter_params;
     int x_off = (params[0] - pixman_fixed_1) >> 1;
     int y_off = (params[1] - pixman_fixed_1) >> 1;
@@ -1166,36 +960,24 @@ bits_image_property_changed (pixman_imag
 	     bits->common.transform->matrix[2][0] == 0			&&
 	     bits->common.transform->matrix[2][1] == 0			&&
 	     bits->common.transform->matrix[2][2] == pixman_fixed_1	&&
 	     bits->common.transform->matrix[0][0] > 0			&&
 	     bits->common.transform->matrix[1][0] == 0			&&
 	     (bits->common.filter == PIXMAN_FILTER_BILINEAR ||
 	      bits->common.filter == PIXMAN_FILTER_GOOD	    ||
 	      bits->common.filter == PIXMAN_FILTER_BEST)		&&
-	     bits->common.repeat == PIXMAN_REPEAT_NONE)
+	     bits->common.repeat == PIXMAN_REPEAT_NONE			&&
+	     (bits->format == PIXMAN_a8r8g8b8	||
+	      bits->format == PIXMAN_x8r8g8b8))
     {
 	image->common.get_scanline_64 =
 	    _pixman_image_get_scanline_generic_64;
-
-	if (bits->format == PIXMAN_a8r8g8b8 || bits->format == PIXMAN_x8r8g8b8)
-	{
-	    image->common.get_scanline_32 =
-		bits_image_fetch_bilinear_no_repeat_8888;
-	}
-	else if (bits->format == PIXMAN_r5g6b5)
-	{
-	    image->common.get_scanline_32 =
-		bits_image_fetch_bilinear_no_repeat_0565;
-	}
-	else
-	{
-	    image->common.get_scanline_32 =
-		bits_image_fetch_transformed;
-	}
+	image->common.get_scanline_32 =
+	    bits_image_fetch_bilinear_no_repeat_8888;
     }
     else
     {
 	image->common.get_scanline_64 =
 	    _pixman_image_get_scanline_generic_64;
 	image->common.get_scanline_32 =
 	    bits_image_fetch_transformed;
     }
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-fast-path-scale.c
+++ /dev/null
@@ -1,1220 +0,0 @@
-/*
- * Copyright © 2009-2010 Nokia Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author:  Siarhei Siamashka (siarhei.siamashka@nokia.com)
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <string.h>
-#include "pixman-private.h"
-#include "pixman-combine32.h"
-
-/*
- * Functions, which implement the core inner loops for the nearest neighbour
- * scaled fastpath compositing operations. They do not need to do clipping
- * checks, also the loops are unrolled to process two pixels per iteration
- * for better performance on most CPU architectures (superscalar processors
- * can issue several operations simultaneously, other processors can hide
- * instructions latencies by pipelining operations). Unrolling more
- * does not make much sense because the compiler will start running out
- * of spare registers soon.
- */
-
-static void
-fast_composite_scale_nearest_over_8888_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  d;
-    uint32_t  s1, s2;
-    uint8_t   a1, a2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-
-    uint32_t *src;
-    uint16_t *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-
-	if ((y < 0) || (y >= src_image->bits.height))
-	{
-	    continue;
-	}
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    s2 = src[x2];
-
-	    a1 = s1 >> 24;
-	    a2 = s2 >> 24;
-
-	    if (a1 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s1);
-	    }
-	    else if (s1)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-
-	    if (a2 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s2);
-	    }
-	    else if (s2)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a2 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a2, s2);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    a1 = s1 >> 24;
-	    if (a1 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s1);
-	    }
-	    else if (s1)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_normal_repeat_over_8888_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  d;
-    uint32_t  s1, s2;
-    uint8_t   a1, a2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-    int32_t   max_vx, max_vy;
-
-    uint32_t *src;
-    uint16_t *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    max_vx = src_image->bits.width << 16;
-    max_vy = src_image->bits.height << 16;
-
-    while (orig_vx < 0) orig_vx += max_vx;
-    while (vy < 0) vy += max_vy;
-    while (orig_vx >= max_vx) orig_vx -= max_vx;
-    while (vy >= max_vy) vy -= max_vy;
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-	while (vy >= max_vy) vy -= max_vy;
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s2 = src[x2];
-
-	    a1 = s1 >> 24;
-	    a2 = s2 >> 24;
-
-	    if (a1 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s1);
-	    }
-	    else if (s1)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-
-	    if (a2 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s2);
-	    }
-	    else if (s2)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a2 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a2, s2);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    a1 = s1 >> 24;
-	    if (a1 == 0xff)
-	    {
-		*dst = CONVERT_8888_TO_0565 (s1);
-	    }
-	    else if (s1)
-	    {
-		d = CONVERT_0565_TO_0888 (*dst);
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = CONVERT_8888_TO_0565 (d);
-	    }
-	    dst++;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_over_8888_8888 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint32_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  d;
-    uint32_t  s1, s2;
-    uint8_t   a1, a2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-
-    uint32_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint32_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-
-	if ((y < 0) || (y >= src_image->bits.height))
-	{
-	    continue;
-	}
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    s2 = src[x2];
-
-	    a1 = s1 >> 24;
-	    a2 = s2 >> 24;
-
-	    if (a1 == 0xff)
-	    {
-		*dst = s1;
-	    }
-	    else if (s1)
-	    {
-		d = *dst;
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = d;
-	    }
-	    dst++;
-
-	    if (a2 == 0xff)
-	    {
-		*dst = s2;
-	    }
-	    else if (s2)
-	    {
-		d = *dst;
-		a2 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a2, s2);
-		*dst = d;
-	    }
-	    dst++;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    a1 = s1 >> 24;
-	    if (a1 == 0xff)
-	    {
-		*dst = s1;
-	    }
-	    else if (s1)
-	    {
-		d = *dst;
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = d;
-	    }
-	    dst++;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_normal_repeat_over_8888_8888 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint32_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  d;
-    uint32_t  s1, s2;
-    uint8_t   a1, a2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-    int32_t   max_vx, max_vy;
-
-    uint32_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint32_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    max_vx = src_image->bits.width << 16;
-    max_vy = src_image->bits.height << 16;
-
-    while (orig_vx < 0) orig_vx += max_vx;
-    while (vy < 0) vy += max_vy;
-    while (orig_vx >= max_vx) orig_vx -= max_vx;
-    while (vy >= max_vy) vy -= max_vy;
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-	while (vy >= max_vy) vy -= max_vy;
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s2 = src[x2];
-
-	    a1 = s1 >> 24;
-	    a2 = s2 >> 24;
-
-	    if (a1 == 0xff)
-	    {
-		*dst = s1;
-	    }
-	    else if (s1)
-	    {
-		d = *dst;
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = d;
-	    }
-	    dst++;
-
-	    if (a2 == 0xff)
-	    {
-		*dst = s2;
-	    }
-	    else if (s2)
-	    {
-		d = *dst;
-		a2 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a2, s2);
-		*dst = d;
-	    }
-	    dst++;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    a1 = s1 >> 24;
-	    if (a1 == 0xff)
-	    {
-		*dst = s1;
-	    }
-	    else if (s1)
-	    {
-		d = *dst;
-		a1 ^= 0xff;
-		UN8x4_MUL_UN8_ADD_UN8x4 (d, a1, s1);
-		*dst = d;
-	    }
-	    dst++;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_src_8888_8888 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint32_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-
-    uint32_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint32_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-
-	if ((y < 0) || (y >= src_image->bits.height))
-	{
-	    memset (dst, 0, width * sizeof(*dst));
-	    continue;
-	}
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    s2 = src[x2];
-
-	    *dst++ = s1;
-	    *dst++ = s2;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-	    *dst++ = s1;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_normal_repeat_src_8888_8888 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint32_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-    int32_t   max_vx, max_vy;
-
-    uint32_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint32_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    max_vx = src_image->bits.width << 16;
-    max_vy = src_image->bits.height << 16;
-
-    while (orig_vx < 0) orig_vx += max_vx;
-    while (vy < 0) vy += max_vy;
-    while (orig_vx >= max_vx) orig_vx -= max_vx;
-    while (vy >= max_vy) vy -= max_vy;
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-	while (vy >= max_vy) vy -= max_vy;
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s2 = src[x2];
-
-	    *dst++ = s1;
-	    *dst++ = s2;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    *dst++ = s1;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_src_0565_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint16_t *src_first_line;
-    uint16_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-
-    uint16_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint16_t, src_stride, src_first_line, 1);
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-
-	if ((y < 0) || (y >= src_image->bits.height))
-	{
-	    memset (dst, 0, width * sizeof(*dst));
-	    continue;
-	}
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    s2 = src[x2];
-
-	    *dst++ = s1;
-	    *dst++ = s2;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-	    *dst++ = s1;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_normal_repeat_src_0565_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint16_t *src_first_line;
-    uint16_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-    int32_t   max_vx, max_vy;
-
-    uint16_t *src, *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint16_t, src_stride, src_first_line, 1);
-
-    max_vx = src_image->bits.width << 16;
-    max_vy = src_image->bits.height << 16;
-
-    while (orig_vx < 0) orig_vx += max_vx;
-    while (vy < 0) vy += max_vy;
-    while (orig_vx >= max_vx) orig_vx -= max_vx;
-    while (vy >= max_vy) vy -= max_vy;
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-	while (vy >= max_vy) vy -= max_vy;
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s2 = src[x2];
-
-	    *dst++ = s1;
-	    *dst++ = s2;
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    *dst++ = s1;
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_src_8888_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-
-    uint32_t *src;
-    uint16_t *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-
-	if ((y < 0) || (y >= src_image->bits.height))
-	{
-	    memset (dst, 0, width * sizeof(*dst));
-	    continue;
-	}
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    s2 = src[x2];
-
-	    *dst++ = CONVERT_8888_TO_0565 (s1);
-	    *dst++ = CONVERT_8888_TO_0565 (s2);
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    s1 = src[x1];
-	    *dst++ = CONVERT_8888_TO_0565 (s1);
-	}
-    }
-}
-
-static void
-fast_composite_scale_nearest_normal_repeat_src_8888_0565 (
-    pixman_image_t *src_image,
-    pixman_image_t *dst_image,
-    int             src_x,
-    int             src_y,
-    int             dst_x,
-    int             dst_y,
-    int             width,
-    int             height,
-    int32_t         vx,
-    int32_t         vy,
-    int32_t         unit_x,
-    int32_t         unit_y)
-{
-    uint16_t *dst_line;
-    uint32_t *src_first_line;
-    uint32_t  s1, s2;
-    int       w;
-    int       x1, x2, y;
-    int32_t   orig_vx = vx;
-    int32_t   max_vx, max_vy;
-
-    uint32_t *src;
-    uint16_t *dst;
-    int       src_stride, dst_stride;
-
-    PIXMAN_IMAGE_GET_LINE (dst_image, dst_x, dst_y, uint16_t, dst_stride, dst_line, 1);
-    /* pass in 0 instead of src_x and src_y because src_x and src_y need to be
-     * transformed from destination space to source space */
-    PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, uint32_t, src_stride, src_first_line, 1);
-
-    max_vx = src_image->bits.width << 16;
-    max_vy = src_image->bits.height << 16;
-
-    while (orig_vx < 0) orig_vx += max_vx;
-    while (vy < 0) vy += max_vy;
-    while (orig_vx >= max_vx) orig_vx -= max_vx;
-    while (vy >= max_vy) vy -= max_vy;
-
-    while (--height >= 0)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-
-	y = vy >> 16;
-	vy += unit_y;
-	while (vy >= max_vy) vy -= max_vy;
-
-	src = src_first_line + src_stride * y;
-
-	w = width;
-	vx = orig_vx;
-	while ((w -= 2) >= 0)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    x2 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s2 = src[x2];
-
-	    *dst++ = CONVERT_8888_TO_0565 (s1);
-	    *dst++ = CONVERT_8888_TO_0565 (s2);
-	}
-	if (w & 1)
-	{
-	    x1 = vx >> 16;
-	    vx += unit_x;
-	    while (vx >= max_vx) vx -= max_vx;
-	    s1 = src[x1];
-
-	    *dst++ = CONVERT_8888_TO_0565 (s1);
-	}
-    }
-}
-
-/*
- * Check if the source image boundary is crossed in horizontal direction
- */
-static inline pixman_bool_t
-have_horizontal_oversampling (pixman_image_t *pict,
-				     int             width,
-				     int32_t         vx,
-				     int32_t         unit_x)
-{
-    while (--width >= 0)
-    {
-	int x = vx >> 16;
-	if ((x < 0) || (x >= pict->bits.width)) return 1;
-	vx += unit_x;
-    }
-    return 0;
-}
-
-/*
- * Check if the source image boundary is crossed in vertical direction
- */
-static inline pixman_bool_t
-have_vertical_oversampling (pixman_image_t *pict,
-				   int             height,
-				   int32_t         vy,
-				   int32_t         unit_y)
-{
-    while (--height >= 0)
-    {
-	int y = vy >> 16;
-	if ((y < 0) || (y >= pict->bits.height)) return 1;
-	vy += unit_y;
-    }
-    return 0;
-}
-
-/*
- * Easy case of transform without rotation or complex clipping
- * Returns 1 in the case if it was able to handle this operation and 0 otherwise
- */
-pixman_bool_t
-_pixman_run_fast_path_scale (pixman_op_t      op,
-			     pixman_image_t * src_image,
-			     pixman_image_t * mask_image,
-			     pixman_image_t * dst_image,
-			     int32_t          src_x,
-			     int32_t          src_y,
-			     int32_t          mask_x,
-			     int32_t          mask_y,
-			     int32_t          dst_x,
-			     int32_t          dst_y,
-			     int32_t          width,
-			     int32_t          height)
-{
-    pixman_vector_t v, unit;
-    int             skipdst_x = 0, skipdst_y = 0;
-
-    /* Handle destination clipping */
-    int clip_x1, clip_x2, clip_y1, clip_y2;
-    if (!dst_image->common.have_clip_region)
-    {
-	clip_x1 = 0;
-	clip_y1 = 0;
-	clip_x2 = dst_image->bits.width;
-	clip_y2 = dst_image->bits.height;
-    }
-    else
-    {
-	clip_x1 = dst_image->common.clip_region.extents.x1;
-	clip_y1 = dst_image->common.clip_region.extents.y1;
-	clip_x2 = dst_image->common.clip_region.extents.x2;
-	clip_y2 = dst_image->common.clip_region.extents.y2;
-    }
-
-    if (dst_x < clip_x1)
-    {
-	skipdst_x = clip_x1 - dst_x;
-	if (skipdst_x >= (int)width)
-	    return 1;
-	dst_x = clip_x1;
-	width -= skipdst_x;
-    }
-
-    if (dst_y < clip_y1)
-    {
-	skipdst_y = clip_y1 - dst_y;
-	if (skipdst_y >= (int)height)
-	    return 1;
-	dst_y = clip_y1;
-	height -= skipdst_y;
-    }
-
-    if (dst_x >= clip_x2 ||
-	dst_y >= clip_y2)
-    {
-	return 1;
-    }
-
-    if (dst_x + width > clip_x2)
-	width = clip_x2 - dst_x;
-    if (dst_y + height > clip_y2)
-	height = clip_y2 - dst_y;
-
-    /* reference point is the center of the pixel */
-    v.vector[0] = pixman_int_to_fixed (src_x) + pixman_fixed_1 / 2;
-    v.vector[1] = pixman_int_to_fixed (src_y) + pixman_fixed_1 / 2;
-    v.vector[2] = pixman_fixed_1;
-
-    if (!pixman_transform_point_3d (src_image->common.transform, &v))
-	return 0;
-
-    /* Round down to closest integer, ensuring that 0.5 rounds to 0, not 1 */
-    v.vector[0] -= pixman_fixed_e;
-    v.vector[1] -= pixman_fixed_e;
-
-    unit.vector[0] = src_image->common.transform->matrix[0][0];
-    unit.vector[1] = src_image->common.transform->matrix[1][1];
-
-    v.vector[0] += unit.vector[0] * skipdst_x;
-    v.vector[1] += unit.vector[1] * skipdst_y;
-
-    /* Check for possible fixed point arithmetics problems/overflows */
-    if (unit.vector[0] <= 0 || unit.vector[1] <= 0)
-	return 0;
-    if (width == 0 || height == 0)
-	return 0;
-    if ((uint32_t)width + (unit.vector[0] >> 16) >= 0x7FFF)
-	return 0;
-    if ((uint32_t)height + (unit.vector[1] >> 16) >= 0x7FFF)
-	return 0;
-
-    /* Horizontal source oversampling is only supported for NORMAL repeat */
-    if (src_image->common.repeat != PIXMAN_REPEAT_NORMAL &&
-	have_horizontal_oversampling (src_image, width, v.vector[0], unit.vector[0]))
-    {
-	return 0;
-    }
-
-    /* Vertical source oversampling is only supported for NONE and NORMAL repeat */
-    if (src_image->common.repeat != PIXMAN_REPEAT_NONE &&
-	src_image->common.repeat != PIXMAN_REPEAT_NORMAL &&
-	have_vertical_oversampling (src_image, height, v.vector[1], unit.vector[1]))
-    {
-	return 0;
-    }
-
-    if (op == PIXMAN_OP_OVER &&
-	src_image->bits.format == PIXMAN_a8r8g8b8 &&
-	(dst_image->bits.format == PIXMAN_x8r8g8b8 ||
-	 dst_image->bits.format == PIXMAN_a8r8g8b8))
-    {
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat != PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_over_8888_8888 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat == PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_normal_repeat_over_8888_8888 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-    }
-
-    if (op == PIXMAN_OP_SRC &&
-	(src_image->bits.format == PIXMAN_x8r8g8b8 ||
-	 src_image->bits.format == PIXMAN_a8r8g8b8) &&
-	(dst_image->bits.format == PIXMAN_x8r8g8b8 ||
-	 dst_image->bits.format == src_image->bits.format))
-    {
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat != PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_src_8888_8888 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat == PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_normal_repeat_src_8888_8888 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-    }
-
-    if (op == PIXMAN_OP_OVER &&
-	src_image->bits.format == PIXMAN_a8r8g8b8 &&
-	dst_image->bits.format == PIXMAN_r5g6b5)
-    {
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat != PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_over_8888_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat == PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_normal_repeat_over_8888_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-    }
-
-    if (op == PIXMAN_OP_SRC &&
-	src_image->bits.format == PIXMAN_r5g6b5 &&
-	dst_image->bits.format == PIXMAN_r5g6b5)
-    {
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat != PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_src_0565_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat == PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_normal_repeat_src_0565_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-    }
-
-    if (op == PIXMAN_OP_SRC &&
-	(src_image->bits.format == PIXMAN_x8r8g8b8 ||
-	 src_image->bits.format == PIXMAN_a8r8g8b8) &&
-	dst_image->bits.format == PIXMAN_r5g6b5)
-    {
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat != PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_src_8888_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-	if (src_image->common.filter == PIXMAN_FILTER_NEAREST &&
-	    src_image->common.repeat == PIXMAN_REPEAT_NORMAL)
-	{
-	    fast_composite_scale_nearest_normal_repeat_src_8888_0565 (
-		src_image, dst_image, src_x, src_y, dst_x, dst_y, width, height,
-		v.vector[0], v.vector[1], unit.vector[0], unit.vector[1]);
-	    return 1;
-	}
-    }
-
-    /* No fast path scaling implementation for this case */
-    return 0;
-}
--- a/gfx/cairo/libpixman/src/pixman-fast-path.c
+++ b/gfx/cairo/libpixman/src/pixman-fast-path.c
@@ -1524,49 +1524,16 @@ fast_path_composite (pixman_implementati
                      int32_t                  src_y,
                      int32_t                  mask_x,
                      int32_t                  mask_y,
                      int32_t                  dest_x,
                      int32_t                  dest_y,
                      int32_t                  width,
                      int32_t                  height)
 {
-    /*
-     * In some cases, single pass fast path composite operation
-     * can be also run for the cases when source image has
-     * transform and repeat set. For now, only NEAREST transform
-     * is supported and destination image should have trivial
-     * clipping only (one clipping box at most). Additionally,
-     * transform should only perform scaling (but no rotation).
-     */
-    if (src->type == BITS &&
-	src->common.transform &&
-	!mask &&
-	!src->common.alpha_map && !dest->common.alpha_map &&
-	src->common.filter == PIXMAN_FILTER_NEAREST &&
-	!src->bits.read_func && !src->bits.write_func &&
-	!dest->bits.read_func && !dest->bits.write_func)
-    {
-	if (src->common.transform->matrix[0][1] == 0 &&
-	    src->common.transform->matrix[1][0] == 0 &&
-	    src->common.transform->matrix[2][0] == 0 &&
-	    src->common.transform->matrix[2][1] == 0 &&
-	    src->common.transform->matrix[2][2] == pixman_fixed_1 &&
-	    (!dest->common.have_clip_region ||
-	     dest->common.clip_region.data == NULL))
-	{
-	    if (_pixman_run_fast_path_scale (op, src, mask, dest, src_x, src_y,
-	                                     mask_x, mask_y, dest_x, dest_y,
-	                                     width, height))
-	    {
-		return;
-	    }
-	}
-    }
-
     if (src->type == BITS
         && src->common.transform
         && !mask
         && op == PIXMAN_OP_SRC
         && !src->common.alpha_map && !dest->common.alpha_map
         && (src->common.filter == PIXMAN_FILTER_NEAREST)
         && PIXMAN_FORMAT_BPP (dest->bits.format) == 32
         && src->bits.format == dest->bits.format
--- a/gfx/cairo/libpixman/src/pixman-private.h
+++ b/gfx/cairo/libpixman/src/pixman-private.h
@@ -613,30 +613,16 @@ void
                                int32_t                  mask_x,
                                int32_t                  mask_y,
                                int32_t                  dest_x,
                                int32_t                  dest_y,
                                int32_t                  width,
                                int32_t                  height,
                                pixman_composite_func_t  composite_rect);
 
-pixman_bool_t
-_pixman_run_fast_path_scale (pixman_op_t      op,
-                             pixman_image_t * src_image,
-                             pixman_image_t * mask_image,
-                             pixman_image_t * dst_image,
-                             int32_t          src_x,
-                             int32_t          src_y,
-                             int32_t          mask_x,
-                             int32_t          mask_y,
-                             int32_t          dest_x,
-                             int32_t          dest_y,
-                             int32_t          width,
-                             int32_t          height);
-
 void
 pixman_expand (uint64_t *           dst,
                const uint32_t *     src,
                pixman_format_code_t format,
                int                  width);
 
 void
 pixman_contract (uint32_t *      dst,
--- a/gfx/thebes/public/gfxASurface.h
+++ b/gfx/thebes/public/gfxASurface.h
@@ -62,17 +62,16 @@ public:
      * The format for an image surface. For all formats with alpha data, 0
      * means transparent, 1 or 255 means fully opaque.
      */
     typedef enum {
         ImageFormatARGB32, ///< ARGB data in native endianness, using premultiplied alpha
         ImageFormatRGB24,  ///< xRGB data in native endianness
         ImageFormatA8,     ///< Only an alpha channel
         ImageFormatA1,     ///< Packed transparency information (one byte refers to 8 pixels)
-        ImageFormatRGB16,  ///< xRGB data in native endianness, using premultiplied alpha
         ImageFormatUnknown
     } gfxImageFormat;
 
     typedef enum {
         SurfaceTypeImage,
         SurfaceTypePDF,
         SurfaceTypePS,
         SurfaceTypeXlib,
@@ -89,18 +88,17 @@ public:
         SurfaceTypeScript,
         SurfaceTypeQPainter,
         SurfaceTypeDDraw
     } gfxSurfaceType;
 
     typedef enum {
         CONTENT_COLOR       = 0x1000,
         CONTENT_ALPHA       = 0x2000,
-        CONTENT_COLOR_ALPHA = 0x3000,
-        CONTENT_COLOR16     = 0x4000
+        CONTENT_COLOR_ALPHA = 0x3000
     } gfxContentType;
 
     /* Wrap the given cairo surface and return a gfxASurface for it */
     static already_AddRefed<gfxASurface> Wrap(cairo_surface_t *csurf);
 
     /*** this DOES NOT addref the surface */
     cairo_surface_t *CairoSurface() {
         NS_ASSERTION(mSurface != nsnull, "gfxASurface::CairoSurface called with mSurface == nsnull!");
--- a/gfx/thebes/src/gfxASurface.cpp
+++ b/gfx/thebes/src/gfxASurface.cpp
@@ -384,18 +384,16 @@ gfxASurface::EndPage()
 gfxASurface::gfxContentType
 gfxASurface::ContentFromFormat(gfxImageFormat format)
 {
     switch (format) {
         case ImageFormatARGB32:
             return CONTENT_COLOR_ALPHA;
         case ImageFormatRGB24:
             return CONTENT_COLOR;
-        case ImageFormatRGB16:
-            return CONTENT_COLOR16;
         case ImageFormatA8:
         case ImageFormatA1:
             return CONTENT_ALPHA;
 
         case ImageFormatUnknown:
         default:
             return CONTENT_COLOR;
     }
--- a/gfx/thebes/src/gfxImageSurface.cpp
+++ b/gfx/thebes/src/gfxImageSurface.cpp
@@ -117,18 +117,16 @@ long
 gfxImageSurface::ComputeStride() const
 {
     long stride;
 
     if (mFormat == ImageFormatARGB32)
         stride = mSize.width * 4;
     else if (mFormat == ImageFormatRGB24)
         stride = mSize.width * 4;
-    else if (mFormat == ImageFormatRGB16)
-        stride = mSize.width * 2;
     else if (mFormat == ImageFormatA8)
         stride = mSize.width;
     else if (mFormat == ImageFormatA1) {
         stride = (mSize.width + 7) / 8;
     } else {
         NS_WARNING("Unknown format specified to gfxImageSurface!");
         stride = mSize.width * 4;
     }
--- a/gfx/thebes/src/gfxQtPlatform.cpp
+++ b/gfx/thebes/src/gfxQtPlatform.cpp
@@ -190,51 +190,44 @@ gfxQtPlatform::CreateOffscreenSurface(co
     nsRefPtr<gfxASurface> newSurface = nsnull;
 
     if (mRenderMode == RENDER_QPAINTER) {
       newSurface = new gfxQPainterSurface(size, gfxASurface::ContentFromFormat(imageFormat));
       return newSurface.forget();
     }
 
     if (mRenderMode == RENDER_SHARED_IMAGE) {
-      if (imageFormat == gfxASurface::ImageFormatRGB24 && QX11Info().depth() == 16)
-          imageFormat = gfxASurface::ImageFormatRGB16;
       newSurface = new gfxImageSurface(size, imageFormat);
       return newSurface.forget();
     }
 
 #ifdef MOZ_X11
     int xrenderFormatID = -1;
     switch (imageFormat) {
         case gfxASurface::ImageFormatARGB32:
             xrenderFormatID = PictStandardARGB32;
             break;
         case gfxASurface::ImageFormatRGB24:
             xrenderFormatID = PictStandardRGB24;
             break;
-        case gfxASurface::ImageFormatRGB16:
-            break;
         case gfxASurface::ImageFormatA8:
             xrenderFormatID = PictStandardA8;
             break;
         case gfxASurface::ImageFormatA1:
             xrenderFormatID = PictStandardA1;
             break;
         default:
             return nsnull;
     }
 
     // XXX we really need a different interface here, something that passes
     // in more context, including the display and/or target surface type that
     // we should try to match
-    XRenderPictFormat* xrenderFormat = nsnull;
-    if ((xrenderFormatID == PictStandardRGB24 && QX11Info().depth() == 16) || xrenderFormatID == -1)
-        xrenderFormat = XRenderFindVisualFormat(QX11Info().display(), (Visual*)QX11Info().visual());
-    else
-        xrenderFormat = XRenderFindStandardFormat(QX11Info().display(), xrenderFormatID);
+    XRenderPictFormat* xrenderFormat =
+        XRenderFindStandardFormat(QX11Info().display(), xrenderFormatID);
 
     newSurface = new gfxXlibSurface((Display*)QX11Info().display(),
                                     xrenderFormat,
                                     size);
 #endif
 
     if (newSurface) {
         gfxContext ctx(newSurface);
--- a/gfx/thebes/src/gfxSharedImageSurface.cpp
+++ b/gfx/thebes/src/gfxSharedImageSurface.cpp
@@ -73,19 +73,16 @@ already_AddRefed<gfxASurface>
 gfxSharedImageSurface::getASurface(void)
 {
     NS_ENSURE_TRUE(mData, NULL);
 
     gfxASurface::gfxImageFormat imageFormat = gfxASurface::ImageFormatRGB24;
     if (mDepth == 32)
         imageFormat = gfxASurface::ImageFormatARGB32;
 
-    if (mDepth == 16)
-        imageFormat = gfxASurface::ImageFormatRGB16;
-
     gfxASurface* result = new gfxImageSurface(mData, mSize, mStride, imageFormat);
     NS_IF_ADDREF(result);
     return result;
 }
 
 #ifdef MOZ_WIDGET_QT
 static unsigned int
 getSystemDepth()
@@ -186,18 +183,16 @@ gfxSharedImageSurface::CreateInternal(in
 
 bool
 gfxSharedImageSurface::ComputeFormat()
 {
     if (mDepth == 32)
         mFormat = ImageFormatARGB32;
     if (mDepth == 24)
         mFormat = ImageFormatRGB24;
-    if (mDepth == 16)
-        mFormat = ImageFormatRGB16;
     else {
         NS_WARNING("Unknown depth specified to gfxSharedImageSurface!");
         mFormat = ImageFormatUnknown;
         return false;
     }
 
     return true;
 }
@@ -205,18 +200,16 @@ gfxSharedImageSurface::ComputeFormat()
 bool
 gfxSharedImageSurface::ComputeDepth()
 {
     mDepth = 0;
     if (mFormat == ImageFormatARGB32)
         mDepth = 32;
     else if (mFormat == ImageFormatRGB24)
         mDepth = 24;
-    else if (mFormat == ImageFormatRGB16)
-        mDepth = 16;
     else {
         NS_WARNING("Unknown format specified to gfxSharedImageSurface!");
         return false;
     }
 
     return true;
 }
 
--- a/ipc/glue/IPCMessageUtils.h
+++ b/ipc/glue/IPCMessageUtils.h
@@ -39,17 +39,16 @@
 #ifndef __IPC_GLUE_IPCMESSAGEUTILS_H__
 #define __IPC_GLUE_IPCMESSAGEUTILS_H__
 
 #include "chrome/common/ipc_message_utils.h"
 
 #include "prtypes.h"
 #include "nsStringGlue.h"
 #include "nsTArray.h"
-#include "gfxMatrix.h"
 
 #ifdef _MSC_VER
 #pragma warning( disable : 4800 )
 #endif
 
 namespace IPC {
 
 template<>
@@ -277,51 +276,11 @@ struct ParamTraits<float>
   }
 
   static void Log(const paramType& aParam, std::wstring* aLog)
   {
     aLog->append(StringPrintf(L"%g", aParam));
   }
 };
 
-template<>
-struct ParamTraits<gfxMatrix>
-{
-  typedef gfxMatrix paramType;
-
-  static void Write(Message* aMsg, const paramType& aParam)
-  {
-    WriteParam(aMsg, aParam.xx);
-    WriteParam(aMsg, aParam.xy);
-    WriteParam(aMsg, aParam.yx);
-    WriteParam(aMsg, aParam.yy);
-    WriteParam(aMsg, aParam.x0);
-    WriteParam(aMsg, aParam.y0);
-  }
-
-  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
-  {
-    if (!ReadParam(aMsg, aIter, &aResult->xx))
-      return false;
-    if (!ReadParam(aMsg, aIter, &aResult->xy))
-      return false;
-    if (!ReadParam(aMsg, aIter, &aResult->yx))
-      return false;
-    if (!ReadParam(aMsg, aIter, &aResult->yy))
-      return false;
-    if (!ReadParam(aMsg, aIter, &aResult->x0))
-      return false;
-    if (!ReadParam(aMsg, aIter, &aResult->y0))
-      return false;
-
-    return true;
-  }
-
-  static void Log(const paramType& aParam, std::wstring* aLog)
-  {
-    aLog->append(StringPrintf(L"[[%g %g] [%g %g] [%g %g]]", aParam.xx, aParam.xy, aParam.yx, aParam.yy,
-	  						    aParam.x0, aParam.y0));
-  }
-};
-
 } /* namespace IPC */
 
 #endif /* __IPC_GLUE_IPCMESSAGEUTILS_H__ */
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -84,20 +84,16 @@ public:
 
     typedef base::ProcessHandle ProcessHandle;
 
     virtual int32 Register(ListenerT*) = 0;
     virtual int32 RegisterID(ListenerT*, int32) = 0;
     virtual ListenerT* Lookup(int32) = 0;
     virtual void Unregister(int32) = 0;
     virtual void RemoveManagee(int32, ListenerT*) = 0;
-
-    virtual Shmem::SharedMemory* CreateSharedMemory(size_t, int32*) = 0;
-    virtual Shmem::SharedMemory* LookupSharedMemory(int32) = 0;
-
     // XXX odd duck, acknowledged
     virtual ProcessHandle OtherProcess() const = 0;
 };
 
 
 // This message is automatically sent by IPDL-generated code when a
 // new shmem segment is allocated.  It should never be used directly.
 class __internal__ipdl__ShmemCreated : public IPC::Message
--- a/ipc/glue/Shmem.h
+++ b/ipc/glue/Shmem.h
@@ -140,32 +140,16 @@ public:
   {
     mSegment = aRhs.mSegment;
     mData = aRhs.mData;
     mSize = aRhs.mSize;
     mId = aRhs.mId;
     return *this;
   }
 
-  // Returns whether this Shmem is writable by you, and thus whether you can
-  // transfer writability to another actor.
-  bool
-  IsWritable() const
-  {
-    return mSegment != NULL;
-  }
-
-  // Returns whether this Shmem is readable by you, and thus whether you can
-  // transfer readability to another actor.
-  bool
-  IsReadable() const
-  {
-    return mSegment != NULL;
-  }
-
   // Return a pointer to the user-visible data segment.
   template<typename T>
   T*
   get() const
   {
     AssertInvariants();
     AssertAligned<T>();
 
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -203,18 +203,18 @@ def _lookupListener(idexpr):
     return ExprCall(ExprVar('Lookup'), args=[ idexpr ])
 
 def _shmemType(ptr=0):
     return Type('Shmem', ptr=ptr)
 
 def _rawShmemType(ptr=0):
     return Type('Shmem::SharedMemory', ptr=ptr)
 
-def _shmemIdType(ptr=0):
-    return Type('Shmem::id_t', ptr=ptr)
+def _shmemIdType():
+    return Type('Shmem::id_t')
 
 def _shmemHandleType():
     return Type('Shmem::SharedMemoryHandle')
 
 def _shmemBackstagePass():
     return ExprCall(ExprVar(
         'Shmem::IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead'))
 
@@ -245,17 +245,17 @@ def _shmemForget(shmemexpr):
 def _shmemRevokeRights(shmemexpr):
     return ExprCall(ExprSelect(shmemexpr, '.', 'RevokeRights'),
                     args=[ _shmemBackstagePass() ])
 
 def _shmemCreatedMsgVar():
     return ExprVar('mozilla::ipc::__internal__ipdl__ShmemCreated')
 
 def _lookupShmem(idexpr):
-    return ExprCall(ExprVar('LookupSharedMemory'), args=[ idexpr ])
+    return ExprCall(ExprVar('LookupShmem'), args=[ idexpr ])
 
 def _makeForwardDecl(ptype, side):
     clsname = _actorName(ptype.qname.baseid, side)
 
     fd = ForwardDecl(clsname, cls=1)
     if 0 == len(ptype.qname.quals):
         return fd
 
@@ -1336,22 +1336,16 @@ class Protocol(ipdl.ast.Protocol):
     def unregisterMethod(self, actorThis=None):
         if actorThis is not None:
             return ExprSelect(actorThis, '->', 'Unregister')
         return ExprVar('Unregister')
 
     def removeManageeMethod(self):
         return ExprVar('RemoveManagee')
 
-    def createSharedMemory(self):
-        return ExprVar('CreateSharedMemory')
- 
-    def lookupSharedMemory(self):
-        return ExprVar('LookupSharedMemory')
- 
     def otherProcessMethod(self):
         return ExprVar('OtherProcess')
 
     def shouldContinueFromTimeoutVar(self):
         assert self.decl.type.isToplevel()
         return ExprVar('ShouldContinueFromReplyTimeout')
 
     def enteredCxxStackVar(self):
@@ -1443,36 +1437,52 @@ class Protocol(ipdl.ast.Protocol):
         """The member var my manager keeps of actors of my type."""
         assert self.decl.type.isManaged()
         return ExprSelect(
             ExprCall(self.managerMethod(thisvar)),
             '->', 'mManaged'+ _actorName(self.decl.type.name(), side))
 
     # shmem stuff
     def shmemMapVar(self):
-        assert self.decl.type.isToplevel()
+        assert self.usesShmem()
         return ExprVar('mShmemMap')
 
     def lastShmemIdVar(self):
-        assert self.decl.type.isToplevel()
+        assert self.usesShmem()
         return ExprVar('mLastShmemId')
 
     def shmemIdInit(self, side):
-        assert self.decl.type.isToplevel()
+        assert self.usesShmem()
         # use the same scheme for shmem IDs as actor IDs
         if side is 'parent':  return _FREED_ACTOR_ID
         elif side is 'child': return _NULL_ACTOR_ID
         else: assert 0
 
     def nextShmemIdExpr(self, side):
-        assert self.decl.type.isToplevel()
+        assert self.usesShmem()
         if side is 'parent':   op = '++'
         elif side is 'child':  op = '--'
         return ExprPrefixUnop(self.lastShmemIdVar(), op)
 
+    def lookupShmemVar(self):
+        assert self.usesShmem()
+        return ExprVar('LookupShmem')
+
+    def registerShmemVar(self):
+        assert self.usesShmem()
+        return ExprVar('RegisterShmem')
+
+    def registerShmemIdVar(self):
+        assert self.usesShmem()
+        return ExprVar('RegisterShmemId')
+
+    def unregisterShmemVar(self):
+        assert self.usesShmem()
+        return ExprVar('UnregisterShmem')
+
     def usesShmem(self):
         for md in self.messageDecls:
             for param in md.inParams:
                 if ipdl.type.hasshmem(param.type):
                     return True
             for ret in md.outParams:
                 if ipdl.type.hasshmem(ret.type):
                     return True
@@ -2667,17 +2677,17 @@ class _GenerateProtocolActorCode(ipdl.as
                              [ ExprVar.THIS ]) ]),
                 ExprMemberInit(p.lastActorIdVar(),
                                [ p.actorIdInit(self.side) ])
             ]
         else:
             ctor.memberinits = [
                 ExprMemberInit(p.idVar(), [ ExprLiteral.ZERO ]) ]
 
-        if p.decl.type.isToplevel():
+        if p.usesShmem():
             ctor.memberinits.append(
                 ExprMemberInit(p.lastShmemIdVar(),
                                [ p.shmemIdInit(self.side) ]))
 
         ctor.addstmt(StmtExpr(ExprCall(ExprVar('MOZ_COUNT_CTOR'),
                                        [ ExprVar(self.clsname) ])))
         self.cls.addstmts([ ctor, Whitespace.NL ])
 
@@ -2770,16 +2780,23 @@ class _GenerateProtocolActorCode(ipdl.as
             if toplevel.talksRpc():
                 self.rpcSwitch = StmtSwitch(msgtype)
 
         # implement Send*() methods and add dispatcher cases to
         # message switch()es
         for md in p.messageDecls:
             self.visitMessageDecl(md)
 
+        # "hidden" message that passes shmem mappings from one process
+        # to the other
+        if p.usesShmem():
+            self.asyncSwitch.addcase(
+                CaseLabel('SHMEM_CREATED_MESSAGE_TYPE'),
+                self.genShmemCreatedHandler())
+
         # add default cases
         default = StmtBlock()
         default.addstmt(StmtReturn(_Result.NotKnown))
         self.asyncSwitch.addcase(DefaultLabel(), default)
         if toplevel.talksSync():
             self.syncSwitch.addcase(DefaultLabel(), default)
             if toplevel.talksRpc():
                 self.rpcSwitch.addcase(DefaultLabel(), default)
@@ -2902,25 +2919,25 @@ class _GenerateProtocolActorCode(ipdl.as
                                   args=[ _DestroyReason.AbnormalShutdown ])),
                 StmtExpr(ExprCall(deallocsubtreevar))
             ])
         else:
             onerror.addstmt(
                 _runtimeAbort("`OnError' called on non-toplevel actor"))
         self.cls.addstmts([ onerror, Whitespace.NL ])
 
-        # User-facing shmem methods
-        self.cls.addstmts(self.makeShmemIface())
- 
         # FIXME/bug 535053: only manager protocols and non-manager
         # protocols with union types need Lookup().  we'll give it to
         # all for the time being (simpler)
         if 1 or ptype.isManager():
             self.cls.addstmts(self.implementManagerIface())
 
+        if p.usesShmem():
+            self.cls.addstmts(self.makeShmemIface())
+
         if ptype.isToplevel() and self.side is 'parent':
             ## bool GetMinidump(nsIFile** dump)
             self.cls.addstmt(Label.PROTECTED)
 
             otherpidvar = ExprVar('OtherSidePID')
             otherpid = MethodDefn(MethodDecl(
                 otherpidvar.name, params=[ ],
                 ret=Type('base::ProcessId'),
@@ -3102,17 +3119,17 @@ class _GenerateProtocolActorCode(ipdl.as
                               p.otherProcessVar().name))
             ])
         elif ptype.isManaged():
             self.cls.addstmts([
                 StmtDecl(Decl(_actorIdType(), p.idVar().name)),
                 StmtDecl(Decl(p.managerInterfaceType(ptr=1),
                               p.managerVar().name))
             ])
-        if p.decl.type.isToplevel():
+        if p.usesShmem():
             self.cls.addstmts([
                 StmtDecl(Decl(Type('IDMap', T=_rawShmemType()),
                               p.shmemMapVar().name)),
                 StmtDecl(Decl(_shmemIdType(), p.lastShmemIdVar().name))
             ])
 
         for managed in ptype.manages:
             self.cls.addstmts([
@@ -3120,17 +3137,16 @@ class _GenerateProtocolActorCode(ipdl.as
                 StmtDecl(Decl(
                     p.managedVarType(managed, self.side),
                     p.managedVar(managed, self.side).name)) ])
 
     def implementManagerIface(self):
         p = self.protocol
         routedvar = ExprVar('aRouted')
         idvar = ExprVar('aId')
-        sizevar = ExprVar('aSize')
         listenertype = Type('ChannelListener', ptr=1)
 
         register = MethodDefn(MethodDecl(
             p.registerMethod().name,
             params=[ Decl(listenertype, routedvar.name) ],
             ret=_actorIdType(), virtual=1))
         registerid = MethodDefn(MethodDecl(
             p.registerIDMethod().name,
@@ -3141,29 +3157,16 @@ class _GenerateProtocolActorCode(ipdl.as
         lookup = MethodDefn(MethodDecl(
             p.lookupIDMethod().name,
             params=[ Decl(_actorIdType(), idvar.name) ],
             ret=listenertype, virtual=1))
         unregister = MethodDefn(MethodDecl(
             p.unregisterMethod().name,
             params=[ Decl(_actorIdType(), idvar.name) ],
             virtual=1))
-
-        createshmem = MethodDefn(MethodDecl(
-            p.createSharedMemory().name,
-            ret=_rawShmemType(ptr=1),
-            params=[ Decl(Type.SIZE, sizevar.name),
-                     Decl(_shmemIdType(ptr=1), idvar.name) ],
-            virtual=1))
-        lookupshmem = MethodDefn(MethodDecl(
-            p.lookupSharedMemory().name,
-            ret=_rawShmemType(ptr=1),
-            params=[ Decl(_shmemIdType(), idvar.name) ],
-            virtual=1))
-        
         otherprocess = MethodDefn(MethodDecl(
             p.otherProcessMethod().name,
             ret=Type('ProcessHandle'),
             const=1,
             virtual=1))
 
         if p.decl.type.isToplevel():
             tmpvar = ExprVar('tmp')
@@ -3182,105 +3185,31 @@ class _GenerateProtocolActorCode(ipdl.as
                 StmtReturn(idvar)
             ])
             lookup.addstmt(StmtReturn(
                 ExprCall(ExprSelect(p.actorMapVar(), '.', 'Lookup'),
                          [ idvar ])))
             unregister.addstmt(StmtReturn(
                 ExprCall(ExprSelect(p.actorMapVar(), '.', 'Remove'),
                          [ idvar ])))
-
-            # SharedMemory* CreateSharedMemory(size, id_t*):
-            #   nsAutoPtr<shmem_t> shmem(Shmem::Alloc(size));
-            #   if (!shmem)
-            #     return false
-            #   shmemhandle_t handle;
-            #   if (!shmem->ShareToProcess(subprocess, &handle))
-            #     return false;
-            #   Shmem::id_t id = [nextshmemid];
-            #   mShmemMap.Add(rawshmem, id);
-            #   Message* msg = new __internal__ipdl__ShmemCreated(
-            #      mRoutingId, handle, id, size);
-            #   if (!Send(msg))
-            #     return false;
-            #   return shmem.forget();
-            rawvar = ExprVar('rawshmem')
-            handlevar = ExprVar('handle')
-
-            createshmem.addstmt(StmtDecl(
-                Decl(_autoptr(_rawShmemType()), rawvar.name),
-                initargs=[ _shmemAlloc(sizevar) ]))
-            failif = StmtIf(ExprNot(rawvar))
-            failif.addifstmt(StmtReturn(ExprLiteral.FALSE))
-            createshmem.addstmt(failif)
-
-            createshmem.addstmt(StmtDecl(
-                Decl(_shmemHandleType(), handlevar.name)))
-            failif = StmtIf(ExprNot(ExprCall(
-                ExprSelect(rawvar, '->', 'ShareToProcess'),
-                args=[ ExprCall(p.otherProcessMethod()),
-                       ExprAddrOf(handlevar) ])))
-            failif.addifstmt(StmtReturn(ExprLiteral.FALSE))
-            createshmem.addstmt(failif)
-
-            createshmem.addstmts([
-                StmtExpr(ExprAssn(
-                    ExprDeref(idvar),
-                    p.nextShmemIdExpr(self.side))),
-                StmtDecl(ExprCall(
-                    ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
-                    args=[ rawvar, ExprDeref(idvar) ]))
-            ])
-
-            msgvar = ExprVar('msg')
-            createshmem.addstmts([
-                StmtDecl(
-                    Decl(Type('Message', ptr=1), msgvar.name),
-                    ExprNew(Type(_shmemCreatedMsgVar().name),
-                            args=[ p.routingId(), handlevar,
-                                   ExprDeref(idvar), sizevar ])),
-                # TODO handle failed sends
-                StmtExpr(ExprCall(
-                    ExprSelect(p.channelVar(), p.channelSel(), 'Send'),
-                    args=[ msgvar ])),
-                StmtReturn(_autoptrForget(rawvar))
-            ])
-
-            lookupshmem.addstmt(StmtReturn(ExprCall(
-                ExprSelect(p.shmemMapVar(), '.', 'Lookup'),
-                args=[ idvar ])))
-
-            # "private" message that passes shmem mappings from one process
-            # to the other
-            if p.usesShmem():
-                self.asyncSwitch.addcase(
-                    CaseLabel('SHMEM_CREATED_MESSAGE_TYPE'),
-                    self.genShmemCreatedHandler())
-            
             otherprocess.addstmt(StmtReturn(p.otherProcessVar()))
         else:
             # delegate registration to manager
             register.addstmt(StmtReturn(ExprCall(
                 ExprSelect(p.managerVar(), '->', p.registerMethod().name),
                 [ routedvar ])))
             registerid.addstmt(StmtReturn(ExprCall(
                 ExprSelect(p.managerVar(), '->', p.registerIDMethod().name),
                 [ routedvar, idvar ])))
             lookup.addstmt(StmtReturn(ExprCall(
                 ExprSelect(p.managerVar(), '->', p.lookupIDMethod().name),
                 [ idvar ])))
             unregister.addstmt(StmtReturn(ExprCall(
                 ExprSelect(p.managerVar(), '->', p.unregisterMethod().name),
                 [ idvar ])))
-            createshmem.addstmt(StmtReturn(ExprCall(
-                ExprSelect(p.managerVar(), '->', p.createSharedMemory().name),
-                [ sizevar, idvar ])))
-            lookupshmem.addstmt(StmtReturn(ExprCall(
-                ExprSelect(p.managerVar(), '->', p.lookupSharedMemory().name),
-                [ idvar ])))
             otherprocess.addstmt(StmtReturn(ExprCall(
                 ExprSelect(p.managerVar(), '->',
                            p.otherProcessMethod().name))))
 
         # all protocols share the "same" RemoveManagee() implementation
         pvar = ExprVar('aProtocolId')
         listenervar = ExprVar('aListener')
         removemanagee = MethodDefn(MethodDecl(
@@ -3319,65 +3248,147 @@ class _GenerateProtocolActorCode(ipdl.as
 
         removemanagee.addstmt(switchontype)
 
         return [ register,
                  registerid,
                  lookup,
                  unregister,
                  removemanagee,
-                 createshmem,
-                 lookupshmem,
                  otherprocess,
                  Whitespace.NL ]
 
+
     def makeShmemIface(self):
         p = self.protocol
         idvar = ExprVar('aId')
-        sizevar = ExprVar('aSize')
-        memvar = ExprVar('aMem')
-        rawvar = ExprVar('rawmem')
 
         # bool AllocShmem(size_t size, Shmem* outmem):
-        #   id_t id;
-        #   nsAutoPtr<SharedMemory> mem(CreateSharedMemory(&id));
-        #   if (!mem)
+        #   nsAutoPtr<shmem_t> shmem(Shmem::Alloc(size));
+        #   if (!shmem)
+        #     return false
+        #   shmemhandle_t handle;
+        #   if (!shmem->ShareToProcess(subprocess, &handle))
         #     return false;
-        #   *outmem = Shmem(shmem, id)
+        #   Shmem::id_t id = RegisterShmem(shmem);
+        #   Message* msg = new __internal__ipdl__ShmemCreated(
+        #      mRoutingId, handle, id, size);
+        #   if (!Send(msg))
+        #     return false;
+        #   *aMem = Shmem(shmem, id);
         #   return true;
+        sizevar = ExprVar('aSize')
+        memvar = ExprVar('aMem')
         allocShmem = MethodDefn(MethodDecl(
             'AllocShmem',
             params=[ Decl(Type.SIZE, sizevar.name),
                      Decl(_shmemType(ptr=1), memvar.name) ],
             ret=Type.BOOL))
 
-        ifallocfails = StmtIf(ExprNot(rawvar))
-        ifallocfails.addifstmt(StmtReturn(ExprLiteral.FALSE))
+        rawvar = ExprVar('rawmem')
+        allocShmem.addstmt(StmtDecl(
+            Decl(_autoptr(_rawShmemType()), rawvar.name),
+            initargs=[ _shmemAlloc(sizevar) ]))
+        failif = StmtIf(ExprNot(rawvar))
+        failif.addifstmt(StmtReturn(ExprLiteral.FALSE))
+        allocShmem.addstmt(failif)
+
+        handlevar = ExprVar('handle')
+        allocShmem.addstmt(StmtDecl(
+            Decl(_shmemHandleType(), handlevar.name)))
+        failif = StmtIf(ExprNot(ExprCall(
+            ExprSelect(rawvar, '->', 'ShareToProcess'),
+            args=[ ExprCall(p.otherProcessMethod()),
+                   ExprAddrOf(handlevar) ])))
+        failif.addifstmt(StmtReturn(ExprLiteral.FALSE))
+        allocShmem.addstmt(failif)
+
+        allocShmem.addstmt(StmtDecl(
+            Decl(_shmemIdType(), idvar.name),
+            ExprCall(p.registerShmemVar(), args=[ rawvar ])))
+
+        msgvar = ExprVar('msg')
+        allocShmem.addstmt(StmtDecl(
+            Decl(Type('Message', ptr=1), msgvar.name),
+            ExprNew(Type(_shmemCreatedMsgVar().name),
+                    args=[ p.routingId(), handlevar, idvar, sizevar ])))
+
+        failif = StmtIf(ExprNot(ExprCall(
+            ExprSelect(p.channelVar(), p.channelSel(), 'Send'),
+            args=[ msgvar ])))
+        failif.addifstmts([
+            StmtExpr(ExprCall(p.unregisterShmemVar(), args=[ idvar ])),
+            StmtReturn(ExprLiteral.FALSE)
+        ])
+        allocShmem.addstmt(failif)
 
         allocShmem.addstmts([
-            StmtDecl(Decl(_shmemIdType(), idvar.name)),
-            StmtDecl(Decl(_autoptr(_rawShmemType()), rawvar.name),
-                     initargs=[ ExprCall(p.createSharedMemory(),
-                                         args=[ sizevar,
-                                                ExprAddrOf(idvar) ]) ]),
-            ifallocfails,
-            Whitespace.NL,
             StmtExpr(ExprAssn(
                 ExprDeref(memvar), _shmemCtor(_autoptrForget(rawvar), idvar))),
             StmtReturn(ExprLiteral.TRUE)
         ])
-                
-        return [ Whitespace('// Methods for managing shmem\n', indent=1),
-                 allocShmem,
-                 Whitespace.NL ]
+
+        # TODO: DeallocShmem().  not needed until actors outlast their
+        # shmem mappings.
+        
+        # This code is pretty similar to |implementManagerIface()|
+        lookupShmem = MethodDefn(MethodDecl(
+            p.lookupShmemVar().name,
+            params=[ Decl(_shmemIdType(), idvar.name) ],
+            ret=_rawShmemType(ptr=1)))
+        lookupShmem.addstmt(StmtReturn(ExprCall(
+            ExprSelect(p.shmemMapVar(), '.', 'Lookup'),
+            args=[ idvar ])))
+
+        mapvar = ExprVar('aMap')
+        tmpvar = ExprVar('tmp')
+        registerShmem = MethodDefn(MethodDecl(
+            p.registerShmemVar().name,
+            params=[ Decl(_rawShmemType(ptr=1), mapvar.name) ],
+            ret=_shmemIdType()))
+        registerShmem.addstmts([
+            StmtDecl(Decl(_shmemIdType(), tmpvar.name),
+                     p.nextShmemIdExpr(self.side)),
+            StmtExpr(ExprCall(ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
+                              [ mapvar, tmpvar ])),
+            StmtReturn(tmpvar)
+        ])
+
+        registerShmemById = MethodDefn(MethodDecl(
+            p.registerShmemIdVar().name,
+            params=[ Decl(_rawShmemType(ptr=1), mapvar.name),
+                     Decl(_shmemIdType(), idvar.name) ],
+            ret=_shmemIdType()))
+        registerShmemById.addstmts([
+            StmtExpr(ExprCall(ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
+                              [ mapvar, idvar ])),
+            StmtReturn(idvar)
+        ])
+
+        unregisterShmem = MethodDefn(MethodDecl(
+            p.unregisterShmemVar().name,
+            params=[ Decl(_shmemIdType(), idvar.name) ]))
+        unregisterShmem.addstmts([
+            StmtExpr(ExprCall(ExprSelect(p.shmemMapVar(), '.', 'Remove'),
+                              args=[ idvar ]))
+        ])
+
+        return [
+            Whitespace('// Methods for managing shmem\n', indent=1),
+            allocShmem,
+            Whitespace.NL,
+            Label.PRIVATE,
+            lookupShmem,
+            registerShmem,
+            registerShmemById,
+            unregisterShmem,
+            Whitespace.NL
+        ]
 
     def genShmemCreatedHandler(self):
-        p = self.protocol
-        assert p.decl.type.isToplevel()
-        
         case = StmtBlock()                                          
 
         handlevar = ExprVar('handle')
         idvar = ExprVar('id')
         sizevar = ExprVar('size')
         rawvar = ExprVar('rawmem')
         failif = StmtIf(ExprNot(ExprCall(
             ExprVar(_shmemCreatedMsgVar().name +'::Read'),
@@ -3398,19 +3409,18 @@ class _GenerateProtocolActorCode(ipdl.as
                      initargs=[ _shmemOpenExisting(sizevar, handlevar) ])
         ])
 
         failif = StmtIf(ExprNot(rawvar))
         failif.addifstmt(StmtReturn(_Result.ValuError))
 
         case.addstmts([
             failif,
-            StmtExpr(ExprCall(
-                ExprSelect(p.shmemMapVar(), '.', 'AddWithID'),
-                args=[ _autoptrForget(rawvar), idvar ])),
+            StmtExpr(ExprCall(self.protocol.registerShmemIdVar(),
+                              args=[ _autoptrForget(rawvar), idvar ])),
             Whitespace.NL,
             StmtReturn(_Result.Processed)
         ])
 
         return case
 
 
     ##-------------------------------------------------------------------------
--- a/netwerk/protocol/res/src/nsResProtocolHandler.cpp
+++ b/netwerk/protocol/res/src/nsResProtocolHandler.cpp
@@ -203,23 +203,16 @@ nsResProtocolHandler::Init()
     // but once I finish multiple chrome registration I'm not sure that it is needed
 
     // XXX dveditz: resource://pchrome/ defeats profile directory salting
     // if web content can load it. Tread carefully.
 
     return rv;
 }
 
-void
-nsResProtocolHandler::EnumerateSubstitutions(SubstitutionTable::EnumReadFunction enumFunc,
-                                             void* userArg)
-{
-    mSubstitutions.EnumerateRead(enumFunc, userArg);
-}
-
 //----------------------------------------------------------------------------
 // nsResProtocolHandler::nsISupports
 //----------------------------------------------------------------------------
 
 NS_IMPL_THREADSAFE_ISUPPORTS3(nsResProtocolHandler,
                               nsIResProtocolHandler,
                               nsIProtocolHandler,
                               nsISupportsWeakReference)
--- a/netwerk/protocol/res/src/nsResProtocolHandler.h
+++ b/netwerk/protocol/res/src/nsResProtocolHandler.h
@@ -54,32 +54,27 @@ public:
     nsResURL() : nsStandardURL(PR_TRUE) {}
     virtual nsStandardURL* StartClone();
     virtual nsresult EnsureFile();
     NS_IMETHOD GetClassIDNoAlloc(nsCID *aCID);
 };
 
 class nsResProtocolHandler : public nsIResProtocolHandler, public nsSupportsWeakReference
 {
-private:
-    typedef nsInterfaceHashtable<nsCStringHashKey,nsIURI> SubstitutionTable;
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
     NS_DECL_NSIRESPROTOCOLHANDLER
 
     nsResProtocolHandler();
     virtual ~nsResProtocolHandler();
 
     nsresult Init();
 
-    void EnumerateSubstitutions(SubstitutionTable::EnumReadFunction enumFunc,
-                                void* userArg);
-
 private:
     nsresult AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution);
-    SubstitutionTable mSubstitutions;
+    nsInterfaceHashtable<nsCStringHashKey,nsIURI> mSubstitutions;
     nsCOMPtr<nsIIOService> mIOService;
 
     friend class nsResURL;
 };
 
 #endif /* nsResProtocolHandler_h___ */
--- a/toolkit/components/places/src/History.cpp
+++ b/toolkit/components/places/src/History.cpp
@@ -32,21 +32,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifdef MOZ_IPC
-#include "mozilla/dom/ContentProcessChild.h"
-#include "mozilla/dom/ContentProcessParent.h"
-#endif
-
 #include "History.h"
 #include "nsNavHistory.h"
 
 #include "mozilla/storage.h"
 #include "mozilla/dom/Link.h"
 #include "nsDocShellCID.h"
 #include "nsIEventStateManager.h"
 
@@ -109,17 +104,37 @@ public:
   {
     // mIsVisited is already set to false, and that's the assumption we will
     // make if an error occurred.
     return NS_OK;
   }
 
   NS_IMETHOD HandleCompletion(PRUint16 aReason)
   {
-    History::GetService()->NotifyVisited(mURI, mIsVisited);
+    if (mIsVisited) {
+      History::GetService()->NotifyVisited(mURI);
+    }
+
+    // Notify any observers about that we have resolved the visited state of
+    // this URI.
+    nsCOMPtr<nsIObserverService> observerService =
+      do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
+    if (observerService) {
+      nsAutoString status;
+      if (mIsVisited) {
+        status.AssignLiteral(URI_VISITED);
+      }
+      else {
+        status.AssignLiteral(URI_NOT_VISITED);
+      }
+      (void)observerService->NotifyObservers(mURI,
+                                             URI_VISITED_RESOLUTION_TOPIC,
+                                             status.get());
+    }
+
     return NS_OK;
   }
 private:
   VisitedQuery(nsIURI* aURI)
   : mURI(aURI)
   , mIsVisited(false)
   {
   }
@@ -152,77 +167,45 @@ History::~History()
   if (mObservers.IsInitialized()) {
     NS_ASSERTION(mObservers.Count() == 0,
                  "Not all Links were removed before we disappear!");
   }
 #endif
 }
 
 void
-History::NotifyVisited(nsIURI* aURI, bool aIsVisited)
+History::NotifyVisited(nsIURI* aURI)
 {
   NS_ASSERTION(aURI, "Ruh-roh!  A NULL URI was passed to us!");
 
-#ifdef MOZ_IPC
-  if (XRE_GetProcessType() == GeckoProcessType_Default) {
-    mozilla::dom::ContentProcessParent * cpp = 
-        mozilla::dom::ContentProcessParent::GetSingleton();
-    NS_ASSERTION(cpp, "Content Protocol is NULL!");
-
-    nsCString aURISpec;
-    aURI->GetSpec(aURISpec);
-    cpp->SendNotifyVisited(aURISpec, aIsVisited);
+  // If the hash table has not been initialized, then we have nothing to notify
+  // about.
+  if (!mObservers.IsInitialized()) {
+    return;
   }
-#endif
 
-  if (aIsVisited) {
-    // If the hash table has not been initialized, then we have nothing to notify
-    // about.
-    if (!mObservers.IsInitialized()) {
-      return;
-    }
+  // Additionally, if we have no observers for this URI, we have nothing to
+  // notify about.
+  KeyClass* key = mObservers.GetEntry(aURI);
+  if (!key) {
+    return;
+  }
 
-    // Additionally, if we have no observers for this URI, we have nothing to
-    // notify about.
-    KeyClass* key = mObservers.GetEntry(aURI);
-    if (!key) {
-      return;
-    }
-
-    // Walk through the array, and update each Link node.
-    const ObserverArray& observers = key->array;
-    ObserverArray::index_type len = observers.Length();
-    for (ObserverArray::index_type i = 0; i < len; i++) {
-      Link* link = observers[i];
-      link->SetLinkState(eLinkState_Visited);
-      NS_ASSERTION(len == observers.Length(),
-                   "Calling SetLinkState added or removed an observer!");
-    }
+  // Walk through the array, and update each Link node.
+  const ObserverArray& observers = key->array;
+  ObserverArray::index_type len = observers.Length();
+  for (ObserverArray::index_type i = 0; i < len; i++) {
+    Link* link = observers[i];
+    link->SetLinkState(eLinkState_Visited);
+    NS_ASSERTION(len == observers.Length(),
+                 "Calling SetLinkState added or removed an observer!");
+  }
 
   // All the registered nodes can now be removed for this URI.
   mObservers.RemoveEntry(aURI);
-  }
-
-  // Notify any observers about that we have resolved the visited state of
-  // this URI.
-  nsCOMPtr<nsIObserverService> observerService =
-    do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
-  if (observerService) {
-    nsAutoString status;
-    if (aIsVisited) {
-      status.AssignLiteral(URI_VISITED);
-    }
-    else {
-      status.AssignLiteral(URI_NOT_VISITED);
-    }
-    (void)observerService->NotifyObservers(aURI,
-      URI_VISITED_RESOLUTION_TOPIC,
-      status.get());
-  }
-
 }
 
 /* static */
 History*
 History::GetService()
 {
   if (gService) {
     return gService;
@@ -250,25 +233,16 @@ History::GetSingleton()
 
 ////////////////////////////////////////////////////////////////////////////////
 //// IHistory
 
 NS_IMETHODIMP
 History::RegisterVisitedCallback(nsIURI* aURI,
                                  Link* aLink)
 {
-  nsresult   rv;
-
-#ifdef MOZ_IPC
-  if (XRE_GetProcessType() == GeckoProcessType_Default) {
-      rv = VisitedQuery::Start(aURI);
-      return rv;
-  }
-#endif
-
   NS_ASSERTION(aURI, "Must pass a non-null URI!");
   NS_ASSERTION(aLink, "Must pass a non-null Link object!");
 
   // First, ensure that our hash table is setup.
   if (!mObservers.IsInitialized()) {
     NS_ENSURE_TRUE(mObservers.Init(), NS_ERROR_OUT_OF_MEMORY);
   }
 
@@ -282,29 +256,17 @@ History::RegisterVisitedCallback(nsIURI*
 
   if (observers.IsEmpty()) {
     NS_ASSERTION(!keyAlreadyExists,
                  "An empty key was kept around in our hashtable!");
 
     // We are the first Link node to ask about this URI, or there are no pending
     // Links wanting to know about this URI.  Therefore, we should query the
     // database now.
-#ifdef MOZ_IPC
-  if (XRE_GetProcessType() == GeckoProcessType_Content) {
-    mozilla::dom::ContentProcessChild * cpc = 
-        mozilla::dom::ContentProcessChild::GetSingleton();
-    NS_ASSERTION(cpc, "Content Protocol is NULL!");
-
-    nsCString aURISpec;
-    aURI->GetSpec(aURISpec);
-    cpc->SendStartVisitedQuery(aURISpec, &rv);
-  }
-#else
-    rv = VisitedQuery::Start(aURI);
-#endif
+    nsresult rv = VisitedQuery::Start(aURI);
     if (NS_FAILED(rv)) {
       // Remove our array from the hashtable so we don't keep it around.
       mObservers.RemoveEntry(aURI);
       return rv;
     }
   }
 
   // Sanity check that Links are not registered more than once for a given URI.
--- a/toolkit/components/places/src/History.h
+++ b/toolkit/components/places/src/History.h
@@ -62,17 +62,17 @@ public:
   History();
 
   /**
    * Notifies about the visited status of a given URI.
    *
    * @param aURI
    *        The URI to notify about.
    */
-  void NotifyVisited(nsIURI *aURI, bool mIsVisited = true);
+  void NotifyVisited(nsIURI *aURI);
 
   /**
    * Obtains a pointer to this service.
    */
   static History *GetService();
 
   /**
    * Obtains a pointer that has had AddRef called on it.  Used by the service
--- a/toolkit/components/places/src/Makefile.in
+++ b/toolkit/components/places/src/Makefile.in
@@ -45,21 +45,16 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE = places
 LIBRARY_NAME  = places
 LIBXUL_LIBRARY = 1
 EXPORT_LIBRARY = 1
 MODULE_NAME = nsPlacesModule
 IS_COMPONENT = 1
 
-EXPORTS_NAMESPACES = mozilla/places
-
-EXPORTS_mozilla/places = \
-  History.h \
-  $(NULL)
 
 CPPSRCS = \
           nsAnnoProtocolHandler.cpp \
           nsAnnotationService.cpp \
           nsFaviconService.cpp \
           nsNavHistory.cpp \
           nsNavHistoryQuery.cpp \
           nsNavHistoryResult.cpp \
@@ -93,11 +88,9 @@ endif
 
 EXTRA_JS_MODULES = \
   utils.js \
   PlacesDBUtils.jsm \
   $(NULL)
 
 EXTRA_PP_JS_MODULES = utils.js
 
-include $(topsrcdir)/config/config.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
-include $(topsrcdir)/config/rules.mk
\ No newline at end of file
+include $(topsrcdir)/config/rules.mk
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -180,17 +180,16 @@ endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/dom/ipc \
   -I$(topsrcdir)/toolkit/crashreporter \
-  -I$(topsrcdir)/chrome/src \
   $(NULL)
 
 ifdef BUILD_STATIC_LIBS
 export::
 	@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_LINK_COMP_NAMES) Apprunner
 endif
 
 LOCAL_INCLUDES += \
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -50,18 +50,16 @@
 
 #include "nsIAppShell.h"
 #include "nsIAppStartupNotifier.h"
 #include "nsIDirectoryService.h"
 #include "nsILocalFile.h"
 #include "nsIToolkitChromeRegistry.h"
 #include "nsIToolkitProfile.h"
 
-#include "nsChromeRegistry.h"
-
 #if defined(OS_LINUX)
 #  define XP_LINUX
 #endif
 
 #ifdef XP_WIN
 #include <process.h>
 #endif
 
@@ -87,17 +85,16 @@
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 #include "mozilla/ipc/BrowserProcessSubThread.h"
 #include "ScopedXREEmbed.h"
 
 #include "mozilla/plugins/PluginThreadChild.h"
 #include "mozilla/dom/ContentProcessThread.h"
 #include "mozilla/dom/ContentProcessParent.h"
 #include "mozilla/dom/ContentProcessChild.h"
-#include "mozilla/dom/TabParent.h"
 
 #include "mozilla/ipc/TestShellParent.h"
 #include "mozilla/ipc/XPCShellEnvironment.h"
 #include "mozilla/Monitor.h"
 
 #ifdef MOZ_IPDL_TESTS
 #include "mozilla/_ipdltest/IPDLUnitTests.h"
 #include "mozilla/_ipdltest/IPDLUnitTestThreadChild.h"
@@ -230,66 +227,16 @@ XRE_TermEmbedding()
                "XRE_TermEmbedding without XRE_InitEmbedding");
 
   gDirServiceProvider->DoShutdown();
   NS_ShutdownXPCOM(nsnull);
   delete [] sCombined;
   delete gDirServiceProvider;
 }
 
-static nsresult
-GetChromeRegistry(nsChromeRegistry* *aResult)
-{
-  if(!nsChromeRegistry::gChromeRegistry)
-  {
-    // We don't actually want this ref, we just want the service to
-    // initialize if it hasn't already.
-    nsCOMPtr<nsIChromeRegistry> reg(do_GetService(NS_CHROMEREGISTRY_CONTRACTID));
-    NS_ENSURE_TRUE(nsChromeRegistry::gChromeRegistry, NS_ERROR_FAILURE);
-  }
-  *aResult = nsChromeRegistry::gChromeRegistry;
-  return NS_OK;
-}
-
-nsresult
-XRE_SendParentChromeRegistry(mozilla::dom::TabParent* aParent)
-{
-  nsChromeRegistry* chromeRegistry = nsnull;
-  nsresult rv = GetChromeRegistry(&chromeRegistry);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  chromeRegistry->SendRegisteredPackages(aParent);
-  return NS_OK;
-}
-
-nsresult
-XRE_RegisterChromePackage(const nsString& aPackage,
-                          const nsString& aBaseURI,
-                          const PRUint32& aFlags)
-{
-  nsChromeRegistry* chromeRegistry = nsnull;
-  nsresult rv = GetChromeRegistry(&chromeRegistry);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  chromeRegistry->RegisterPackage(aPackage, aBaseURI, aFlags);
-  return NS_OK;
-}
-
-nsresult
-XRE_RegisterChromeResource(const nsString& aPackage,
-                           const nsString& aResolvedURI)
-{
-  nsChromeRegistry* chromeRegistry = nsnull;
-  nsresult rv = GetChromeRegistry(&chromeRegistry);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  chromeRegistry->RegisterResource(aPackage, aResolvedURI);
-  return NS_OK;
-}
-
 const char*
 XRE_ChildProcessTypeToString(GeckoProcessType aProcessType)
 {
   return (aProcessType < GeckoProcessType_End) ?
     kGeckoProcessTypeString[aProcessType] : nsnull;
 }
 
 GeckoProcessType
--- a/widget/src/qt/nsIdleServiceQt.cpp
+++ b/widget/src/qt/nsIdleServiceQt.cpp
@@ -32,23 +32,25 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include <QX11Info>
-
 #include "nsIdleServiceQt.h"
 #include "nsIServiceManager.h"
 #include "nsDebug.h"
 #include "prlink.h"
 
+
+#ifdef Q_WS_X11
+#include <QX11Info>
+
 typedef PRBool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
                                                  int* error_base);
 
 typedef XScreenSaverInfo* (*_XScreenSaverAllocInfo_fn)(void);
 
 typedef void (*_XScreenSaverQueryInfo_fn)(Display* dpy, Drawable drw,
                                           XScreenSaverInfo *info);
 
@@ -127,8 +129,32 @@ nsIdleServiceQt::GetIdleTime(PRUint32 *a
 
         _XSSQueryInfo(dplay, QX11Info::appRootWindow(), mXssInfo);
         *aTimeDiff = mXssInfo->idle;
         return NS_OK;
     }
 
     return NS_ERROR_FAILURE;
 }
+
+#else
+
+NS_IMPL_ISUPPORTS1(nsIdleServiceQt, nsIIdleService)
+
+nsIdleServiceQt::nsIdleServiceQt()
+{
+}
+
+static void Initialize()
+{
+}
+
+nsIdleServiceQt::~nsIdleServiceQt()
+{
+}
+
+NS_IMETHODIMP
+nsIdleServiceQt::GetIdleTime(PRUint32 *aTimeDiff)
+{
+    return NS_ERROR_FAILURE;
+}
+
+#endif
--- a/widget/src/qt/nsNativeThemeQt.cpp
+++ b/widget/src/qt/nsNativeThemeQt.cpp
@@ -100,18 +100,16 @@ static inline QRect qRectInPixels(const 
 static inline QImage::Format
 _qimage_from_gfximage_format (gfxASurface::gfxImageFormat aFormat)
 {
     switch (aFormat) {
     case gfxASurface::ImageFormatARGB32:
         return QImage::Format_ARGB32_Premultiplied;
     case gfxASurface::ImageFormatRGB24:
         return QImage::Format_RGB32;
-    case gfxASurface::ImageFormatRGB16:
-        return QImage::Format_RGB16;
     case gfxASurface::ImageFormatA8:
         return QImage::Format_Indexed8;
     case gfxASurface::ImageFormatA1:
 #ifdef WORDS_BIGENDIAN
         return QImage::Format_Mono;
 #else
         return QImage::Format_MonoLSB;
 #endif
--- a/widget/src/qt/nsWidgetFactory.cpp
+++ b/widget/src/qt/nsWidgetFactory.cpp
@@ -155,20 +155,22 @@ static const nsModuleComponentInfo compo
     { "Qt Drag Service",
       NS_DRAGSERVICE_CID,
       "@mozilla.org/widget/dragservice;1",
       nsDragServiceConstructor },
     { "Qt Bidi Keyboard",
       NS_BIDIKEYBOARD_CID,
       "@mozilla.org/widget/bidikeyboard;1",
       nsBidiKeyboardConstructor },
+#ifdef Q_WS_X11
     { "Qt Idle Service",
        NS_IDLE_SERVICE_CID,
        "@mozilla.org/widget/idleservice;1",
        nsIdleServiceQtConstructor },
+#endif
     { "Qt Sound",
       NS_SOUND_CID,
       "@mozilla.org/sound;1",
       nsSoundConstructor },
     { "Native Theme Renderer",
       NS_THEMERENDERER_CID,
       "@mozilla.org/chrome/chrome-native-theme;1",
       nsNativeThemeQtConstructor },
--- a/widget/src/qt/nsWindow.cpp
+++ b/widget/src/qt/nsWindow.cpp
@@ -181,21 +181,17 @@ nsWindow::nsWindow()
 #endif // qt version check
     mWidget              = nsnull;
     mIsVisible           = PR_FALSE;
     mActivatePending     = PR_FALSE;
     mWindowType          = eWindowType_child;
     mSizeState           = nsSizeMode_Normal;
     mPluginType          = PluginType_NONE;
     mQCursor             = Qt::ArrowCursor;
-    mNeedsResize         = PR_FALSE;
-    mNeedsMove           = PR_FALSE;
-    mListenForResizes    = PR_FALSE;
-    mNeedsShow           = PR_FALSE;
-
+    
     if (!gGlobalsInitialized) {
         gGlobalsInitialized = PR_TRUE;
 
         // It's OK if either of these fail, but it may not be one day.
         initialize_prefs();
     }
 
     memset(mKeyDownFlags, 0, sizeof(mKeyDownFlags));
@@ -210,18 +206,16 @@ nsWindow::nsWindow()
 static inline gfxASurface::gfxImageFormat
 _depth_to_gfximage_format(PRInt32 aDepth)
 {
     switch (aDepth) {
     case 32:
         return gfxASurface::ImageFormatARGB32;
     case 24:
         return gfxASurface::ImageFormatRGB24;
-    case 16:
-        return gfxASurface::ImageFormatRGB16;
     default:
         return gfxASurface::ImageFormatUnknown;
     }
 }
 
 static void
 FreeOffScreenBuffers(void)
 {
@@ -444,17 +438,17 @@ nsWindow::SetModal(PRBool aModal)
         mWidget->setModal(aModal);
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::IsVisible(PRBool & aState)
 {
-    aState = mIsShown;
+    aState = mWidget ? mWidget->isVisible() : PR_FALSE;
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY)
 {
     if (mWidget) {
         PRInt32 screenWidth  = QApplication::desktop()->width();
@@ -551,20 +545,16 @@ nsWindow::SetSizeMode(PRInt32 aMode)
     switch (aMode) {
     case nsSizeMode_Maximized:
         widget->showMaximized();
         break;
     case nsSizeMode_Minimized:
         widget->showMinimized();
         break;
     case nsSizeMode_Fullscreen:
-        // Some versions of Qt (4.6.x) crash in XSetInputFocus due to
-        // unsynchronized window activation.  Sync here to avoid such
-        // cases.
-        XSync(QX11Info().display(), False);
         widget->showFullScreen();
         break;
 
     default:
         // nsSizeMode_Normal, really.
         widget->showNormal();
         break;
     }
@@ -669,18 +659,16 @@ nsWindow::Invalidate(const nsIntRect &aR
                      PRBool        aIsSynchronous)
 {
     LOGDRAW(("Invalidate (rect) [%p,%p]: %d %d %d %d (sync: %d)\n", (void *)this,
              (void*)mWidget,aRect.x, aRect.y, aRect.width, aRect.height, aIsSynchronous));
 
     if (!mWidget)
         return NS_OK;
 
-    mDirtyScrollArea = mDirtyScrollArea.united(QRect(aRect.x, aRect.y, aRect.width, aRect.height));
-
     mWidget->update(aRect.x, aRect.y, aRect.width, aRect.height);
 
     // QGraphicsItems cannot trigger a repaint themselves, so we start it on the view
     if (aIsSynchronous) {
         QWidget *widget = GetViewWidget();
         if (widget)
             widget->repaint();
     }
@@ -774,22 +762,24 @@ nsWindow::GetNativeData(PRUint32 aDataTy
         return mWidget;
         break;
     }
 
     case NS_NATIVE_PLUGIN_PORT:
         return SetupPluginPort();
         break;
 
+#ifdef Q_WS_X11
     case NS_NATIVE_DISPLAY:
         {
             QWidget *widget = GetViewWidget();
             return widget ? widget->x11Info().display() : nsnull;
         }
         break;
+#endif
 
     case NS_NATIVE_GRAPHIC: {
         NS_ASSERTION(nsnull != mToolkit, "NULL toolkit, unable to get a GC");
         return (void *)static_cast<nsToolkit *>(mToolkit)->GetSharedGC();
         break;
     }
 
     case NS_NATIVE_SHELLWIDGET:
@@ -1119,18 +1109,17 @@ nsWindow::DoPaint(QPainter* aPainter, co
         if (gBufferPixmap->handle())
             aPainter->drawPixmap(QPoint(rect.x, rect.y), *gBufferPixmap,
                                  QRect(0, 0, rect.width, rect.height));
         else {
             QImage img(gBufferImage->Data(),
                        gBufferImage->Width(),
                        gBufferImage->Height(),
                        gBufferImage->Stride(),
-                       gBufferImage->Format() == gfxASurface::ImageFormatRGB16 ?
-                           QImage::Format_RGB16 : QImage::Format_RGB32);
+                       QImage::Format_RGB32);
             aPainter->drawImage(QPoint(rect.x, rect.y), img,
                                 QRect(0, 0, rect.width, rect.height));
         }
     }
 
     ctx = nsnull;
     targetSurface = nsnull;
 
@@ -1778,16 +1767,17 @@ NS_IMETHODIMP
 nsWindow::SetWindowClass(const nsAString &xulWinType)
 {
     if (!mWidget)
       return NS_ERROR_FAILURE;
 
     nsXPIDLString brandName;
     GetBrandName(brandName);
 
+#ifdef Q_WS_X11
     XClassHint *class_hint = XAllocClassHint();
     if (!class_hint)
       return NS_ERROR_OUT_OF_MEMORY;
     const char *role = NULL;
     class_hint->res_name = ToNewCString(xulWinType);
     if (!class_hint->res_name) {
       XFree(class_hint);
       return NS_ERROR_OUT_OF_MEMORY;
@@ -1819,43 +1809,45 @@ nsWindow::SetWindowClass(const nsAString
     if (widget && widget->handle())
         XSetClassHint(widget->x11Info().display(),
                       widget->handle(),
                       class_hint);
 
     nsMemory::Free(class_hint->res_class);
     nsMemory::Free(class_hint->res_name);
     XFree(class_hint);
+#endif
 
     return NS_OK;
 }
 
 void
 nsWindow::NativeResize(PRInt32 aWidth, PRInt32 aHeight, PRBool  aRepaint)
 {
     LOG(("nsWindow::NativeResize [%p] %d %d\n", (void *)this,
          aWidth, aHeight));
 
-    mNeedsResize = PR_FALSE;
-
     mWidget->resize( aWidth, aHeight);
+
+    if (aRepaint)
+        mWidget->update();
 }
 
 void
 nsWindow::NativeResize(PRInt32 aX, PRInt32 aY,
                        PRInt32 aWidth, PRInt32 aHeight,
                        PRBool  aRepaint)
 {
     LOG(("nsWindow::NativeResize [%p] %d %d %d %d\n", (void *)this,
          aX, aY, aWidth, aHeight));
 
-    mNeedsResize = PR_FALSE;
-    mNeedsMove = PR_FALSE;
-
     mWidget->setGeometry(aX, aY, aWidth, aHeight);
+
+    if (aRepaint)
+        mWidget->update();
 }
 
 void
 nsWindow::NativeShow(PRBool aAction)
 {
     if (aAction) {
         QWidget *widget = GetViewWidget();
         // On e10s, we never want the child process or plugin process
@@ -1934,20 +1926,22 @@ nsWindow::MakeFullScreen(PRBool aFullScr
 {
     QWidget *widget = GetViewWidget();
     NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
     if (aFullScreen) {
         if (mSizeMode != nsSizeMode_Fullscreen)
             mLastSizeMode = mSizeMode;
 
         mSizeMode = nsSizeMode_Fullscreen;
+#ifdef Q_WS_X11
         // Some versions of Qt (4.6.x) crash in XSetInputFocus due to
         // unsynchronized window activation.  Sync here to avoid such
         // cases.
         XSync(QX11Info().display(), False);
+#endif
         widget->showFullScreen();
     }
     else {
         mSizeMode = mLastSizeMode;
 
         switch (mSizeMode) {
         case nsSizeMode_Maximized:
             widget->showMaximized();
@@ -1993,19 +1987,21 @@ nsWindow::HideWindowChrome(PRBool aShoul
         NativeShow(PR_TRUE);
     }
 
     // For some window managers, adding or removing window decorations
     // requires unmapping and remapping our toplevel window.  Go ahead
     // and flush the queue here so that we don't end up with a BadWindow
     // error later when this happens (when the persistence timer fires
     // and GetWindowPos is called)
+#ifdef Q_WS_X11
     QWidget *widget = GetViewWidget();
     NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE);
     XSync(widget->x11Info().display(), False);
+#endif
 
     return NS_OK;
 }
 
 //////////////////////////////////////////////////////////////////////
 // These are all of our drag and drop operations
 
 void
@@ -2289,66 +2285,42 @@ nsWindow::Show(PRBool aState)
 {
     LOG(("nsWindow::Show [%p] state %d\n", (void *)this, aState));
 
     mIsShown = aState;
 
     if (!mWidget)
         return NS_OK;
 
-    if (aState) {
-        if (mNeedsMove) {
-            NativeResize(mBounds.x, mBounds.y, mBounds.width, mBounds.height,
-                         PR_FALSE);
-        } else if (mNeedsResize) {
-            NativeResize(mBounds.width, mBounds.height, PR_FALSE);
-        }
-    }
-
-    NativeShow(aState);
- 
-   return NS_OK;
+    mWidget->setVisible(aState);
+    if (mWindowType == eWindowType_popup && aState)
+        Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, PR_FALSE);
+
+    return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
 {
     mBounds.width = aWidth;
     mBounds.height = aHeight;
 
     if (!mWidget)
         return NS_OK;
 
-    if (mIsShown) {
-        if (mIsTopLevel || mNeedsShow)
-            NativeResize(mBounds.x, mBounds.y,
-                         mBounds.width, mBounds.height, aRepaint);
-        else
-            NativeResize(mBounds.width, mBounds.height, aRepaint);
-
-        // Does it need to be shown because it was previously insane?
-        if (mNeedsShow)
-            NativeShow(PR_TRUE);
+    mWidget->resize(aWidth, aHeight);
+
+    if (mIsTopLevel) {
+        QWidget *widget = GetViewWidget();
+        if (widget)
+            widget->resize(aWidth, aHeight);
     }
-    else if (mListenForResizes) {
-        // For widgets that we listen for resizes for (widgets created
-        // with native parents) we apparently _always_ have to resize.  I
-        // dunno why, but apparently we're lame like that.
-        NativeResize(aWidth, aHeight, aRepaint);
-    }
-    else {
-        mNeedsResize = PR_TRUE;
-    }
-
-    // synthesize a resize event if this isn't a toplevel
-    if (mIsTopLevel || mListenForResizes) {
-        nsIntRect rect(mBounds.x, mBounds.y, aWidth, aHeight);
-        nsEventStatus status;
-        DispatchResizeEvent(rect, status);
-    }
+
+    if (aRepaint)
+        mWidget->update();
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,
                  PRBool aRepaint)
 {
@@ -2357,44 +2329,27 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY,
     mBounds.width = aWidth;
     mBounds.height = aHeight;
 
     mPlaced = PR_TRUE;
 
     if (!mWidget)
         return NS_OK;
 
-    // Has this widget been set to visible?
-    if (mIsShown) {
-        // Are the bounds sane?
-        // Yep?  Resize the window
-        NativeResize(aX, aY, aWidth, aHeight, aRepaint);
-        // Does it need to be shown because it was previously insane?
-        if (mNeedsShow)
-            NativeShow(PR_TRUE);
+    mWidget->setGeometry(aX, aY, aWidth, aHeight);
+
+    if (mIsTopLevel) {
+        QWidget *widget = GetViewWidget();
+        if (widget)
+            widget->resize(aWidth, aHeight);
     }
-    // If the widget hasn't been shown, mark the widget as needing to be
-    // resized before it is shown
-    else if (mListenForResizes) {
-        // For widgets that we listen for resizes for (widgets created
-        // with native parents) we apparently _always_ have to resize.  I
-        // dunno why, but apparently we're lame like that.
-        NativeResize(aX, aY, aWidth, aHeight, aRepaint);
-    }
-    else {
-        mNeedsResize = PR_TRUE;
-        mNeedsMove = PR_TRUE;
-    }
-
-    if (mIsTopLevel || mListenForResizes) {
-        // synthesize a resize event
-        nsIntRect rect(aX, aY, aWidth, aHeight);
-        nsEventStatus status;
-       DispatchResizeEvent(rect, status);
-    }
+
+    if (aRepaint)
+        mWidget->update();
+
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsWindow::Enable(PRBool aState)
 {
     mEnabled = aState;
 
--- a/widget/src/qt/nsWindow.h
+++ b/widget/src/qt/nsWindow.h
@@ -359,21 +359,16 @@ private:
 
     void ClearKeyDownFlag(PRUint32 aKeyCode) {
         PRUint32 mask;
         PRUint32* flag = GetFlagWord32(aKeyCode, &mask);
         *flag &= ~mask;
     }
     PRInt32 mQCursor;
 
-    PRPackedBool mNeedsResize;
-    PRPackedBool mNeedsMove;
-    PRPackedBool mListenForResizes;
-    PRPackedBool mNeedsShow;
-
     // Remember dirty area caused by ::Scroll
     QRegion mDirtyScrollArea;
 
 #if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0))
     double mTouchPointDistance;
     double mLastPinchDistance;
     PRBool mMouseEventsDisabled;
  #endif
--- a/xpcom/build/nsXULAppAPI.h
+++ b/xpcom/build/nsXULAppAPI.h
@@ -408,36 +408,16 @@ XRE_API(nsresult,
  *
  * @param aINIFile The INI file to parse
  * @param aAppData The nsXREAppData structure to fill.
  */
 XRE_API(nsresult,
         XRE_ParseAppData, (nsILocalFile* aINIFile,
                            nsXREAppData *aAppData))
 
-namespace mozilla {
-namespace dom {
-  class TabParent;
-}
-}
-
-class nsString;
-
-XRE_API(nsresult,
-        XRE_SendParentChromeRegistry, (mozilla::dom::TabParent* aParent))
-
-XRE_API(nsresult,
-        XRE_RegisterChromePackage, (const nsString& aPackage,
-                                    const nsString& aBaseURI,
-                                    const PRUint32& aFlags))
-
-XRE_API(nsresult,
-        XRE_RegisterChromeResource, (const nsString& aPackage,
-                                     const nsString& aResolvedURI))
-
 /**
  * Free a nsXREAppData structure that was allocated with XRE_CreateAppData.
  */
 XRE_API(void,
         XRE_FreeAppData, (nsXREAppData *aAppData))
 
 enum GeckoProcessType {
   GeckoProcessType_Default = 0,