Bug 1121673: Use move references in IPDL. r=bent
authorKyle Huey <khuey@kylehuey.com>
Fri, 16 Jan 2015 11:58:52 -0800
changeset 251432 f498989ed56f3d5b4fae5e2bd1a0ca0c0f99014e
parent 251431 cafc08288982023eef982920cf329a837170fc30
child 251433 eb735f61a1af60caa1f530aff51cc246cb0bd74d
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1121673
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1121673: Use move references in IPDL. r=bent
dom/base/nsContentPermissionHelper.cpp
dom/base/nsContentPermissionHelper.h
dom/indexedDB/ActorsParent.cpp
dom/ipc/ContentBridgeChild.cpp
dom/ipc/ContentBridgeChild.h
dom/ipc/ContentBridgeParent.cpp
dom/ipc/ContentBridgeParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/FilePickerParent.cpp
dom/ipc/FilePickerParent.h
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/ipc/nsIContentChild.cpp
dom/ipc/nsIContentChild.h
dom/ipc/nsIContentParent.cpp
dom/ipc/nsIContentParent.h
dom/media/gmp/GMPDecryptorChild.cpp
dom/media/gmp/GMPDecryptorChild.h
dom/media/gmp/GMPDecryptorParent.cpp
dom/media/gmp/GMPDecryptorParent.h
dom/media/gmp/GMPStorageChild.cpp
dom/media/gmp/GMPStorageChild.h
dom/media/gmp/GMPStorageParent.cpp
dom/media/gmp/GMPStorageParent.h
dom/media/gmp/GMPVideoDecoderChild.cpp
dom/media/gmp/GMPVideoDecoderChild.h
dom/media/gmp/GMPVideoDecoderParent.cpp
dom/media/gmp/GMPVideoDecoderParent.h
dom/media/gmp/GMPVideoEncoderChild.cpp
dom/media/gmp/GMPVideoEncoderChild.h
dom/media/gmp/GMPVideoEncoderParent.cpp
dom/media/gmp/GMPVideoEncoderParent.h
dom/network/UDPSocketChild.cpp
dom/network/UDPSocketChild.h
dom/network/UDPSocketParent.h
dom/notification/Notification.cpp
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceChild.h
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleChild.h
dom/plugins/ipc/PluginScriptableObjectChild.cpp
dom/plugins/ipc/PluginScriptableObjectChild.h
dom/plugins/ipc/PluginScriptableObjectParent.cpp
dom/plugins/ipc/PluginScriptableObjectParent.h
dom/plugins/ipc/PluginWidgetParent.cpp
dom/plugins/ipc/PluginWidgetParent.h
dom/storage/DOMStorageIPC.cpp
dom/storage/DOMStorageIPC.h
gfx/layers/ipc/ImageBridgeChild.cpp
gfx/layers/ipc/ImageBridgeChild.h
gfx/layers/ipc/ImageBridgeParent.cpp
gfx/layers/ipc/ImageBridgeParent.h
gfx/layers/ipc/LayerTransactionChild.cpp
gfx/layers/ipc/LayerTransactionChild.h
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/ipc/LayerTransactionParent.h
hal/sandbox/SandboxHal.cpp
ipc/glue/ProcessUtils_linux.cpp
ipc/ipdl/ipdl/cxx/ast.py
ipc/ipdl/ipdl/cxx/cgen.py
ipc/ipdl/ipdl/lower.py
js/ipc/JavaScriptBase.h
js/ipc/WrapperAnswer.cpp
js/ipc/WrapperAnswer.h
netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
netwerk/protocol/rtsp/controller/RtspControllerChild.h
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -469,17 +469,17 @@ RemotePermissionRequest::DoAllow(JS::Han
 {
   NS_ASSERTION(mRequest, "We need a request");
   mRequest->Allow(aChoices);
 }
 
 // PContentPermissionRequestChild
 bool
 RemotePermissionRequest::Recv__delete__(const bool& aAllow,
-                                        const nsTArray<PermissionChoice>& aChoices)
+                                        InfallibleTArray<PermissionChoice>&& aChoices)
 {
   if (aAllow && mWindow->IsCurrentInnerWindow()) {
     // Use 'undefined' if no choice is provided.
     if (aChoices.IsEmpty()) {
       DoAllow(JS::UndefinedHandleValue);
       return true;
     }
 
--- a/dom/base/nsContentPermissionHelper.h
+++ b/dom/base/nsContentPermissionHelper.h
@@ -112,17 +112,17 @@ class RemotePermissionRequest MOZ_FINAL 
 public:
   NS_DECL_ISUPPORTS
 
   RemotePermissionRequest(nsIContentPermissionRequest* aRequest,
                           nsPIDOMWindow* aWindow);
 
   // It will be called when prompt dismissed.
   virtual bool Recv__delete__(const bool &aAllow,
-                              const nsTArray<PermissionChoice>& aChoices) MOZ_OVERRIDE;
+                              InfallibleTArray<PermissionChoice>&& aChoices) MOZ_OVERRIDE;
 
   void IPDLAddRef()
   {
     mIPCOpen = true;
     AddRef();
   }
 
   void IPDLRelease()
@@ -141,8 +141,9 @@ private:
   void DoCancel();
 
   nsCOMPtr<nsIContentPermissionRequest> mRequest;
   nsCOMPtr<nsPIDOMWindow>               mWindow;
   bool                                  mIPCOpen;
 };
 
 #endif // nsContentPermissionHelper_h
+
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -3031,17 +3031,17 @@ private:
   AllocPBackgroundIDBTransactionParent(
                                     const nsTArray<nsString>& aObjectStoreNames,
                                     const Mode& aMode)
                                     MOZ_OVERRIDE;
 
   virtual bool
   RecvPBackgroundIDBTransactionConstructor(
                                     PBackgroundIDBTransactionParent* aActor,
-                                    const nsTArray<nsString>& aObjectStoreNames,
+                                    InfallibleTArray<nsString>&& aObjectStoreNames,
                                     const Mode& aMode)
                                     MOZ_OVERRIDE;
 
   virtual bool
   DeallocPBackgroundIDBTransactionParent(
                                         PBackgroundIDBTransactionParent* aActor)
                                         MOZ_OVERRIDE;
 
@@ -6521,17 +6521,17 @@ Database::AllocPBackgroundIDBTransaction
   MOZ_ASSERT(infallibleObjectStores.IsEmpty());
 
   return transaction.forget().take();
 }
 
 bool
 Database::RecvPBackgroundIDBTransactionConstructor(
                                     PBackgroundIDBTransactionParent* aActor,
-                                    const nsTArray<nsString>& aObjectStoreNames,
+                                    InfallibleTArray<nsString>&& aObjectStoreNames,
                                     const Mode& aMode)
 {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aActor);
   MOZ_ASSERT(!aObjectStoreNames.IsEmpty());
   MOZ_ASSERT(aMode == IDBTransaction::READ_ONLY ||
              aMode == IDBTransaction::READ_WRITE);
   MOZ_ASSERT(!mClosed);
--- a/dom/ipc/ContentBridgeChild.cpp
+++ b/dom/ipc/ContentBridgeChild.cpp
@@ -61,20 +61,20 @@ ContentBridgeChild::DeferredDestroy()
 {
   mSelfRef = nullptr;
   // |this| was just destroyed, hands off
 }
 
 bool
 ContentBridgeChild::RecvAsyncMessage(const nsString& aMsg,
                                      const ClonedMessageData& aData,
-                                     const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                     InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                      const IPC::Principal& aPrincipal)
 {
-  return nsIContentChild::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
+  return nsIContentChild::RecvAsyncMessage(aMsg, aData, Move(aCpows), aPrincipal);
 }
 
 PBlobChild*
 ContentBridgeChild::SendPBlobConstructor(PBlobChild* actor,
                                          const BlobConstructorParams& params)
 {
   return PContentBridgeChild::SendPBlobConstructor(actor, params);
 }
--- a/dom/ipc/ContentBridgeChild.h
+++ b/dom/ipc/ContentBridgeChild.h
@@ -24,17 +24,17 @@ public:
   static ContentBridgeChild*
   Create(Transport* aTransport, ProcessId aOtherProcess);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   void DeferredDestroy();
 
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
   virtual PBlobChild*
   SendPBlobConstructor(PBlobChild* actor,
                        const BlobConstructorParams& aParams) MOZ_OVERRIDE;
 
   jsipc::JavaScriptShared* GetCPOWManager() MOZ_OVERRIDE;
 
--- a/dom/ipc/ContentBridgeParent.cpp
+++ b/dom/ipc/ContentBridgeParent.cpp
@@ -57,30 +57,32 @@ ContentBridgeParent::DeferredDestroy()
 {
   mSelfRef = nullptr;
   // |this| was just destroyed, hands off
 }
 
 bool
 ContentBridgeParent::RecvSyncMessage(const nsString& aMsg,
                                      const ClonedMessageData& aData,
-                                     const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                     InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                      const IPC::Principal& aPrincipal,
                                      InfallibleTArray<nsString>* aRetvals)
 {
-  return nsIContentParent::RecvSyncMessage(aMsg, aData, aCpows, aPrincipal, aRetvals);
+  return nsIContentParent::RecvSyncMessage(aMsg, aData, Move(aCpows),
+                                           aPrincipal, aRetvals);
 }
 
 bool
 ContentBridgeParent::RecvAsyncMessage(const nsString& aMsg,
                                       const ClonedMessageData& aData,
-                                      const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                      InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                       const IPC::Principal& aPrincipal)
 {
-  return nsIContentParent::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
+  return nsIContentParent::RecvAsyncMessage(aMsg, aData, Move(aCpows),
+                                            aPrincipal);
 }
 
 PBlobParent*
 ContentBridgeParent::SendPBlobConstructor(PBlobParent* actor,
                                           const BlobConstructorParams& params)
 {
   return PContentBridgeParent::SendPBlobConstructor(actor, params);
 }
--- a/dom/ipc/ContentBridgeParent.h
+++ b/dom/ipc/ContentBridgeParent.h
@@ -70,22 +70,22 @@ protected:
   void SetIsForBrowser(bool aIsForBrowser)
   {
     mIsForBrowser = aIsForBrowser;
   }
 
 protected:
   virtual bool RecvSyncMessage(const nsString& aMsg,
                                const ClonedMessageData& aData,
-                               const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                               InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                const IPC::Principal& aPrincipal,
                                InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
   virtual jsipc::PJavaScriptParent* AllocPJavaScriptParent() MOZ_OVERRIDE;
   virtual bool
   DeallocPJavaScriptParent(jsipc::PJavaScriptParent*) MOZ_OVERRIDE;
 
   virtual PBrowserParent*
   AllocPBrowserParent(const TabId& aTabId,
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1715,19 +1715,19 @@ ContentChild::DeallocPSpeechSynthesisChi
     delete aActor;
     return true;
 #else
     return false;
 #endif
 }
 
 bool
-ContentChild::RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
-                                 const InfallibleTArray<ResourceMapping>& resources,
-                                 const InfallibleTArray<OverrideMapping>& overrides,
+ContentChild::RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages,
+                                 InfallibleTArray<ResourceMapping>&& resources,
+                                 InfallibleTArray<OverrideMapping>&& overrides,
                                  const nsCString& locale,
                                  const bool& reset)
 {
     nsCOMPtr<nsIChromeRegistry> registrySvc = nsChromeRegistry::GetService();
     nsChromeRegistryContent* chromeRegistry =
         static_cast<nsChromeRegistryContent*>(registrySvc.get());
     chromeRegistry->RegisterRemoteChrome(packages, resources, overrides,
                                          locale, reset);
@@ -1900,17 +1900,17 @@ ContentChild::RecvNotifyVisited(const UR
         history->NotifyVisited(newURI);
     }
     return true;
 }
 
 bool
 ContentChild::RecvAsyncMessage(const nsString& aMsg,
                                const ClonedMessageData& aData,
-                               const InfallibleTArray<CpowEntry>& aCpows,
+                               InfallibleTArray<CpowEntry>&& aCpows,
                                const IPC::Principal& aPrincipal)
 {
     nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::sChildProcessManager;
     if (cpm) {
         StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForChild(aData);
         CpowIdHolder cpows(this, aCpows);
         cpm->ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(cpm.get()),
                             aMsg, false, &cloneData, &cpows, aPrincipal, nullptr);
@@ -1937,17 +1937,17 @@ ContentChild::RecvGeolocationError(const
     if (!gs) {
         return true;
     }
     gs->NotifyError(errorCode);
     return true;
 }
 
 bool
-ContentChild::RecvUpdateDictionaryList(const InfallibleTArray<nsString>& aDictionaries)
+ContentChild::RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries)
 {
     mAvailableDictionaries = aDictionaries;
     mozInlineSpellChecker::UpdateCanEnableInlineSpellChecking();
     return true;
 }
 
 bool
 ContentChild::RecvAddPermission(const IPC::Permission& permission)
@@ -2438,18 +2438,18 @@ ContentChild::RecvOnAppThemeChanged()
         os->NotifyObservers(nullptr, "app-theme-changed", nullptr);
     }
     return true;
 }
 
 bool
 ContentChild::RecvStartProfiler(const uint32_t& aEntries,
                                 const double& aInterval,
-                                const nsTArray<nsCString>& aFeatures,
-                                const nsTArray<nsCString>& aThreadNameFilters)
+                                nsTArray<nsCString>&& aFeatures,
+                                nsTArray<nsCString>&& aThreadNameFilters)
 {
     nsTArray<const char*> featureArray;
     for (size_t i = 0; i < aFeatures.Length(); ++i) {
         featureArray.AppendElement(aFeatures[i].get());
     }
 
     nsTArray<const char*> threadNameFilterArray;
     for (size_t i = 0; i < aThreadNameFilters.Length(); ++i) {
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -271,19 +271,19 @@ public:
                                  const asmjscache::WriteParams& aWriteParams,
                                  const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
     virtual bool DeallocPAsmJSCacheEntryChild(
                                     PAsmJSCacheEntryChild* aActor) MOZ_OVERRIDE;
 
     virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() MOZ_OVERRIDE;
     virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) MOZ_OVERRIDE;
 
-    virtual bool RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
-                                    const InfallibleTArray<ResourceMapping>& resources,
-                                    const InfallibleTArray<OverrideMapping>& overrides,
+    virtual bool RecvRegisterChrome(InfallibleTArray<ChromePackage>&& packages,
+                                    InfallibleTArray<ResourceMapping>&& resources,
+                                    InfallibleTArray<OverrideMapping>&& overrides,
                                     const nsCString& locale,
                                     const bool& reset) MOZ_OVERRIDE;
     virtual bool RecvRegisterChromeItem(const ChromeRegistryItem& item) MOZ_OVERRIDE;
 
     virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() MOZ_OVERRIDE;
     virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) MOZ_OVERRIDE;
     virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild() MOZ_OVERRIDE;
     virtual bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*) MOZ_OVERRIDE;
@@ -301,24 +301,24 @@ public:
 
     virtual bool RecvPreferenceUpdate(const PrefSetting& aPref) MOZ_OVERRIDE;
 
     virtual bool RecvNotifyAlertsObserver(const nsCString& aType,
                                           const nsString& aData) MOZ_OVERRIDE;
 
     virtual bool RecvAsyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) MOZ_OVERRIDE;
 
     virtual bool RecvGeolocationError(const uint16_t& errorCode) MOZ_OVERRIDE;
 
-    virtual bool RecvUpdateDictionaryList(const InfallibleTArray<nsString>& aDictionaries) MOZ_OVERRIDE;
+    virtual bool RecvUpdateDictionaryList(InfallibleTArray<nsString>&& aDictionaries) MOZ_OVERRIDE;
 
     virtual bool RecvAddPermission(const IPC::Permission& permission) MOZ_OVERRIDE;
 
     virtual bool RecvScreenSizeChanged(const gfxIntSize &size) MOZ_OVERRIDE;
 
     virtual bool RecvFlushMemory(const nsString& reason) MOZ_OVERRIDE;
 
     virtual bool RecvActivateA11y() MOZ_OVERRIDE;
@@ -372,18 +372,18 @@ public:
 
     virtual bool RecvAssociatePluginId(const uint32_t& aPluginId,
                                        const base::ProcessId& aProcessId) MOZ_OVERRIDE;
     virtual bool RecvLoadPluginResult(const uint32_t& aPluginId,
                                       const bool& aResult) MOZ_OVERRIDE;
 
     virtual bool RecvStartProfiler(const uint32_t& aEntries,
                                    const double& aInterval,
-                                   const nsTArray<nsCString>& aFeatures,
-                                   const nsTArray<nsCString>& aThreadNameFilters) MOZ_OVERRIDE;
+                                   nsTArray<nsCString>&& aFeatures,
+                                   nsTArray<nsCString>&& aThreadNameFilters) MOZ_OVERRIDE;
     virtual bool RecvStopProfiler() MOZ_OVERRIDE;
     virtual bool RecvGetProfile(nsCString* aProfile) MOZ_OVERRIDE;
     virtual bool RecvShutdown() MOZ_OVERRIDE;
 
 #ifdef ANDROID
     gfxIntSize GetScreenSize() { return mScreenSize; }
 #endif
 
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -383,17 +383,18 @@ bool ContentParent::sNuwaReady = false;
 class MemoryReportRequestParent : public PMemoryReportRequestParent
 {
 public:
     MemoryReportRequestParent();
     virtual ~MemoryReportRequestParent();
 
     virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
-    virtual bool Recv__delete__(const uint32_t& aGeneration, const InfallibleTArray<MemoryReport>& aReport) MOZ_OVERRIDE;
+    virtual bool Recv__delete__(const uint32_t& aGeneration, InfallibleTArray<MemoryReport>&& aReport) MOZ_OVERRIDE;
+
 private:
     ContentParent* Owner()
     {
         return static_cast<ContentParent*>(Manager());
     }
 };
 
 MemoryReportRequestParent::MemoryReportRequestParent()
@@ -403,17 +404,18 @@ MemoryReportRequestParent::MemoryReportR
 
 void
 MemoryReportRequestParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   // Implement me! Bug 1005154
 }
 
 bool
-MemoryReportRequestParent::Recv__delete__(const uint32_t& generation, const InfallibleTArray<MemoryReport>& childReports)
+MemoryReportRequestParent::Recv__delete__(const uint32_t& generation,
+                                          nsTArray<MemoryReport>&& childReports)
 {
     nsRefPtr<nsMemoryReporterManager> mgr =
         nsMemoryReporterManager::GetOrCreate();
     if (mgr) {
         mgr->HandleChildReports(generation, childReports);
     }
     return true;
 }
@@ -2135,17 +2137,17 @@ FindFdProtocolFdMapping(const nsTArray<P
 /**
  * This constructor is used for new content process cloned from a template.
  *
  * For Nuwa.
  */
 ContentParent::ContentParent(ContentParent* aTemplate,
                              const nsAString& aAppManifestURL,
                              base::ProcessHandle aPid,
-                             const nsTArray<ProtocolFdMapping>& aFds)
+                             InfallibleTArray<ProtocolFdMapping>&& aFds)
     : mAppManifestURL(aAppManifestURL)
     , mIsForBrowser(false)
     , mIsNuwaProcess(false)
 {
     InitializeMembers();  // Perform common initialization.
 
     sContentParents->insertBack(this);
 
@@ -2709,33 +2711,33 @@ ContentParent::RecvNuwaWaitForFreeze()
 #else // MOZ_NUWA_PROCESS
     NS_ERROR("ContentParent::RecvNuwaWaitForFreeze() not implemented!");
     return false;
 #endif // MOZ_NUWA_PROCESS
 }
 
 bool
 ContentParent::RecvAddNewProcess(const uint32_t& aPid,
-                                 const InfallibleTArray<ProtocolFdMapping>& aFds)
+                                 InfallibleTArray<ProtocolFdMapping>&& aFds)
 {
 #ifdef MOZ_NUWA_PROCESS
     if (!IsNuwaProcess()) {
         NS_ERROR(
             nsPrintfCString(
                 "Terminating child process %d for unauthorized IPC message: "
                 "AddNewProcess(%d)", Pid(), aPid).get());
 
         KillHard();
         return false;
     }
     nsRefPtr<ContentParent> content;
     content = new ContentParent(this,
                                 MAGIC_PREALLOCATED_APP_MANIFEST_URL,
                                 aPid,
-                                aFds);
+                                Move(aFds));
     content->Init();
 
     size_t numNuwaPrefUpdates = sNuwaPrefUpdates ?
                                 sNuwaPrefUpdates->Length() : 0;
     // Resend pref updates to the forked child.
     for (size_t i = 0; i < numNuwaPrefUpdates; i++) {
         mozilla::unused << content->SendPreferenceUpdate(sNuwaPrefUpdates->ElementAt(i));
     }
@@ -3897,42 +3899,43 @@ ContentParent::RecvCloseAlert(const nsSt
     }
 
     return true;
 }
 
 bool
 ContentParent::RecvSyncMessage(const nsString& aMsg,
                                const ClonedMessageData& aData,
-                               const InfallibleTArray<CpowEntry>& aCpows,
+                               InfallibleTArray<CpowEntry>&& aCpows,
                                const IPC::Principal& aPrincipal,
                                InfallibleTArray<nsString>* aRetvals)
 {
-    return nsIContentParent::RecvSyncMessage(aMsg, aData, aCpows, aPrincipal,
-                                             aRetvals);
+    return nsIContentParent::RecvSyncMessage(aMsg, aData, Move(aCpows),
+                                             aPrincipal, aRetvals);
 }
 
 bool
 ContentParent::RecvRpcMessage(const nsString& aMsg,
                               const ClonedMessageData& aData,
-                              const InfallibleTArray<CpowEntry>& aCpows,
+                              InfallibleTArray<CpowEntry>&& aCpows,
                               const IPC::Principal& aPrincipal,
                               InfallibleTArray<nsString>* aRetvals)
 {
-    return nsIContentParent::RecvRpcMessage(aMsg, aData, aCpows, aPrincipal,
+    return nsIContentParent::RecvRpcMessage(aMsg, aData, Move(aCpows), aPrincipal,
                                             aRetvals);
 }
 
 bool
 ContentParent::RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<CpowEntry>& aCpows,
+                                InfallibleTArray<CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal)
 {
-    return nsIContentParent::RecvAsyncMessage(aMsg, aData, aCpows, aPrincipal);
+    return nsIContentParent::RecvAsyncMessage(aMsg, aData, Move(aCpows),
+                                              aPrincipal);
 }
 
 bool
 ContentParent::RecvFilePathUpdateNotify(const nsString& aType,
                                         const nsString& aStorageName,
                                         const nsString& aFilePath,
                                         const nsCString& aReason)
 {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -389,17 +389,17 @@ private:
                   bool aIsForPreallocated,
                   hal::ProcessPriority aInitialPriority = hal::PROCESS_PRIORITY_FOREGROUND,
                   bool aIsNuwaProcess = false);
 
 #ifdef MOZ_NUWA_PROCESS
     ContentParent(ContentParent* aTemplate,
                   const nsAString& aAppManifestURL,
                   base::ProcessHandle aPid,
-                  const nsTArray<ProtocolFdMapping>& aFds);
+                  InfallibleTArray<ProtocolFdMapping>&& aFds);
 #endif
 
     // The common initialization for the constructors.
     void InitializeMembers();
 
     // The common initialization logic shared by all constuctors.
     void InitInternal(ProcessPriority aPriority,
                       bool aSetupOffMainThreadCompositing,
@@ -637,27 +637,27 @@ private:
 
     virtual bool RecvCloseAlert(const nsString& aName,
                                 const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvLoadURIExternal(const URIParams& uri) MOZ_OVERRIDE;
 
     virtual bool RecvSyncMessage(const nsString& aMsg,
                                  const ClonedMessageData& aData,
-                                 const InfallibleTArray<CpowEntry>& aCpows,
+                                 InfallibleTArray<CpowEntry>&& aCpows,
                                  const IPC::Principal& aPrincipal,
                                  InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
     virtual bool RecvRpcMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<CpowEntry>& aCpows,
+                                InfallibleTArray<CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal,
                                 InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvFilePathUpdateNotify(const nsString& aType,
                                           const nsString& aStorageName,
                                           const nsString& aFilePath,
                                           const nsCString& aReason) MOZ_OVERRIDE;
 
     virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal,
@@ -708,17 +708,17 @@ private:
 
     virtual bool RecvSystemMessageHandled() MOZ_OVERRIDE;
 
     virtual bool RecvNuwaReady() MOZ_OVERRIDE;
 
     virtual bool RecvNuwaWaitForFreeze() MOZ_OVERRIDE;
 
     virtual bool RecvAddNewProcess(const uint32_t& aPid,
-                                   const InfallibleTArray<ProtocolFdMapping>& aFds) MOZ_OVERRIDE;
+                                   InfallibleTArray<ProtocolFdMapping>&& aFds) MOZ_OVERRIDE;
 
     virtual bool RecvCreateFakeVolume(const nsString& fsName, const nsString& mountPoint) MOZ_OVERRIDE;
 
     virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
 
     virtual bool RecvKeywordToURI(const nsCString& aKeyword,
                                   nsString* aProviderName,
                                   OptionalInputStreamParams* aPostData,
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -196,18 +196,18 @@ FilePickerParent::CreateFilePicker()
   return NS_SUCCEEDED(mFilePicker->Init(window, mTitle, mMode));
 }
 
 bool
 FilePickerParent::RecvOpen(const int16_t& aSelectedType,
                            const bool& aAddToRecentDocs,
                            const nsString& aDefaultFile,
                            const nsString& aDefaultExtension,
-                           const InfallibleTArray<nsString>& aFilters,
-                           const InfallibleTArray<nsString>& aFilterNames,
+                           InfallibleTArray<nsString>&& aFilters,
+                           InfallibleTArray<nsString>&& aFilterNames,
                            const nsString& aDisplayDirectory)
 {
   if (!CreateFilePicker()) {
     unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
     return true;
   }
 
   mFilePicker->SetAddToRecentDocs(aAddToRecentDocs);
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -30,18 +30,18 @@ class FilePickerParent : public PFilePic
 
   void Done(int16_t aResult);
   void SendFiles(const nsCOMArray<nsIDOMFile>& aDomfiles);
 
   virtual bool RecvOpen(const int16_t& aSelectedType,
                         const bool& aAddToRecentDocs,
                         const nsString& aDefaultFile,
                         const nsString& aDefaultExtension,
-                        const InfallibleTArray<nsString>& aFilters,
-                        const InfallibleTArray<nsString>& aFilterNames,
+                        InfallibleTArray<nsString>&& aFilters,
+                        InfallibleTArray<nsString>&& aFilterNames,
                         const nsString& aDisplayDirectory) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
   class FilePickerShownCallback : public nsIFilePickerShownCallback
   {
   public:
     explicit FilePickerShownCallback(FilePickerParent* aFilePickerParent)
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2973,17 +2973,17 @@ TabChild::RecvLoadRemoteScript(const nsS
 
   LoadFrameScriptInternal(aURL, aRunInGlobalScope);
   return true;
 }
 
 bool
 TabChild::RecvAsyncMessage(const nsString& aMessage,
                            const ClonedMessageData& aData,
-                           const InfallibleTArray<CpowEntry>& aCpows,
+                           InfallibleTArray<CpowEntry>&& aCpows,
                            const IPC::Principal& aPrincipal)
 {
   if (mTabChildGlobal) {
     nsCOMPtr<nsIXPConnectJSObjectHolder> kungFuDeathGrip(GetGlobal());
     StructuredCloneData cloneData = UnpackClonedMessageDataForChild(aData);
     nsRefPtr<nsFrameMessageManager> mm =
       static_cast<nsFrameMessageManager*>(mTabChildGlobal->mMessageManager.get());
     CpowIdHolder cpows(Manager(), aCpows);
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -370,17 +370,17 @@ public:
                               const bool&     aPreventDefault) MOZ_OVERRIDE;
     virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
     virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) MOZ_OVERRIDE;
     virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) MOZ_OVERRIDE;
     virtual bool RecvLoadRemoteScript(const nsString& aURL,
                                       const bool& aRunInGlobalScope) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMessage,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
 
     virtual bool RecvAppOfflineStatus(const uint32_t& aId, const bool& aOffline) MOZ_OVERRIDE;
 
     virtual PDocumentRendererChild*
     AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
                                 const nsString& bgcolor,
                                 const uint32_t& renderFlags, const bool& flushLayout,
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1282,17 +1282,17 @@ TabParent::TryCapture(const WidgetGUIEve
 
   SendRealTouchEvent(event);
   return true;
 }
 
 bool
 TabParent::RecvSyncMessage(const nsString& aMessage,
                            const ClonedMessageData& aData,
-                           const InfallibleTArray<CpowEntry>& aCpows,
+                           InfallibleTArray<CpowEntry>&& aCpows,
                            const IPC::Principal& aPrincipal,
                            InfallibleTArray<nsString>* aJSONRetVal)
 {
   // FIXME Permission check for TabParent in Content process
   nsIPrincipal* principal = aPrincipal;
   if (Manager()->IsContentParent()) {
     ContentParent* parent = Manager()->AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
@@ -1304,17 +1304,17 @@ TabParent::RecvSyncMessage(const nsStrin
   StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
   CpowIdHolder cpows(Manager(), aCpows);
   return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
 }
 
 bool
 TabParent::RecvRpcMessage(const nsString& aMessage,
                           const ClonedMessageData& aData,
-                          const InfallibleTArray<CpowEntry>& aCpows,
+                          InfallibleTArray<CpowEntry>&& aCpows,
                           const IPC::Principal& aPrincipal,
                           InfallibleTArray<nsString>* aJSONRetVal)
 {
   // FIXME Permission check for TabParent in Content process
   nsIPrincipal* principal = aPrincipal;
   if (Manager()->IsContentParent()) {
     ContentParent* parent = Manager()->AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
@@ -1326,17 +1326,17 @@ TabParent::RecvRpcMessage(const nsString
   StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForParent(aData);
   CpowIdHolder cpows(Manager(), aCpows);
   return ReceiveMessage(aMessage, true, &cloneData, &cpows, aPrincipal, aJSONRetVal);
 }
 
 bool
 TabParent::RecvAsyncMessage(const nsString& aMessage,
                             const ClonedMessageData& aData,
-                            const InfallibleTArray<CpowEntry>& aCpows,
+                            InfallibleTArray<CpowEntry>&& aCpows,
                             const IPC::Principal& aPrincipal)
 {
   // FIXME Permission check for TabParent in Content process
   nsIPrincipal* principal = aPrincipal;
   if (Manager()->IsContentParent()) {
     ContentParent* parent = Manager()->AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
         parent && principal && !AssertAppPrincipal(parent, principal)) {
@@ -1495,17 +1495,17 @@ TabParent::RecvNotifyIMETextChange(const
   notification.mTextChangeData.mCausedByComposition = aCausedByComposition;
   widget->NotifyIME(notification);
   return true;
 }
 
 bool
 TabParent::RecvNotifyIMESelectedCompositionRect(
   const uint32_t& aOffset,
-  const InfallibleTArray<nsIntRect>& aRects,
+  InfallibleTArray<nsIntRect>&& aRects,
   const uint32_t& aCaretOffset,
   const nsIntRect& aCaretRect)
 {
   // add rect to cache for another query
   mIMECompositionRectOffset = aOffset;
   mIMECompositionRects = aRects;
   mIMECaretOffset = aCaretOffset;
   mIMECaretRect = aCaretRect;
@@ -1576,17 +1576,17 @@ TabParent::RecvNotifyIMEEditorRect(const
 {
   mIMEEditorRect = aRect;
   return true;
 }
 
 bool
 TabParent::RecvNotifyIMEPositionChange(
              const nsIntRect& aEditorRect,
-             const InfallibleTArray<nsIntRect>& aCompositionRects,
+             InfallibleTArray<nsIntRect>&& aCompositionRects,
              const nsIntRect& aCaretRect)
 {
   mIMEEditorRect = aEditorRect;
   mIMECompositionRects = aCompositionRects;
   mIMECaretRect = aCaretRect;
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (!widget) {
@@ -1620,18 +1620,18 @@ TabParent::RecvRequestFocus(const bool& 
 
   nsCOMPtr<nsIDOMElement> node = do_QueryInterface(mFrameElement);
   fm->SetFocus(node, flags);
   return true;
 }
 
 bool
 TabParent::RecvEnableDisableCommands(const nsString& aAction,
-                                     const nsTArray<nsCString>& aEnabledCommands,
-                                     const nsTArray<nsCString>& aDisabledCommands)
+                                     nsTArray<nsCString>&& aEnabledCommands,
+                                     nsTArray<nsCString>&& aDisabledCommands)
 {
   nsCOMPtr<nsIRemoteBrowser> remoteBrowser = do_QueryInterface(mFrameElement);
   if (remoteBrowser) {
     nsAutoArrayPtr<const char*> enabledCommands, disabledCommands;
 
     if (aEnabledCommands.Length()) {
       enabledCommands = new const char* [aEnabledCommands.Length()];
       for (uint32_t c = 0; c < aEnabledCommands.Length(); c++) {
@@ -2347,17 +2347,17 @@ TabParent::RecvContentReceivedInputBlock
   if (RenderFrameParent* rfp = GetRenderFrame()) {
     rfp->ContentReceivedInputBlock(aGuid, aInputBlockId, aPreventDefault);
   }
   return true;
 }
 
 bool
 TabParent::RecvSetTargetAPZC(const uint64_t& aInputBlockId,
-                             const nsTArray<ScrollableLayerGuid>& aTargets)
+                             nsTArray<ScrollableLayerGuid>&& aTargets)
 {
   if (RenderFrameParent* rfp = GetRenderFrame()) {
     rfp->SetTargetAPZC(aInputBlockId, aTargets);
   }
   return true;
 }
 
 already_AddRefed<nsILoadContext>
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -142,69 +142,69 @@ public:
                                   const nsString& aURI,
                                   const nsString& aName,
                                   const nsString& aFeatures,
                                   const nsString& aBaseURI,
                                   bool* aWindowIsNew,
                                   InfallibleTArray<FrameScriptInfo>* aFrameScripts) MOZ_OVERRIDE;
     virtual bool RecvSyncMessage(const nsString& aMessage,
                                  const ClonedMessageData& aData,
-                                 const InfallibleTArray<CpowEntry>& aCpows,
+                                 InfallibleTArray<CpowEntry>&& aCpows,
                                  const IPC::Principal& aPrincipal,
                                  InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
     virtual bool RecvRpcMessage(const nsString& aMessage,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<CpowEntry>& aCpows,
+                                InfallibleTArray<CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal,
                                 InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
     virtual bool RecvAsyncMessage(const nsString& aMessage,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMEFocus(const bool& aFocus,
                                     nsIMEUpdatePreference* aPreference,
                                     uint32_t* aSeqno) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMETextChange(const uint32_t& aStart,
                                          const uint32_t& aEnd,
                                          const uint32_t& aNewEnd,
                                          const bool& aCausedByComposition) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMESelectedCompositionRect(
                    const uint32_t& aOffset,
-                   const InfallibleTArray<nsIntRect>& aRects,
+                   InfallibleTArray<nsIntRect>&& aRects,
                    const uint32_t& aCaretOffset,
                    const nsIntRect& aCaretRect) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMESelection(const uint32_t& aSeqno,
                                         const uint32_t& aAnchor,
                                         const uint32_t& aFocus,
                                         const mozilla::WritingMode& aWritingMode,
                                         const bool& aCausedByComposition) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMETextHint(const nsString& aText) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMEMouseButtonEvent(const widget::IMENotification& aEventMessage,
                                                bool* aConsumedByIME) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMEEditorRect(const nsIntRect& aRect) MOZ_OVERRIDE;
     virtual bool RecvNotifyIMEPositionChange(
                    const nsIntRect& aEditoRect,
-                   const InfallibleTArray<nsIntRect>& aCompositionRects,
+                   InfallibleTArray<nsIntRect>&& aCompositionRects,
                    const nsIntRect& aCaretRect) MOZ_OVERRIDE;
     virtual bool RecvEndIMEComposition(const bool& aCancel,
                                        nsString* aComposition) MOZ_OVERRIDE;
     virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
                                      int32_t* aIMEOpen,
                                      intptr_t* aNativeIMEContext) MOZ_OVERRIDE;
     virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
                                      const int32_t& aIMEOpen,
                                      const nsString& aType,
                                      const nsString& aInputmode,
                                      const nsString& aActionHint,
                                      const int32_t& aCause,
                                      const int32_t& aFocusChange) MOZ_OVERRIDE;
     virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
     virtual bool RecvEnableDisableCommands(const nsString& aAction,
-                                           const nsTArray<nsCString>& aEnabledCommands,
-                                           const nsTArray<nsCString>& aDisabledCommands) MOZ_OVERRIDE;
+                                           nsTArray<nsCString>&& aEnabledCommands,
+                                           nsTArray<nsCString>&& aDisabledCommands) MOZ_OVERRIDE;
     virtual bool RecvSetCursor(const uint32_t& aValue, const bool& aForce) MOZ_OVERRIDE;
     virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
     virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
     virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) MOZ_OVERRIDE;
     virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) MOZ_OVERRIDE;
     virtual bool RecvHideTooltip() MOZ_OVERRIDE;
     virtual bool RecvGetDPI(float* aValue) MOZ_OVERRIDE;
     virtual bool RecvGetDefaultScale(double* aValue) MOZ_OVERRIDE;
@@ -215,17 +215,17 @@ public:
     virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
                                            const ViewID& aViewId,
                                            const bool& aIsRoot,
                                            const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
     virtual bool RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
                                                const uint64_t& aInputBlockId,
                                                const bool& aPreventDefault) MOZ_OVERRIDE;
     virtual bool RecvSetTargetAPZC(const uint64_t& aInputBlockId,
-                                   const nsTArray<ScrollableLayerGuid>& aTargets) MOZ_OVERRIDE;
+                                   nsTArray<ScrollableLayerGuid>&& aTargets) MOZ_OVERRIDE;
 
     virtual PColorPickerParent*
     AllocPColorPickerParent(const nsString& aTitle, const nsString& aInitialColor) MOZ_OVERRIDE;
     virtual bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker) MOZ_OVERRIDE;
 
     void LoadURL(nsIURI* aURI);
     // XXX/cjones: it's not clear what we gain by hiding these
     // message-sending functions under a layer of indirection and
--- a/dom/ipc/nsIContentChild.cpp
+++ b/dom/ipc/nsIContentChild.cpp
@@ -110,17 +110,17 @@ nsIContentChild::GetOrCreateActorForBlob
   NS_ENSURE_TRUE(actor, nullptr);
 
   return actor;
 }
 
 bool
 nsIContentChild::RecvAsyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal)
 {
   nsRefPtr<nsFrameMessageManager> cpm = nsFrameMessageManager::sChildProcessManager;
   if (cpm) {
     StructuredCloneData cloneData = ipc::UnpackClonedMessageDataForChild(aData);
     CpowIdHolder cpows(this, aCpows);
     cpm->ReceiveMessage(static_cast<nsIContentFrameMessageManager*>(cpm.get()),
                         aMsg, false, &cloneData, &cpows, aPrincipal, nullptr);
--- a/dom/ipc/nsIContentChild.h
+++ b/dom/ipc/nsIContentChild.h
@@ -73,17 +73,17 @@ protected:
   virtual bool DeallocPBrowserChild(PBrowserChild*);
 
   virtual PBlobChild* AllocPBlobChild(const BlobConstructorParams& aParams);
 
   virtual bool DeallocPBlobChild(PBlobChild* aActor);
 
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentChild, NS_ICONTENTCHILD_IID)
 
 } // dom
 } // mozilla
 #endif /* mozilla_dom_nsIContentChild_h */
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -175,17 +175,17 @@ nsIContentParent::GetOrCreateActorForBlo
   NS_ENSURE_TRUE(actor, nullptr);
 
   return actor;
 }
 
 bool
 nsIContentParent::RecvSyncMessage(const nsString& aMsg,
                                   const ClonedMessageData& aData,
-                                  const InfallibleTArray<CpowEntry>& aCpows,
+                                  InfallibleTArray<CpowEntry>&& aCpows,
                                   const IPC::Principal& aPrincipal,
                                   InfallibleTArray<nsString>* aRetvals)
 {
   // FIXME Permission check in Content process
   nsIPrincipal* principal = aPrincipal;
   if (IsContentParent()) {
     ContentParent* parent = AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
@@ -202,17 +202,17 @@ nsIContentParent::RecvSyncMessage(const 
                         aMsg, true, &cloneData, &cpows, aPrincipal, aRetvals);
   }
   return true;
 }
 
 bool
 nsIContentParent::RecvRpcMessage(const nsString& aMsg,
                                  const ClonedMessageData& aData,
-                                 const InfallibleTArray<CpowEntry>& aCpows,
+                                 InfallibleTArray<CpowEntry>&& aCpows,
                                  const IPC::Principal& aPrincipal,
                                  InfallibleTArray<nsString>* aRetvals)
 {
   // FIXME Permission check in Content process
   nsIPrincipal* principal = aPrincipal;
   if (IsContentParent()) {
     ContentParent* parent = AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
@@ -229,17 +229,17 @@ nsIContentParent::RecvRpcMessage(const n
                         aMsg, true, &cloneData, &cpows, aPrincipal, aRetvals);
   }
   return true;
 }
 
 bool
 nsIContentParent::RecvAsyncMessage(const nsString& aMsg,
                                    const ClonedMessageData& aData,
-                                   const InfallibleTArray<CpowEntry>& aCpows,
+                                   InfallibleTArray<CpowEntry>&& aCpows,
                                    const IPC::Principal& aPrincipal)
 {
   // FIXME Permission check in Content process
   nsIPrincipal* principal = aPrincipal;
   if (IsContentParent()) {
     ContentParent* parent = AsContentParent();
     if (!ContentParent::IgnoreIPCPrincipal() &&
         parent && principal && !AssertAppPrincipal(parent, principal)) {
--- a/dom/ipc/nsIContentParent.h
+++ b/dom/ipc/nsIContentParent.h
@@ -87,27 +87,27 @@ protected: // IPDL methods
   virtual bool DeallocPBrowserParent(PBrowserParent* frame);
 
   virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams);
 
   virtual bool DeallocPBlobParent(PBlobParent* aActor);
 
   virtual bool RecvSyncMessage(const nsString& aMsg,
                                const ClonedMessageData& aData,
-                               const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                               InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                const IPC::Principal& aPrincipal,
                                InfallibleTArray<nsString>* aRetvals);
   virtual bool RecvRpcMessage(const nsString& aMsg,
                               const ClonedMessageData& aData,
-                              const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                              InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                               const IPC::Principal& aPrincipal,
                               InfallibleTArray<nsString>* aRetvals);
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
-                                const InfallibleTArray<jsipc::CpowEntry>& aCpows,
+                                InfallibleTArray<jsipc::CpowEntry>&& aCpows,
                                 const IPC::Principal& aPrincipal);
 
 protected: // members
   nsRefPtr<nsFrameMessageManager> mMessageManager;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentParent, NS_ICONTENTPARENT_IID)
 
--- a/dom/media/gmp/GMPDecryptorChild.cpp
+++ b/dom/media/gmp/GMPDecryptorChild.cpp
@@ -206,17 +206,17 @@ GMPDecryptorChild::RecvInit()
   mSession->Init(this);
   return true;
 }
 
 bool
 GMPDecryptorChild::RecvCreateSession(const uint32_t& aCreateSessionToken,
                                      const uint32_t& aPromiseId,
                                      const nsCString& aInitDataType,
-                                     const nsTArray<uint8_t>& aInitData,
+                                     InfallibleTArray<uint8_t>&& aInitData,
                                      const GMPSessionType& aSessionType)
 {
   if (!mSession) {
     return false;
   }
 
   mSession->CreateSession(aCreateSessionToken,
                           aPromiseId,
@@ -242,17 +242,17 @@ GMPDecryptorChild::RecvLoadSession(const
                         aSessionId.Length());
 
   return true;
 }
 
 bool
 GMPDecryptorChild::RecvUpdateSession(const uint32_t& aPromiseId,
                                      const nsCString& aSessionId,
-                                     const nsTArray<uint8_t>& aResponse)
+                                     InfallibleTArray<uint8_t>&& aResponse)
 {
   if (!mSession) {
     return false;
   }
 
   mSession->UpdateSession(aPromiseId,
                           aSessionId.get(),
                           aSessionId.Length(),
@@ -289,32 +289,32 @@ GMPDecryptorChild::RecvRemoveSession(con
                           aSessionId.get(),
                           aSessionId.Length());
 
   return true;
 }
 
 bool
 GMPDecryptorChild::RecvSetServerCertificate(const uint32_t& aPromiseId,
-                                            const nsTArray<uint8_t>& aServerCert)
+                                            InfallibleTArray<uint8_t>&& aServerCert)
 {
   if (!mSession) {
     return false;
   }
 
   mSession->SetServerCertificate(aPromiseId,
                                  aServerCert.Elements(),
                                  aServerCert.Length());
 
   return true;
 }
 
 bool
 GMPDecryptorChild::RecvDecrypt(const uint32_t& aId,
-                               const nsTArray<uint8_t>& aBuffer,
+                               InfallibleTArray<uint8_t>&& aBuffer,
                                const GMPDecryptionData& aMetadata)
 {
   if (!mSession) {
     return false;
   }
 
   // Note: the GMPBufferImpl created here is deleted when the GMP passes
   // it back in the Decrypted() callback above.
--- a/dom/media/gmp/GMPDecryptorChild.h
+++ b/dom/media/gmp/GMPDecryptorChild.h
@@ -87,39 +87,39 @@ private:
   ~GMPDecryptorChild();
 
   // GMPDecryptorChild
   virtual bool RecvInit() MOZ_OVERRIDE;
 
   virtual bool RecvCreateSession(const uint32_t& aCreateSessionToken,
                                  const uint32_t& aPromiseId,
                                  const nsCString& aInitDataType,
-                                 const nsTArray<uint8_t>& aInitData,
+                                 InfallibleTArray<uint8_t>&& aInitData,
                                  const GMPSessionType& aSessionType) MOZ_OVERRIDE;
 
   virtual bool RecvLoadSession(const uint32_t& aPromiseId,
                                const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvUpdateSession(const uint32_t& aPromiseId,
                                  const nsCString& aSessionId,
-                                 const nsTArray<uint8_t>& aResponse) MOZ_OVERRIDE;
+                                 InfallibleTArray<uint8_t>&& aResponse) MOZ_OVERRIDE;
 
   virtual bool RecvCloseSession(const uint32_t& aPromiseId,
                                 const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvRemoveSession(const uint32_t& aPromiseId,
                                  const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvDecrypt(const uint32_t& aId,
-                           const nsTArray<uint8_t>& aBuffer,
+                           InfallibleTArray<uint8_t>&& aBuffer,
                            const GMPDecryptionData& aMetadata) MOZ_OVERRIDE;
 
   // Resolve/reject promise on completion.
   virtual bool RecvSetServerCertificate(const uint32_t& aPromiseId,
-                                        const nsTArray<uint8_t>& aServerCert) MOZ_OVERRIDE;
+                                        InfallibleTArray<uint8_t>&& aServerCert) MOZ_OVERRIDE;
 
   virtual bool RecvDecryptingComplete() MOZ_OVERRIDE;
 
   // GMP's GMPDecryptor implementation.
   // Only call into this on the (GMP process) main thread.
   GMPDecryptor* mSession;
   GMPChild* mPlugin;
 
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -209,17 +209,17 @@ GMPDecryptorParent::RecvRejectPromise(co
   }
   mCallback->RejectPromise(aPromiseId, GMPExToNsresult(aException), aMessage);
   return true;
 }
 
 bool
 GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId,
                                        const GMPSessionMessageType& aMessageType,
-                                       const nsTArray<uint8_t>& aMessage)
+                                       nsTArray<uint8_t>&& aMessage)
 {
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return false;
   }
   mCallback->SessionMessage(aSessionId, aMessageType, aMessage);
   return true;
 }
@@ -261,29 +261,29 @@ GMPDecryptorParent::RecvSessionError(con
                           GMPExToNsresult(aException),
                           aSystemCode,
                           aMessage);
   return true;
 }
 
 bool
 GMPDecryptorParent::RecvKeyIdUsable(const nsCString& aSessionId,
-                                    const nsTArray<uint8_t>& aKeyId)
+                                    InfallibleTArray<uint8_t>&& aKeyId)
 {
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return false;
   }
   mCallback->KeyIdUsable(aSessionId, aKeyId);
   return true;
 }
 
 bool
 GMPDecryptorParent::RecvKeyIdNotUsable(const nsCString& aSessionId,
-                                       const nsTArray<uint8_t>& aKeyId)
+                                       InfallibleTArray<uint8_t>&& aKeyId)
 {
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return false;
   }
   mCallback->KeyIdNotUsable(aSessionId, aKeyId);
   return true;
 }
@@ -297,17 +297,17 @@ GMPDecryptorParent::RecvSetCaps(const ui
   }
   mCallback->SetCaps(aCaps);
   return true;
 }
 
 bool
 GMPDecryptorParent::RecvDecrypted(const uint32_t& aId,
                                   const GMPErr& aErr,
-                                  const nsTArray<uint8_t>& aBuffer)
+                                  InfallibleTArray<uint8_t>&& aBuffer)
 {
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return false;
   }
   mCallback->Decrypted(aId, aErr, aBuffer);
   return true;
 }
--- a/dom/media/gmp/GMPDecryptorParent.h
+++ b/dom/media/gmp/GMPDecryptorParent.h
@@ -74,37 +74,37 @@ private:
   virtual bool RecvResolvePromise(const uint32_t& aPromiseId) MOZ_OVERRIDE;
 
   virtual bool RecvRejectPromise(const uint32_t& aPromiseId,
                                  const GMPDOMException& aException,
                                  const nsCString& aMessage) MOZ_OVERRIDE;
 
   virtual bool RecvSessionMessage(const nsCString& aSessionId,
                                   const GMPSessionMessageType& aMessageType,
-                                  const nsTArray<uint8_t>& aMessage) MOZ_OVERRIDE;
+                                  nsTArray<uint8_t>&& aMessage) MOZ_OVERRIDE;
 
   virtual bool RecvExpirationChange(const nsCString& aSessionId,
                                     const double& aExpiryTime) MOZ_OVERRIDE;
 
   virtual bool RecvSessionClosed(const nsCString& aSessionId) MOZ_OVERRIDE;
 
   virtual bool RecvSessionError(const nsCString& aSessionId,
                                 const GMPDOMException& aException,
                                 const uint32_t& aSystemCode,
                                 const nsCString& aMessage) MOZ_OVERRIDE;
 
   virtual bool RecvKeyIdUsable(const nsCString& aSessionId,
-                                const nsTArray<uint8_t>& aKeyId) MOZ_OVERRIDE;
+                               InfallibleTArray<uint8_t>&& aKeyId) MOZ_OVERRIDE;
 
   virtual bool RecvKeyIdNotUsable(const nsCString& aSessionId,
-                                  const nsTArray<uint8_t>& aKeyId) MOZ_OVERRIDE;
+                                  InfallibleTArray<uint8_t>&& aKeyId) MOZ_OVERRIDE;
 
   virtual bool RecvDecrypted(const uint32_t& aId,
                              const GMPErr& aErr,
-                             const nsTArray<uint8_t>& aBuffer) MOZ_OVERRIDE;
+                             InfallibleTArray<uint8_t>&& aBuffer) MOZ_OVERRIDE;
 
   virtual bool RecvSetCaps(const uint64_t& aCaps) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   virtual bool Recv__delete__() MOZ_OVERRIDE;
 
   bool mIsOpen;
   bool mShuttingDown;
--- a/dom/media/gmp/GMPStorageChild.cpp
+++ b/dom/media/gmp/GMPStorageChild.cpp
@@ -237,17 +237,17 @@ GMPStorageChild::RecvOpenComplete(const 
   }
   record->OpenComplete(aStatus);
   return true;
 }
 
 bool
 GMPStorageChild::RecvReadComplete(const nsCString& aRecordName,
                                   const GMPErr& aStatus,
-                                  const InfallibleTArray<uint8_t>& aBytes)
+                                  InfallibleTArray<uint8_t>&& aBytes)
 {
   if (mShutdown) {
     return true;
   }
   nsRefPtr<GMPRecordImpl> record = GetRecord(aRecordName);
   if (!record) {
     // Not fatal.
     return true;
@@ -325,17 +325,17 @@ public:
   }
 
 private:
   nsTArray<nsCString> mRecordNames;
   size_t mIndex;
 };
 
 bool
-GMPStorageChild::RecvRecordNames(const InfallibleTArray<nsCString>& aRecordNames,
+GMPStorageChild::RecvRecordNames(InfallibleTArray<nsCString>&& aRecordNames,
                                  const GMPErr& aStatus)
 {
   RecordIteratorContext ctx;
   {
     MonitorAutoLock lock(mMonitor);
     if (mShutdown || mPendingRecordIterators.empty()) {
       return true;
     }
--- a/dom/media/gmp/GMPStorageChild.h
+++ b/dom/media/gmp/GMPStorageChild.h
@@ -80,20 +80,20 @@ private:
 protected:
   ~GMPStorageChild() {}
 
   // PGMPStorageChild
   virtual bool RecvOpenComplete(const nsCString& aRecordName,
                                 const GMPErr& aStatus) MOZ_OVERRIDE;
   virtual bool RecvReadComplete(const nsCString& aRecordName,
                                 const GMPErr& aStatus,
-                                const InfallibleTArray<uint8_t>& aBytes) MOZ_OVERRIDE;
+                                InfallibleTArray<uint8_t>&& aBytes) MOZ_OVERRIDE;
   virtual bool RecvWriteComplete(const nsCString& aRecordName,
                                  const GMPErr& aStatus) MOZ_OVERRIDE;
-  virtual bool RecvRecordNames(const InfallibleTArray<nsCString>& aRecordNames,
+  virtual bool RecvRecordNames(InfallibleTArray<nsCString>&& aRecordNames,
                                const GMPErr& aStatus) MOZ_OVERRIDE;
   virtual bool RecvShutdown() MOZ_OVERRIDE;
 
 private:
   Monitor mMonitor;
   nsRefPtrHashtable<nsCStringHashKey, GMPRecordImpl> mRecords;
   GMPChild* mPlugin;
 
--- a/dom/media/gmp/GMPStorageParent.cpp
+++ b/dom/media/gmp/GMPStorageParent.cpp
@@ -535,17 +535,17 @@ GMPStorageParent::RecvRead(const nsCStri
     unused << SendReadComplete(aRecordName, mStorage->Read(aRecordName, data), data);
   }
 
   return true;
 }
 
 bool
 GMPStorageParent::RecvWrite(const nsCString& aRecordName,
-                            const InfallibleTArray<uint8_t>& aBytes)
+                            InfallibleTArray<uint8_t>&& aBytes)
 {
   LOGD(("%s::%s: %p record=%s", __CLASS__, __FUNCTION__, this, aRecordName.get()));
 
   if (mShutdown) {
     return false;
   }
 
   if (!mStorage->IsOpen(aRecordName)) {
--- a/dom/media/gmp/GMPStorageParent.h
+++ b/dom/media/gmp/GMPStorageParent.h
@@ -37,17 +37,17 @@ public:
 
   nsresult Init();
   void Shutdown();
 
 protected:
   virtual bool RecvOpen(const nsCString& aRecordName) MOZ_OVERRIDE;
   virtual bool RecvRead(const nsCString& aRecordName) MOZ_OVERRIDE;
   virtual bool RecvWrite(const nsCString& aRecordName,
-                         const InfallibleTArray<uint8_t>& aBytes) MOZ_OVERRIDE;
+                         InfallibleTArray<uint8_t>&& aBytes) MOZ_OVERRIDE;
   virtual bool RecvGetRecordNames() MOZ_OVERRIDE;
   virtual bool RecvClose(const nsCString& aRecordName) MOZ_OVERRIDE;
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
 private:
   ~GMPStorageParent() {}
 
   UniquePtr<GMPStorage> mStorage;
--- a/dom/media/gmp/GMPVideoDecoderChild.cpp
+++ b/dom/media/gmp/GMPVideoDecoderChild.cpp
@@ -102,17 +102,17 @@ GMPVideoDecoderChild::Error(GMPErr aErro
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
   SendError(aError);
 }
 
 bool
 GMPVideoDecoderChild::RecvInitDecode(const GMPVideoCodec& aCodecSettings,
-                                     const nsTArray<uint8_t>& aCodecSpecific,
+                                     InfallibleTArray<uint8_t>&& aCodecSpecific,
                                      const int32_t& aCoreCount)
 {
   if (!mVideoDecoder) {
     return false;
   }
 
   // Ignore any return code. It is OK for this to fail without killing the process.
   mVideoDecoder->InitDecode(aCodecSettings,
@@ -121,17 +121,17 @@ GMPVideoDecoderChild::RecvInitDecode(con
                             this,
                             aCoreCount);
   return true;
 }
 
 bool
 GMPVideoDecoderChild::RecvDecode(const GMPVideoEncodedFrameData& aInputFrame,
                                  const bool& aMissingFrames,
-                                 const nsTArray<uint8_t>& aCodecSpecificInfo,
+                                 InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
                                  const int64_t& aRenderTimeMs)
 {
   if (!mVideoDecoder) {
     return false;
   }
 
   auto f = new GMPVideoEncodedFrameImpl(aInputFrame, &mVideoHost);
 
@@ -141,17 +141,17 @@ GMPVideoDecoderChild::RecvDecode(const G
                         aCodecSpecificInfo.Elements(),
                         aCodecSpecificInfo.Length(),
                         aRenderTimeMs);
 
   return true;
 }
 
 bool
-GMPVideoDecoderChild::RecvChildShmemForPool(Shmem& aFrameBuffer)
+GMPVideoDecoderChild::RecvChildShmemForPool(Shmem&& aFrameBuffer)
 {
   if (aFrameBuffer.IsWritable()) {
     mVideoHost.SharedMemMgr()->MgrDeallocShmem(GMPSharedMem::kGMPFrameData,
                                                aFrameBuffer);
   }
   return true;
 }
 
--- a/dom/media/gmp/GMPVideoDecoderChild.h
+++ b/dom/media/gmp/GMPVideoDecoderChild.h
@@ -58,23 +58,23 @@ public:
 #else
     DeallocShmem(aMem);
 #endif
   }
 
 private:
   // PGMPVideoDecoderChild
   virtual bool RecvInitDecode(const GMPVideoCodec& aCodecSettings,
-                              const nsTArray<uint8_t>& aCodecSpecific,
+                              InfallibleTArray<uint8_t>&& aCodecSpecific,
                               const int32_t& aCoreCount) MOZ_OVERRIDE;
   virtual bool RecvDecode(const GMPVideoEncodedFrameData& aInputFrame,
                           const bool& aMissingFrames,
-                          const nsTArray<uint8_t>& aCodecSpecificInfo,
+                          InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
                           const int64_t& aRenderTimeMs) MOZ_OVERRIDE;
-  virtual bool RecvChildShmemForPool(Shmem& aFrameBuffer) MOZ_OVERRIDE;
+  virtual bool RecvChildShmemForPool(Shmem&& aFrameBuffer) MOZ_OVERRIDE;
   virtual bool RecvReset() MOZ_OVERRIDE;
   virtual bool RecvDrain() MOZ_OVERRIDE;
   virtual bool RecvDecodingComplete() MOZ_OVERRIDE;
 
   GMPChild* mPlugin;
   GMPVideoDecoder* mVideoDecoder;
   GMPVideoHostImpl mVideoHost;
 };
--- a/dom/media/gmp/GMPVideoDecoderParent.cpp
+++ b/dom/media/gmp/GMPVideoDecoderParent.cpp
@@ -317,17 +317,17 @@ GMPVideoDecoderParent::RecvError(const G
 
   // Ignore any return code. It is OK for this to fail without killing the process.
   mCallback->Error(aError);
 
   return true;
 }
 
 bool
-GMPVideoDecoderParent::RecvParentShmemForPool(Shmem& aEncodedBuffer)
+GMPVideoDecoderParent::RecvParentShmemForPool(Shmem&& aEncodedBuffer)
 {
   if (aEncodedBuffer.IsWritable()) {
     mVideoHost.SharedMemMgr()->MgrDeallocShmem(GMPSharedMem::kGMPEncodedData,
                                                aEncodedBuffer);
   }
   return true;
 }
 
--- a/dom/media/gmp/GMPVideoDecoderParent.h
+++ b/dom/media/gmp/GMPVideoDecoderParent.h
@@ -66,17 +66,17 @@ private:
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   virtual bool RecvDecoded(const GMPVideoi420FrameData& aDecodedFrame) MOZ_OVERRIDE;
   virtual bool RecvReceivedDecodedReferenceFrame(const uint64_t& aPictureId) MOZ_OVERRIDE;
   virtual bool RecvReceivedDecodedFrame(const uint64_t& aPictureId) MOZ_OVERRIDE;
   virtual bool RecvInputDataExhausted() MOZ_OVERRIDE;
   virtual bool RecvDrainComplete() MOZ_OVERRIDE;
   virtual bool RecvResetComplete() MOZ_OVERRIDE;
   virtual bool RecvError(const GMPErr& aError) MOZ_OVERRIDE;
-  virtual bool RecvParentShmemForPool(Shmem& aEncodedBuffer) MOZ_OVERRIDE;
+  virtual bool RecvParentShmemForPool(Shmem&& aEncodedBuffer) MOZ_OVERRIDE;
   virtual bool AnswerNeedShmem(const uint32_t& aFrameBufferSize,
                                Shmem* aMem) MOZ_OVERRIDE;
   virtual bool Recv__delete__() MOZ_OVERRIDE;
 
   bool mIsOpen;
   bool mShuttingDown;
   nsRefPtr<GMPParent> mPlugin;
   GMPVideoDecoderCallbackProxy* mCallback;
--- a/dom/media/gmp/GMPVideoEncoderChild.cpp
+++ b/dom/media/gmp/GMPVideoEncoderChild.cpp
@@ -63,17 +63,17 @@ GMPVideoEncoderChild::Error(GMPErr aErro
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
   SendError(aError);
 }
 
 bool
 GMPVideoEncoderChild::RecvInitEncode(const GMPVideoCodec& aCodecSettings,
-                                     const nsTArray<uint8_t>& aCodecSpecific,
+                                     InfallibleTArray<uint8_t>&& aCodecSpecific,
                                      const int32_t& aNumberOfCores,
                                      const uint32_t& aMaxPayloadSize)
 {
   if (!mVideoEncoder) {
     return false;
   }
 
   // Ignore any return code. It is OK for this to fail without killing the process.
@@ -84,18 +84,18 @@ GMPVideoEncoderChild::RecvInitEncode(con
                             aNumberOfCores,
                             aMaxPayloadSize);
 
   return true;
 }
 
 bool
 GMPVideoEncoderChild::RecvEncode(const GMPVideoi420FrameData& aInputFrame,
-                                 const nsTArray<uint8_t>& aCodecSpecificInfo,
-                                 const nsTArray<GMPVideoFrameType>& aFrameTypes)
+                                 InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
+                                 InfallibleTArray<GMPVideoFrameType>&& aFrameTypes)
 {
   if (!mVideoEncoder) {
     return false;
   }
 
   auto f = new GMPVideoi420FrameImpl(aInputFrame, &mVideoHost);
 
   // Ignore any return code. It is OK for this to fail without killing the process.
@@ -104,17 +104,17 @@ GMPVideoEncoderChild::RecvEncode(const G
                         aCodecSpecificInfo.Length(),
                         aFrameTypes.Elements(),
                         aFrameTypes.Length());
 
   return true;
 }
 
 bool
-GMPVideoEncoderChild::RecvChildShmemForPool(Shmem& aEncodedBuffer)
+GMPVideoEncoderChild::RecvChildShmemForPool(Shmem&& aEncodedBuffer)
 {
   if (aEncodedBuffer.IsWritable()) {
     mVideoHost.SharedMemMgr()->MgrDeallocShmem(GMPSharedMem::kGMPEncodedData,
                                                aEncodedBuffer);
   }
   return true;
 }
 
--- a/dom/media/gmp/GMPVideoEncoderChild.h
+++ b/dom/media/gmp/GMPVideoEncoderChild.h
@@ -54,23 +54,23 @@ public:
 #else
     DeallocShmem(aMem);
 #endif
   }
 
 private:
   // PGMPVideoEncoderChild
   virtual bool RecvInitEncode(const GMPVideoCodec& aCodecSettings,
-                              const nsTArray<uint8_t>& aCodecSpecific,
+                              InfallibleTArray<uint8_t>&& aCodecSpecific,
                               const int32_t& aNumberOfCores,
                               const uint32_t& aMaxPayloadSize) MOZ_OVERRIDE;
   virtual bool RecvEncode(const GMPVideoi420FrameData& aInputFrame,
-                          const nsTArray<uint8_t>& aCodecSpecificInfo,
-                          const nsTArray<GMPVideoFrameType>& aFrameTypes) MOZ_OVERRIDE;
-  virtual bool RecvChildShmemForPool(Shmem& aEncodedBuffer) MOZ_OVERRIDE;
+                          InfallibleTArray<uint8_t>&& aCodecSpecificInfo,
+                          InfallibleTArray<GMPVideoFrameType>&& aFrameTypes) MOZ_OVERRIDE;
+  virtual bool RecvChildShmemForPool(Shmem&& aEncodedBuffer) MOZ_OVERRIDE;
   virtual bool RecvSetChannelParameters(const uint32_t& aPacketLoss,
                                         const uint32_t& aRTT) MOZ_OVERRIDE;
   virtual bool RecvSetRates(const uint32_t& aNewBitRate,
                             const uint32_t& aFrameRate) MOZ_OVERRIDE;
   virtual bool RecvSetPeriodicKeyFrames(const bool& aEnable) MOZ_OVERRIDE;
   virtual bool RecvEncodingComplete() MOZ_OVERRIDE;
 
   GMPChild* mPlugin;
--- a/dom/media/gmp/GMPVideoEncoderParent.cpp
+++ b/dom/media/gmp/GMPVideoEncoderParent.cpp
@@ -283,17 +283,17 @@ EncodedCallback(GMPVideoEncoderCallbackP
   // XXX add locks to the ShmemManager instead?
   aThread->Dispatch(WrapRunnable(aEncodedFrame,
                                 &GMPVideoEncodedFrame::Destroy),
                    NS_DISPATCH_NORMAL);
 }
 
 bool
 GMPVideoEncoderParent::RecvEncoded(const GMPVideoEncodedFrameData& aEncodedFrame,
-                                   const nsTArray<uint8_t>& aCodecSpecificInfo)
+                                   InfallibleTArray<uint8_t>&& aCodecSpecificInfo)
 {
   if (!mCallback) {
     return false;
   }
 
   auto f = new GMPVideoEncodedFrameImpl(aEncodedFrame, &mVideoHost);
   nsTArray<uint8_t> *codecSpecificInfo = new nsTArray<uint8_t>;
   codecSpecificInfo->AppendElements((uint8_t*)aCodecSpecificInfo.Elements(), aCodecSpecificInfo.Length());
@@ -315,17 +315,17 @@ GMPVideoEncoderParent::RecvError(const G
 
   // Ignore any return code. It is OK for this to fail without killing the process.
   mCallback->Error(aError);
 
   return true;
 }
 
 bool
-GMPVideoEncoderParent::RecvParentShmemForPool(Shmem& aFrameBuffer)
+GMPVideoEncoderParent::RecvParentShmemForPool(Shmem&& aFrameBuffer)
 {
   if (aFrameBuffer.IsWritable()) {
     mVideoHost.SharedMemMgr()->MgrDeallocShmem(GMPSharedMem::kGMPFrameData,
                                                aFrameBuffer);
   }
   return true;
 }
 
--- a/dom/media/gmp/GMPVideoEncoderParent.h
+++ b/dom/media/gmp/GMPVideoEncoderParent.h
@@ -61,19 +61,19 @@ public:
   }
 
 private:
   virtual ~GMPVideoEncoderParent();
 
   // PGMPVideoEncoderParent
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   virtual bool RecvEncoded(const GMPVideoEncodedFrameData& aEncodedFrame,
-                           const nsTArray<uint8_t>& aCodecSpecificInfo) MOZ_OVERRIDE;
+                           InfallibleTArray<uint8_t>&& aCodecSpecificInfo) MOZ_OVERRIDE;
   virtual bool RecvError(const GMPErr& aError) MOZ_OVERRIDE;
-  virtual bool RecvParentShmemForPool(Shmem& aFrameBuffer) MOZ_OVERRIDE;
+  virtual bool RecvParentShmemForPool(Shmem&& aFrameBuffer) MOZ_OVERRIDE;
   virtual bool AnswerNeedShmem(const uint32_t& aEncodedBufferSize,
                                Shmem* aMem) MOZ_OVERRIDE;
   virtual bool Recv__delete__() MOZ_OVERRIDE;
 
   bool mIsOpen;
   bool mShuttingDown;
   nsRefPtr<GMPParent> mPlugin;
   GMPVideoEncoderCallbackProxy* mCallback;
--- a/dom/network/UDPSocketChild.cpp
+++ b/dom/network/UDPSocketChild.cpp
@@ -230,17 +230,17 @@ UDPSocketChild::RecvCallbackClosed()
   nsresult rv = mSocket->CallListenerClosed();
   mozilla::unused << NS_WARN_IF(NS_FAILED(rv));
 
   return true;
 }
 
 bool
 UDPSocketChild::RecvCallbackReceivedData(const UDPAddressInfo& aAddressInfo,
-                                         const InfallibleTArray<uint8_t>& aData)
+                                         InfallibleTArray<uint8_t>&& aData)
 {
   nsresult rv = mSocket->CallListenerReceivedData(aAddressInfo.addr(), aAddressInfo.port(),
                                                   aData.Elements(), aData.Length());
   mozilla::unused << NS_WARN_IF(NS_FAILED(rv));
 
   return true;
 }
 
--- a/dom/network/UDPSocketChild.h
+++ b/dom/network/UDPSocketChild.h
@@ -38,17 +38,17 @@ public:
   NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE;
 
   UDPSocketChild();
   virtual ~UDPSocketChild();
 
   virtual bool RecvCallbackOpened(const UDPAddressInfo& aAddressInfo) MOZ_OVERRIDE;
   virtual bool RecvCallbackClosed() MOZ_OVERRIDE;
   virtual bool RecvCallbackReceivedData(const UDPAddressInfo& aAddressInfo,
-                                        const InfallibleTArray<uint8_t>& aData) MOZ_OVERRIDE;
+                                        InfallibleTArray<uint8_t>&& aData) MOZ_OVERRIDE;
   virtual bool RecvCallbackError(const nsCString& aMessage,
                                  const nsCString& aFilename,
                                  const uint32_t& aLineNumber) MOZ_OVERRIDE;
 
 private:
   nsresult SendDataInternal(const UDPSocketAddr& aAddr,
                             const uint8_t* aData,
                             const uint32_t aByteLength);
--- a/dom/network/UDPSocketParent.h
+++ b/dom/network/UDPSocketParent.h
@@ -29,17 +29,16 @@ public:
   bool Init(const nsACString& aFilter);
 
   virtual bool RecvBind(const UDPAddressInfo& aAddressInfo,
                         const bool& aAddressReuse, const bool& aLoopback) MOZ_OVERRIDE;
 
   virtual bool RecvOutgoingData(const UDPData& aData, const UDPSocketAddr& aAddr) MOZ_OVERRIDE;
 
   virtual bool RecvClose() MOZ_OVERRIDE;
-
   virtual bool RecvRequestDelete() MOZ_OVERRIDE;
   virtual bool RecvJoinMulticast(const nsCString& aMulticastAddress,
                                  const nsCString& aInterface) MOZ_OVERRIDE;
   virtual bool RecvLeaveMulticast(const nsCString& aMulticastAddress,
                                   const nsCString& aInterface) MOZ_OVERRIDE;
   virtual nsresult OfflineNotification(nsISupports *) MOZ_OVERRIDE;
   virtual uint32_t GetAppId() MOZ_OVERRIDE;
 
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -327,19 +327,19 @@ NotificationPermissionRequest::CallCallb
   return rv.ErrorCode();
 }
 
 NS_IMETHODIMP
 NotificationPermissionRequest::GetTypes(nsIArray** aTypes)
 {
   nsTArray<nsString> emptyOptions;
   return nsContentPermissionUtils::CreatePermissionArray(NS_LITERAL_CSTRING("desktop-notification"),
-                                                         NS_LITERAL_CSTRING("unused"),
-                                                         emptyOptions,
-                                                         aTypes);
+							 NS_LITERAL_CSTRING("unused"),
+							 emptyOptions,
+							 aTypes);
 }
 
 NS_IMPL_ISUPPORTS(NotificationTask, nsIRunnable)
 
 NS_IMETHODIMP
 NotificationTask::Run()
 {
   switch (mAction) {
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -850,17 +850,17 @@ PluginInstanceChild::AnswerNPP_HandleEve
 
     return true;
 }
 
 #ifdef XP_MACOSX
 
 bool
 PluginInstanceChild::AnswerNPP_HandleEvent_Shmem(const NPRemoteEvent& event,
-                                                 Shmem& mem,
+                                                 Shmem&& mem,
                                                  int16_t* handled,
                                                  Shmem* rtnmem)
 {
     PLUGIN_LOG_DEBUG_FUNCTION;
     AssertPluginThread();
 
     PaintTracker pt;
 
@@ -914,17 +914,17 @@ PluginInstanceChild::AnswerNPP_HandleEve
 
     *rtnmem = mem;
     return true;
 }
 
 #else
 bool
 PluginInstanceChild::AnswerNPP_HandleEvent_Shmem(const NPRemoteEvent& event,
-                                                 Shmem& mem,
+                                                 Shmem&& mem,
                                                  int16_t* handled,
                                                  Shmem* rtnmem)
 {
     NS_RUNTIMEABORT("not reached.");
     *rtnmem = mem;
     return true;
 }
 #endif
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -84,17 +84,17 @@ protected:
                                                            NPError* aResult) MOZ_OVERRIDE;
     virtual bool
     AnswerNPP_SetValue_NPNVprivateModeBool(const bool& value, NPError* result) MOZ_OVERRIDE;
 
     virtual bool
     AnswerNPP_HandleEvent(const NPRemoteEvent& event, int16_t* handled) MOZ_OVERRIDE;
     virtual bool
     AnswerNPP_HandleEvent_Shmem(const NPRemoteEvent& event,
-                                Shmem& mem,
+                                Shmem&& mem,
                                 int16_t* handled,
                                 Shmem* rtnmem) MOZ_OVERRIDE;
     virtual bool
     AnswerNPP_HandleEvent_IOSurface(const NPRemoteEvent& event,
                                     const uint32_t& surface,
                                     int16_t* handled) MOZ_OVERRIDE;
 
     // Async rendering
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -2126,18 +2126,18 @@ PluginModuleChild::InitQuirksModes(const
     }
 #endif
 }
 
 bool
 PluginModuleChild::RecvPPluginInstanceConstructor(PPluginInstanceChild* aActor,
                                                   const nsCString& aMimeType,
                                                   const uint16_t& aMode,
-                                                  const InfallibleTArray<nsCString>& aNames,
-                                                  const InfallibleTArray<nsCString>& aValues)
+                                                  InfallibleTArray<nsCString>&& aNames,
+                                                  InfallibleTArray<nsCString>&& aValues)
 {
     PLUGIN_LOG_DEBUG_METHOD;
     AssertPluginThread();
 
     NS_ASSERTION(aActor, "Null actor!");
     return true;
 }
 
@@ -2473,18 +2473,18 @@ void
 PluginModuleChild::ProcessNativeEvents() {
     CallProcessSomeEvents();    
 }
 #endif
 
 bool
 PluginModuleChild::RecvStartProfiler(const uint32_t& aEntries,
                                      const double& aInterval,
-                                     const nsTArray<nsCString>& aFeatures,
-                                     const nsTArray<nsCString>& aThreadNameFilters)
+                                     nsTArray<nsCString>&& aFeatures,
+                                     nsTArray<nsCString>&& aThreadNameFilters)
 {
     nsTArray<const char*> featureArray;
     for (size_t i = 0; i < aFeatures.Length(); ++i) {
         featureArray.AppendElement(aFeatures[i].get());
     }
 
     nsTArray<const char*> threadNameFilterArray;
     for (size_t i = 0; i < aThreadNameFilters.Length(); ++i) {
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -96,18 +96,18 @@ protected:
 
     virtual bool
     DeallocPPluginInstanceChild(PPluginInstanceChild* aActor) MOZ_OVERRIDE;
 
     virtual bool
     RecvPPluginInstanceConstructor(PPluginInstanceChild* aActor,
                                    const nsCString& aMimeType,
                                    const uint16_t& aMode,
-                                   const InfallibleTArray<nsCString>& aNames,
-                                   const InfallibleTArray<nsCString>& aValues)
+                                   InfallibleTArray<nsCString>&& aNames,
+                                   InfallibleTArray<nsCString>&& aValues)
                                    MOZ_OVERRIDE;
     virtual bool
     AnswerNP_Shutdown(NPError *rv) MOZ_OVERRIDE;
 
     virtual bool
     AnswerOptionalFunctionsSupported(bool *aURLRedirectNotify,
                                      bool *aClearSiteData,
                                      bool *aGetSitesWithData) MOZ_OVERRIDE;
@@ -144,18 +144,18 @@ protected:
 
     MOZ_NORETURN void QuickExit();
 
     virtual bool
     RecvProcessNativeEventsInInterruptCall() MOZ_OVERRIDE;
 
     virtual bool RecvStartProfiler(const uint32_t& aEntries,
                                    const double& aInterval,
-                                   const nsTArray<nsCString>& aFeatures,
-                                   const nsTArray<nsCString>& aThreadNameFilters) MOZ_OVERRIDE;
+                                   nsTArray<nsCString>&& aFeatures,
+                                   nsTArray<nsCString>&& aThreadNameFilters) MOZ_OVERRIDE;
     virtual bool RecvStopProfiler() MOZ_OVERRIDE;
     virtual bool AnswerGetProfile(nsCString* aProfile) MOZ_OVERRIDE;
 
 public:
     explicit PluginModuleChild(bool aIsChrome);
     virtual ~PluginModuleChild();
 
     bool CommonInit(base::ProcessHandle aParentProcessHandle,
--- a/dom/plugins/ipc/PluginScriptableObjectChild.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.cpp
@@ -748,17 +748,17 @@ PluginScriptableObjectChild::AnswerHasMe
 
   StackIdentifier id(aId);
   *aHasMethod = mObject->_class->hasMethod(mObject, id.ToNPIdentifier());
   return true;
 }
 
 bool
 PluginScriptableObjectChild::AnswerInvoke(const PluginIdentifier& aId,
-                                          const InfallibleTArray<Variant>& aArgs,
+                                          InfallibleTArray<Variant>&& aArgs,
                                           Variant* aResult,
                                           bool* aSuccess)
 {
   AssertPluginThread();
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
@@ -818,17 +818,17 @@ PluginScriptableObjectChild::AnswerInvok
   }
 
   *aSuccess = true;
   *aResult = convertedResult;
   return true;
 }
 
 bool
-PluginScriptableObjectChild::AnswerInvokeDefault(const InfallibleTArray<Variant>& aArgs,
+PluginScriptableObjectChild::AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
                                                  Variant* aResult,
                                                  bool* aSuccess)
 {
   AssertPluginThread();
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerInvokeDefault with an invalidated object!");
     *aResult = void_t();
@@ -1069,17 +1069,17 @@ PluginScriptableObjectChild::AnswerEnume
   }
 
   PluginModuleChild::sBrowserFuncs.memfree(ids);
   *aSuccess = true;
   return true;
 }
 
 bool
-PluginScriptableObjectChild::AnswerConstruct(const InfallibleTArray<Variant>& aArgs,
+PluginScriptableObjectChild::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
                                              Variant* aResult,
                                              bool* aSuccess)
 {
   AssertPluginThread();
 
   if (mInvalidated) {
     NS_WARNING("Calling AnswerConstruct with an invalidated object!");
     *aResult = void_t();
--- a/dom/plugins/ipc/PluginScriptableObjectChild.h
+++ b/dom/plugins/ipc/PluginScriptableObjectChild.h
@@ -58,22 +58,22 @@ public:
   AnswerInvalidate() MOZ_OVERRIDE;
 
   virtual bool
   AnswerHasMethod(const PluginIdentifier& aId,
                   bool* aHasMethod) MOZ_OVERRIDE;
 
   virtual bool
   AnswerInvoke(const PluginIdentifier& aId,
-               const InfallibleTArray<Variant>& aArgs,
+               InfallibleTArray<Variant>&& aArgs,
                Variant* aResult,
                bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
-  AnswerInvokeDefault(const InfallibleTArray<Variant>& aArgs,
+  AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
                       Variant* aResult,
                       bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   AnswerHasProperty(const PluginIdentifier& aId,
                     bool* aHasProperty) MOZ_OVERRIDE;
 
   virtual bool
@@ -92,17 +92,17 @@ public:
   AnswerRemoveProperty(const PluginIdentifier& aId,
                        bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   AnswerEnumerate(InfallibleTArray<PluginIdentifier>* aProperties,
                   bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
-  AnswerConstruct(const InfallibleTArray<Variant>& aArgs,
+  AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
                   Variant* aResult,
                   bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   RecvProtect() MOZ_OVERRIDE;
 
   virtual bool
   RecvUnprotect() MOZ_OVERRIDE;
--- a/dom/plugins/ipc/PluginScriptableObjectParent.cpp
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.cpp
@@ -778,17 +778,17 @@ PluginScriptableObjectParent::AnswerHasM
     return true;
   }
   *aHasMethod = npn->hasmethod(instance->GetNPP(), mObject, stackID.ToNPIdentifier());
   return true;
 }
 
 bool
 PluginScriptableObjectParent::AnswerInvoke(const PluginIdentifier& aId,
-                                           const InfallibleTArray<Variant>& aArgs,
+                                           InfallibleTArray<Variant>&& aArgs,
                                            Variant* aResult,
                                            bool* aSuccess)
 {
   if (!mObject) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return true;
@@ -868,17 +868,17 @@ PluginScriptableObjectParent::AnswerInvo
   }
 
   *aResult = convertedResult;
   *aSuccess = true;
   return true;
 }
 
 bool
-PluginScriptableObjectParent::AnswerInvokeDefault(const InfallibleTArray<Variant>& aArgs,
+PluginScriptableObjectParent::AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
                                                   Variant* aResult,
                                                   bool* aSuccess)
 {
   if (!mObject) {
     NS_WARNING("Calling AnswerInvoke with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return true;
@@ -1188,17 +1188,17 @@ PluginScriptableObjectParent::AnswerEnum
   }
 
   npn->memfree(ids);
   *aSuccess = true;
   return true;
 }
 
 bool
-PluginScriptableObjectParent::AnswerConstruct(const InfallibleTArray<Variant>& aArgs,
+PluginScriptableObjectParent::AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
                                               Variant* aResult,
                                               bool* aSuccess)
 {
   if (!mObject) {
     NS_WARNING("Calling AnswerConstruct with an invalidated object!");
     *aResult = void_t();
     *aSuccess = false;
     return true;
--- a/dom/plugins/ipc/PluginScriptableObjectParent.h
+++ b/dom/plugins/ipc/PluginScriptableObjectParent.h
@@ -49,22 +49,22 @@ public:
   ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
   virtual bool
   AnswerHasMethod(const PluginIdentifier& aId,
                   bool* aHasMethod) MOZ_OVERRIDE;
 
   virtual bool
   AnswerInvoke(const PluginIdentifier& aId,
-               const InfallibleTArray<Variant>& aArgs,
+               InfallibleTArray<Variant>&& aArgs,
                Variant* aResult,
                bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
-  AnswerInvokeDefault(const InfallibleTArray<Variant>& aArgs,
+  AnswerInvokeDefault(InfallibleTArray<Variant>&& aArgs,
                       Variant* aResult,
                       bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   AnswerHasProperty(const PluginIdentifier& aId,
                     bool* aHasProperty) MOZ_OVERRIDE;
 
   virtual bool
@@ -81,17 +81,17 @@ public:
   AnswerRemoveProperty(const PluginIdentifier& aId,
                        bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   AnswerEnumerate(InfallibleTArray<PluginIdentifier>* aProperties,
                   bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
-  AnswerConstruct(const InfallibleTArray<Variant>& aArgs,
+  AnswerConstruct(InfallibleTArray<Variant>&& aArgs,
                   Variant* aResult,
                   bool* aSuccess) MOZ_OVERRIDE;
 
   virtual bool
   AnswerNPN_Evaluate(const nsCString& aScript,
                      Variant* aResult,
                      bool* aSuccess) MOZ_OVERRIDE;
 
--- a/dom/plugins/ipc/PluginWidgetParent.cpp
+++ b/dom/plugins/ipc/PluginWidgetParent.cpp
@@ -212,17 +212,17 @@ PluginWidgetParent::RecvMove(const doubl
   offset.y = abs(offset.y);
   offset += nsIntPoint(ceil(aX), ceil(aY));
   mWidget->Move(offset.x, offset.y);
 
   return true;
 }
 
 bool
-PluginWidgetParent::RecvSetWindowClipRegion(const nsTArray<nsIntRect>& Regions,
+PluginWidgetParent::RecvSetWindowClipRegion(InfallibleTArray<nsIntRect>&& Regions,
                                             const bool& aIntersectWithExisting)
 {
   ENSURE_CHANNEL;
   PWLOG("PluginWidgetParent::RecvSetWindowClipRegion()\n");
   mWidget->SetWindowClipRegion(Regions, aIntersectWithExisting);
   return true;
 }
 
--- a/dom/plugins/ipc/PluginWidgetParent.h
+++ b/dom/plugins/ipc/PluginWidgetParent.h
@@ -31,18 +31,18 @@ public:
   virtual bool RecvCreate() MOZ_OVERRIDE;
   virtual bool RecvDestroy() MOZ_OVERRIDE;
   virtual bool RecvShow(const bool& aState) MOZ_OVERRIDE;
   virtual bool RecvSetFocus(const bool& aRaise) MOZ_OVERRIDE;
   virtual bool RecvInvalidate(const nsIntRect& aRect) MOZ_OVERRIDE;
   virtual bool RecvGetNativePluginPort(uintptr_t* value) MOZ_OVERRIDE;
   virtual bool RecvResize(const nsIntRect& aRect) MOZ_OVERRIDE;
   virtual bool RecvMove(const double& aX, const double& aY) MOZ_OVERRIDE;
-  virtual bool RecvSetWindowClipRegion(const nsTArray<nsIntRect>& Regions,
-                                        const bool& aIntersectWithExisting) MOZ_OVERRIDE;
+  virtual bool RecvSetWindowClipRegion(InfallibleTArray<nsIntRect>&& Regions,
+				       const bool& aIntersectWithExisting) MOZ_OVERRIDE;
 
 private:
   // The tab our connection is associated with.
   mozilla::dom::TabParent* GetTabParent();
   // The chrome side native widget.
   nsCOMPtr<nsIWidget> mWidget;
 #if defined(MOZ_WIDGET_GTK)
   UniquePtr<nsPluginNativeWindowGtk> mWrapper;
--- a/dom/storage/DOMStorageIPC.cpp
+++ b/dom/storage/DOMStorageIPC.cpp
@@ -209,17 +209,17 @@ bool
 DOMStorageDBChild::RecvObserve(const nsCString& aTopic,
                                const nsCString& aScopePrefix)
 {
   DOMStorageObserver::Self()->Notify(aTopic.get(), aScopePrefix);
   return true;
 }
 
 bool
-DOMStorageDBChild::RecvScopesHavingData(const InfallibleTArray<nsCString>& aScopes)
+DOMStorageDBChild::RecvScopesHavingData(nsTArray<nsCString>&& aScopes)
 {
   for (uint32_t i = 0; i < aScopes.Length(); ++i) {
     ScopesHavingData().PutEntry(aScopes[i]);
   }
 
   return true;
 }
 
--- a/dom/storage/DOMStorageIPC.h
+++ b/dom/storage/DOMStorageIPC.h
@@ -69,17 +69,17 @@ public:
 private:
   bool RecvObserve(const nsCString& aTopic,
                    const nsCString& aScopePrefix);
   bool RecvLoadItem(const nsCString& aScope,
                     const nsString& aKey,
                     const nsString& aValue);
   bool RecvLoadDone(const nsCString& aScope,
                     const nsresult& aRv);
-  bool RecvScopesHavingData(const InfallibleTArray<nsCString>& aScopes);
+  bool RecvScopesHavingData(nsTArray<nsCString>&& aScopes);
   bool RecvLoadUsage(const nsCString& aScope,
                      const int64_t& aUsage);
   bool RecvError(const nsresult& aRv);
 
   nsTHashtable<nsCStringHashKey>& ScopesHavingData();
 
   ThreadSafeAutoRefCnt mRefCnt;
   NS_DECL_OWNINGTHREAD
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -840,17 +840,17 @@ ImageBridgeChild::AllocPTextureChild(con
 
 bool
 ImageBridgeChild::DeallocPTextureChild(PTextureChild* actor)
 {
   return TextureClient::DestroyIPDLActor(actor);
 }
 
 bool
-ImageBridgeChild::RecvParentAsyncMessages(const InfallibleTArray<AsyncParentMessageData>& aMessages)
+ImageBridgeChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>&& aMessages)
 {
   for (AsyncParentMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncParentMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncParentMessageData::TOpDeliverFence: {
         const OpDeliverFence& op = message.get_OpDeliverFence();
         FenceHandle fence = op.fence();
--- a/gfx/layers/ipc/ImageBridgeChild.h
+++ b/gfx/layers/ipc/ImageBridgeChild.h
@@ -184,17 +184,17 @@ public:
 
   virtual PTextureChild*
   AllocPTextureChild(const SurfaceDescriptor& aSharedData, const TextureFlags& aFlags) MOZ_OVERRIDE;
 
   virtual bool
   DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE;
 
   virtual bool
-  RecvParentAsyncMessages(const InfallibleTArray<AsyncParentMessageData>& aMessages) MOZ_OVERRIDE;
+  RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>&& aMessages) MOZ_OVERRIDE;
 
   TemporaryRef<ImageClient> CreateImageClient(CompositableType aType);
   TemporaryRef<ImageClient> CreateImageClientNow(CompositableType aType);
 
   static void DispatchReleaseImageClient(ImageClient* aClient);
   static void DispatchReleaseTextureClient(TextureClient* aClient);
   static void DispatchImageClientUpdate(ImageClient* aClient, ImageContainer* aContainer);
 
--- a/gfx/layers/ipc/ImageBridgeParent.cpp
+++ b/gfx/layers/ipc/ImageBridgeParent.cpp
@@ -106,17 +106,17 @@ public:
   {
     mImageBridge->SendPendingAsyncMessges();
   }
 private:
   ImageBridgeParent* mImageBridge;
 };
 
 bool
-ImageBridgeParent::RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply)
+ImageBridgeParent::RecvUpdate(EditArray&& aEdits, EditReplyArray* aReply)
 {
   AutoImageBridgeParentAsyncMessageSender autoAsyncMessageSender(this);
 
   // If we don't actually have a compositor, then don't bother
   // creating any textures.
   if (Compositor::GetBackend() == LayersBackend::LAYERS_NONE) {
     return true;
   }
@@ -139,20 +139,20 @@ ImageBridgeParent::RecvUpdate(const Edit
     // other's buffer contents.
     LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
   }
 
   return true;
 }
 
 bool
-ImageBridgeParent::RecvUpdateNoSwap(const EditArray& aEdits)
+ImageBridgeParent::RecvUpdateNoSwap(EditArray&& aEdits)
 {
   InfallibleTArray<EditReply> noReplies;
-  bool success = RecvUpdate(aEdits, &noReplies);
+  bool success = RecvUpdate(Move(aEdits), &noReplies);
   NS_ABORT_IF_FALSE(noReplies.Length() == 0, "RecvUpdateNoSwap requires a sync Update to carry Edits");
   return success;
 }
 
 static void
 ConnectImageBridgeInParentProcess(ImageBridgeParent* aBridge,
                                   Transport* aTransport,
                                   base::ProcessHandle aOtherProcess)
@@ -263,17 +263,17 @@ ImageBridgeParent::SendFenceHandle(Async
 
 void
 ImageBridgeParent::SendAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessage)
 {
   mozilla::unused << SendParentAsyncMessages(aMessage);
 }
 
 bool
-ImageBridgeParent::RecvChildAsyncMessages(const InfallibleTArray<AsyncChildMessageData>& aMessages)
+ImageBridgeParent::RecvChildAsyncMessages(InfallibleTArray<AsyncChildMessageData>&& aMessages)
 {
   for (AsyncChildMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncChildMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncChildMessageData::TOpDeliverFenceFromChild: {
         const OpDeliverFenceFromChild& op = message.get_OpDeliverFenceFromChild();
 #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
--- a/gfx/layers/ipc/ImageBridgeParent.h
+++ b/gfx/layers/ipc/ImageBridgeParent.h
@@ -66,31 +66,31 @@ public:
   virtual void SendAsyncMessage(const InfallibleTArray<AsyncParentMessageData>& aMessage) MOZ_OVERRIDE;
 
   virtual base::ProcessId GetChildProcessId() MOZ_OVERRIDE
   {
     return mChildProcessId;
   }
 
   // PImageBridge
-  virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply) MOZ_OVERRIDE;
-  virtual bool RecvUpdateNoSwap(const EditArray& aEdits) MOZ_OVERRIDE;
+  virtual bool RecvUpdate(EditArray&& aEdits, EditReplyArray* aReply) MOZ_OVERRIDE;
+  virtual bool RecvUpdateNoSwap(EditArray&& aEdits) MOZ_OVERRIDE;
 
   virtual bool IsAsync() const MOZ_OVERRIDE { return true; }
 
   PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo,
                                                 uint64_t*) MOZ_OVERRIDE;
   bool DeallocPCompositableParent(PCompositableParent* aActor) MOZ_OVERRIDE;
 
   virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
                                               const TextureFlags& aFlags) MOZ_OVERRIDE;
   virtual bool DeallocPTextureParent(PTextureParent* actor) MOZ_OVERRIDE;
 
   virtual bool
-  RecvChildAsyncMessages(const InfallibleTArray<AsyncChildMessageData>& aMessages) MOZ_OVERRIDE;
+  RecvChildAsyncMessages(InfallibleTArray<AsyncChildMessageData>&& aMessages) MOZ_OVERRIDE;
 
   // Shutdown step 1
   virtual bool RecvWillStop() MOZ_OVERRIDE;
   // Shutdown step 2
   virtual bool RecvStop() MOZ_OVERRIDE;
 
   virtual MessageLoop* GetMessageLoop() const MOZ_OVERRIDE;
 
--- a/gfx/layers/ipc/LayerTransactionChild.cpp
+++ b/gfx/layers/ipc/LayerTransactionChild.cpp
@@ -70,17 +70,17 @@ LayerTransactionChild::AllocPCompositabl
 
 bool
 LayerTransactionChild::DeallocPCompositableChild(PCompositableChild* actor)
 {
   return CompositableClient::DestroyIPDLActor(actor);
 }
 
 bool
-LayerTransactionChild::RecvParentAsyncMessages(const InfallibleTArray<AsyncParentMessageData>& aMessages)
+LayerTransactionChild::RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>&& aMessages)
 {
   for (AsyncParentMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncParentMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncParentMessageData::TOpDeliverFence: {
         const OpDeliverFence& op = message.get_OpDeliverFence();
         FenceHandle fence = op.fence();
--- a/gfx/layers/ipc/LayerTransactionChild.h
+++ b/gfx/layers/ipc/LayerTransactionChild.h
@@ -65,17 +65,17 @@ protected:
   virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
   virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
 
   virtual PTextureChild* AllocPTextureChild(const SurfaceDescriptor& aSharedData,
                                             const TextureFlags& aFlags) MOZ_OVERRIDE;
   virtual bool DeallocPTextureChild(PTextureChild* actor) MOZ_OVERRIDE;
 
   virtual bool
-  RecvParentAsyncMessages(const InfallibleTArray<AsyncParentMessageData>& aMessages) MOZ_OVERRIDE;
+  RecvParentAsyncMessages(InfallibleTArray<AsyncParentMessageData>&& aMessages) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   void AddIPDLReference() {
     MOZ_ASSERT(mIPCOpen == false);
     mIPCOpen = true;
     AddRef();
   }
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -185,26 +185,26 @@ LayerTransactionParent::Destroy()
 
 LayersBackend
 LayerTransactionParent::GetCompositorBackendType() const
 {
   return mLayerManager->GetBackendType();
 }
 
 bool
-LayerTransactionParent::RecvUpdateNoSwap(const InfallibleTArray<Edit>& cset,
+LayerTransactionParent::RecvUpdateNoSwap(InfallibleTArray<Edit>&& cset,
                                          const uint64_t& aTransactionId,
                                          const TargetConfig& targetConfig,
                                          const bool& isFirstPaint,
                                          const bool& scheduleComposite,
                                          const uint32_t& paintSequenceNumber,
                                          const bool& isRepeatTransaction,
                                          const mozilla::TimeStamp& aTransactionStart)
 {
-  return RecvUpdate(cset, aTransactionId, targetConfig, isFirstPaint,
+  return RecvUpdate(Move(cset), aTransactionId, targetConfig, isFirstPaint,
       scheduleComposite, paintSequenceNumber, isRepeatTransaction,
       aTransactionStart, nullptr);
 }
 
 class MOZ_STACK_CLASS AutoLayerTransactionParentAsyncMessageSender
 {
 public:
   explicit AutoLayerTransactionParentAsyncMessageSender(LayerTransactionParent* aLayerTransaction)
@@ -215,17 +215,17 @@ public:
     mLayerTransaction->SendPendingAsyncMessges();
     ImageBridgeParent::SendPendingAsyncMessges(mLayerTransaction->GetChildProcessId());
   }
 private:
   LayerTransactionParent* mLayerTransaction;
 };
 
 bool
-LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
+LayerTransactionParent::RecvUpdate(InfallibleTArray<Edit>&& cset,
                                    const uint64_t& aTransactionId,
                                    const TargetConfig& targetConfig,
                                    const bool& isFirstPaint,
                                    const bool& scheduleComposite,
                                    const uint32_t& paintSequenceNumber,
                                    const bool& isRepeatTransaction,
                                    const mozilla::TimeStamp& aTransactionStart,
                                    InfallibleTArray<EditReply>* reply)
@@ -873,17 +873,17 @@ LayerTransactionParent::AllocPTexturePar
 
 bool
 LayerTransactionParent::DeallocPTextureParent(PTextureParent* actor)
 {
   return TextureHost::DestroyIPDLActor(actor);
 }
 
 bool
-LayerTransactionParent::RecvChildAsyncMessages(const InfallibleTArray<AsyncChildMessageData>& aMessages)
+LayerTransactionParent::RecvChildAsyncMessages(InfallibleTArray<AsyncChildMessageData>&& aMessages)
 {
   AutoLayerTransactionParentAsyncMessageSender autoAsyncMessageSender(this);
 
   for (AsyncChildMessageArray::index_type i = 0; i < aMessages.Length(); ++i) {
     const AsyncChildMessageData& message = aMessages[i];
 
     switch (message.type()) {
       case AsyncChildMessageData::TOpDeliverFenceFromChild: {
--- a/gfx/layers/ipc/LayerTransactionParent.h
+++ b/gfx/layers/ipc/LayerTransactionParent.h
@@ -98,27 +98,27 @@ public:
   virtual base::ProcessId GetChildProcessId() MOZ_OVERRIDE
   {
     return mChildProcessId;
   }
 
 protected:
   virtual bool RecvShutdown() MOZ_OVERRIDE;
 
-  virtual bool RecvUpdate(const EditArray& cset,
+  virtual bool RecvUpdate(EditArray&& cset,
                           const uint64_t& aTransactionId,
                           const TargetConfig& targetConfig,
                           const bool& isFirstPaint,
                           const bool& scheduleComposite,
                           const uint32_t& paintSequenceNumber,
                           const bool& isRepeatTransaction,
                           const mozilla::TimeStamp& aTransactionStart,
                           EditReplyArray* reply) MOZ_OVERRIDE;
 
-  virtual bool RecvUpdateNoSwap(const EditArray& cset,
+  virtual bool RecvUpdateNoSwap(EditArray&& cset,
                                 const uint64_t& aTransactionId,
                                 const TargetConfig& targetConfig,
                                 const bool& isFirstPaint,
                                 const bool& scheduleComposite,
                                 const uint32_t& paintSequenceNumber,
                                 const bool& isRepeatTransaction,
                                 const mozilla::TimeStamp& aTransactionStart) MOZ_OVERRIDE;
 
@@ -142,17 +142,17 @@ protected:
   virtual PCompositableParent* AllocPCompositableParent(const TextureInfo& aInfo) MOZ_OVERRIDE;
   virtual bool DeallocPCompositableParent(PCompositableParent* actor) MOZ_OVERRIDE;
 
   virtual PTextureParent* AllocPTextureParent(const SurfaceDescriptor& aSharedData,
                                               const TextureFlags& aFlags) MOZ_OVERRIDE;
   virtual bool DeallocPTextureParent(PTextureParent* actor) MOZ_OVERRIDE;
 
   virtual bool
-  RecvChildAsyncMessages(const InfallibleTArray<AsyncChildMessageData>& aMessages) MOZ_OVERRIDE;
+  RecvChildAsyncMessages(InfallibleTArray<AsyncChildMessageData>&& aMessages) MOZ_OVERRIDE;
 
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   bool Attach(ShadowLayerParent* aLayerParent,
               CompositableHost* aCompositable,
               bool aIsAsyncVideo);
 
   void AddIPDLReference() {
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -497,31 +497,31 @@ public:
     hal::UnregisterSystemTimezoneChangeObserver(this);
     for (int32_t switchDevice = SWITCH_DEVICE_UNKNOWN + 1;
          switchDevice < NUM_SWITCH_DEVICE; ++switchDevice) {
       hal::UnregisterSwitchObserver(SwitchDevice(switchDevice), this);
     }
   }
 
   virtual bool
-  RecvVibrate(const InfallibleTArray<unsigned int>& pattern,
-              const InfallibleTArray<uint64_t> &id,
+  RecvVibrate(InfallibleTArray<unsigned int>&& pattern,
+              InfallibleTArray<uint64_t>&& id,
               PBrowserParent *browserParent) MOZ_OVERRIDE
   {
     // We give all content vibration permission.
     TabParent *tabParent = static_cast<TabParent*>(browserParent);
     nsCOMPtr<nsIDOMWindow> window =
       do_QueryInterface(tabParent->GetBrowserDOMWindow());
     WindowIdentifier newID(id, window);
     hal::Vibrate(pattern, newID);
     return true;
   }
 
   virtual bool
-  RecvCancelVibrate(const InfallibleTArray<uint64_t> &id,
+  RecvCancelVibrate(InfallibleTArray<uint64_t> &&id,
                     PBrowserParent *browserParent) MOZ_OVERRIDE
   {
     TabParent *tabParent = static_cast<TabParent*>(browserParent);
     nsCOMPtr<nsIDOMWindow> window =
       do_QueryInterface(tabParent->GetBrowserDOMWindow());
     WindowIdentifier newID(id, window);
     hal::CancelVibrate(newID);
     return true;
--- a/ipc/glue/ProcessUtils_linux.cpp
+++ b/ipc/glue/ProcessUtils_linux.cpp
@@ -425,19 +425,19 @@ class ProcLoaderChild : public PProcLoad
 {
   pid_t mPeerPid;
 
 public:
   ProcLoaderChild(pid_t aPeerPid) : mPeerPid(aPeerPid) {}
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
-  virtual bool RecvLoad(const InfallibleTArray<nsCString>& aArgv,
-                        const InfallibleTArray<nsCString>& aEnv,
-                        const InfallibleTArray<FDRemap>& aFdsremap,
+  virtual bool RecvLoad(InfallibleTArray<nsCString>&& aArgv,
+                        InfallibleTArray<nsCString>&& aEnv,
+                        InfallibleTArray<FDRemap>&& aFdsremap,
                         const uint32_t& aPrivs,
                         const int32_t& aCookie);
 
   virtual void OnChannelError();
 };
 
 void
 ProcLoaderChild::ActorDestroy(ActorDestroyReason aWhy)
@@ -448,19 +448,19 @@ static void
 _ProcLoaderChildDestroy(ProcLoaderChild *aChild)
 {
   aChild->Close();
   delete aChild;
   MessageLoop::current()->Quit();
 }
 
 bool
-ProcLoaderChild::RecvLoad(const InfallibleTArray<nsCString>& aArgv,
-                          const InfallibleTArray<nsCString>& aEnv,
-                          const InfallibleTArray<FDRemap>& aFdsRemap,
+ProcLoaderChild::RecvLoad(InfallibleTArray<nsCString>&& aArgv,
+                          InfallibleTArray<nsCString>&& aEnv,
+                          InfallibleTArray<FDRemap>&& aFdsRemap,
                           const uint32_t& aPrivs,
                           const int32_t& aCookie) {
   if (!sProcLoaderServing) {
     return true;
   }
   sProcLoaderServing = false;
 
   MOZ_ASSERT(sProcLoaderDispatchedTask == nullptr);
--- a/ipc/ipdl/ipdl/cxx/ast.py
+++ b/ipc/ipdl/ipdl/cxx/ast.py
@@ -658,16 +658,20 @@ class ExprCall(Node):
         assert hasattr(func, 'accept')
         assert isinstance(args, list)
         for arg in args:  assert arg and not isinstance(arg, str)
 
         Node.__init__(self)
         self.func = func
         self.args = args
 
+class ExprMove(ExprCall):
+    def __init__(self, arg):
+        ExprCall.__init__(self, ExprVar("mozilla::Move"), args=[arg])
+
 class ExprNew(Node):
     # XXX taking some poetic license ...
     def __init__(self, ctype, args=[ ], newargs=None):
         assert not (ctype.const or ctype.ref)
 
         Node.__init__(self)
         self.ctype = ctype
         self.args = args
--- a/ipc/ipdl/ipdl/cxx/cgen.py
+++ b/ipc/ipdl/ipdl/cxx/cgen.py
@@ -42,17 +42,17 @@ class CxxCodeGen(CodePrinter, Visitor):
             self.write('>')
 
         ts = ''
         if t.ptr:            ts += '*'
         elif t.ptrconst:     ts += '* const'
         elif t.ptrptr:       ts += '**'
         elif t.ptrconstptr:  ts += '* const*'
 
-        if t.ref:  ts += '&'
+        ts += '&' * t.ref
 
         self.write(ts)
 
     def visitTypeEnum(self, te):
         self.write('enum')
         if te.name:
             self.write(' '+ te.name)
         self.println(' {')
@@ -352,16 +352,19 @@ class CxxCodeGen(CodePrinter, Visitor):
         ea.rhs.accept(self)
 
     def visitExprCall(self, ec):
         ec.func.accept(self)
         self.write('(')
         self.writeExprList(ec.args)
         self.write(')')
 
+    def visitExprMove(self, em):
+        self.visitExprCall(em)
+
     def visitExprNew(self, en):
         self.write('new ')
         if en.newargs is not None:
             self.write('(')
             self.writeExprList(en.newargs)
             self.write(') ')
         en.ctype.accept(self)
         if en.args is not None:
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -543,16 +543,23 @@ def _cxxConstRefType(ipdltype, side):
         return t
     if ipdltype.isIPDL() and ipdltype.isShmem():
         t.ref = 1
         return t
     t.const = 1
     t.ref = 1
     return t
 
+def _cxxMoveRefType(ipdltype, side):
+    t = _cxxBareType(ipdltype, side)
+    if ipdltype.isIPDL() and (ipdltype.isArray() or ipdltype.isShmem()):
+        t.ref = 2
+        return t
+    return _cxxConstRefType(ipdltype, side)
+
 def _cxxPtrToType(ipdltype, side):
     t = _cxxBareType(ipdltype, side)
     if ipdltype.isIPDL() and ipdltype.isActor():
         t.ptr = 0
         t.ptrptr = 1
         return t
     t.ptr = 1
     return t
@@ -597,28 +604,38 @@ info needed by later passes, along with 
         """Return this decl's C++ type as a 'reference' type, which is not
 necessarily a C++ reference."""
         return _cxxRefType(self.ipdltype, side)
 
     def constRefType(self, side):
         """Return this decl's C++ type as a const, 'reference' type."""
         return _cxxConstRefType(self.ipdltype, side)
 
+    def rvalueRefType(self, side):
+        """Return this decl's C++ type as an r-value 'reference' type."""
+        return _cxxMoveRefType(self.ipdltype, side)
+
     def ptrToType(self, side):
         return _cxxPtrToType(self.ipdltype, side)
 
     def constPtrToType(self, side):
         return _cxxConstPtrToType(self.ipdltype, side)
 
     def inType(self, side):
         """Return this decl's C++ Type with inparam semantics."""
         if self.ipdltype.isIPDL() and self.ipdltype.isActor():
             return self.bareType(side)
         return self.constRefType(side)
 
+    def moveType(self, side):
+        """Return this decl's C++ Type with move semantics."""
+        if self.ipdltype.isIPDL() and self.ipdltype.isActor():
+            return self.bareType(side)
+        return self.rvalueRefType(side);
+
     def outType(self, side):
         """Return this decl's C++ Type with outparam semantics."""
         t = self.bareType(side)
         if self.ipdltype.isIPDL() and self.ipdltype.isActor():
             t.ptr = 0;  t.ptrptr = 1
             return t
         t.ptr = 1
         return t
@@ -934,16 +951,18 @@ class MessageDecl(ipdl.ast.MessageDecl):
     def makeCxxParams(self, paramsems='in', returnsems='out',
                       side=None, implicit=1):
         """Return a list of C++ decls per the spec'd configuration.
 |params| and |returns| is the C++ semantics of those: 'in', 'out', or None."""
 
         def makeDecl(d, sems):
             if sems is 'in':
                 return Decl(d.inType(side), d.name)
+            elif sems is 'move':
+                return Decl(d.moveType(side), d.name)
             elif sems is 'out':
                 return Decl(d.outType(side), d.name)
             else: assert 0
 
         cxxparams = [ ]
         if paramsems is not None:
             cxxparams.extend([ makeDecl(d, paramsems) for d in self.params ])
 
@@ -957,17 +976,17 @@ class MessageDecl(ipdl.ast.MessageDecl):
 
     def makeCxxArgs(self, params=1, retsems='out', retcallsems='out',
                     implicit=1):
         assert not implicit or params     # implicit => params
         assert not retcallsems or retsems # retcallsems => returnsems
         cxxargs = [ ]
 
         if params:
-            cxxargs.extend([ p.var() for p in self.params ])
+            cxxargs.extend([ ExprMove(p.var()) for p in self.params ])
 
         for ret in self.returns:
             if retsems is 'in':
                 if retcallsems is 'in':
                     cxxargs.append(ret.var())
                 elif retcallsems is 'out':
                     cxxargs.append(ExprAddrOf(ret.var()))
                 else: assert 0
@@ -2804,17 +2823,17 @@ class _GenerateProtocolActorCode(ipdl.as
         for md in p.messageDecls:
             isctor, isdtor = md.decl.type.isCtor(), md.decl.type.isDtor()
 
             if self.receivesMessage(md):
                 # generate Recv/Answer* interface
                 implicit = (not isdtor)
                 recvDecl = MethodDecl(
                     md.recvMethod().name,
-                    params=md.makeCxxParams(paramsems='in', returnsems='out',
+                    params=md.makeCxxParams(paramsems='move', returnsems='out',
                                             side=self.side, implicit=implicit),
                     ret=Type.BOOL, virtual=1)
 
                 if isctor or isdtor:
                     defaultRecv = MethodDefn(recvDecl)
                     defaultRecv.addstmt(StmtReturn.TRUE)
                     self.cls.addstmt(defaultRecv)
                 else:
--- a/js/ipc/JavaScriptBase.h
+++ b/js/ipc/JavaScriptBase.h
@@ -79,20 +79,20 @@ class JavaScriptBase : public WrapperOwn
                    const JSVariant &value, ReturnStatus *rs, JSVariant *result) {
         return Answer::RecvSet(ObjectId::deserialize(objId), receiverVar, id, strict, value, rs, result);
     }
 
     bool RecvIsExtensible(const uint64_t &objId, ReturnStatus *rs,
                             bool *result) {
         return Answer::RecvIsExtensible(ObjectId::deserialize(objId), rs, result);
     }
-    bool RecvCallOrConstruct(const uint64_t &objId, const nsTArray<JSParam> &argv,
-                               const bool &construct, ReturnStatus *rs, JSVariant *result,
-                               nsTArray<JSParam> *outparams) {
-        return Answer::RecvCallOrConstruct(ObjectId::deserialize(objId), argv, construct, rs, result, outparams);
+    bool RecvCallOrConstruct(const uint64_t &objId, InfallibleTArray<JSParam> &&argv,
+                             const bool &construct, ReturnStatus *rs, JSVariant *result,
+                             nsTArray<JSParam> *outparams) {
+        return Answer::RecvCallOrConstruct(ObjectId::deserialize(objId), Move(argv), construct, rs, result, outparams);
     }
     bool RecvHasInstance(const uint64_t &objId, const JSVariant &v, ReturnStatus *rs, bool *bp) {
         return Answer::RecvHasInstance(ObjectId::deserialize(objId), v, rs, bp);
     }
     bool RecvObjectClassIs(const uint64_t &objId, const uint32_t &classValue,
                              bool *result) {
         return Answer::RecvObjectClassIs(ObjectId::deserialize(objId), classValue, result);
     }
--- a/js/ipc/WrapperAnswer.cpp
+++ b/js/ipc/WrapperAnswer.cpp
@@ -382,17 +382,17 @@ WrapperAnswer::RecvIsExtensible(const Ob
         return fail(cx, rs);
 
     *result = !!extensible;
     return ok(rs);
 }
 
 bool
 WrapperAnswer::RecvCallOrConstruct(const ObjectId &objId,
-                                   const nsTArray<JSParam> &argv,
+                                   InfallibleTArray<JSParam> &&argv,
                                    const bool &construct,
                                    ReturnStatus *rs,
                                    JSVariant *result,
                                    nsTArray<JSParam> *outparams)
 {
     AutoEntryScript aes(xpc::NativeGlobal(scopeForTargetObjects()));
     JSContext *cx = aes.cx();
 
--- a/js/ipc/WrapperAnswer.h
+++ b/js/ipc/WrapperAnswer.h
@@ -41,17 +41,17 @@ class WrapperAnswer : public virtual Jav
                  const JSIDVariant &id,
                  ReturnStatus *rs, JSVariant *result);
     bool RecvSet(const ObjectId &objId, const ObjectVariant &receiverVar,
                  const JSIDVariant &id, const bool &strict,
                  const JSVariant &value, ReturnStatus *rs, JSVariant *result);
 
     bool RecvIsExtensible(const ObjectId &objId, ReturnStatus *rs,
                           bool *result);
-    bool RecvCallOrConstruct(const ObjectId &objId, const nsTArray<JSParam> &argv,
+    bool RecvCallOrConstruct(const ObjectId &objId, InfallibleTArray<JSParam> &&argv,
                              const bool &construct, ReturnStatus *rs, JSVariant *result,
                              nsTArray<JSParam> *outparams);
     bool RecvHasInstance(const ObjectId &objId, const JSVariant &v, ReturnStatus *rs, bool *bp);
     bool RecvObjectClassIs(const ObjectId &objId, const uint32_t &classValue,
                            bool *result);
     bool RecvClassName(const ObjectId &objId, nsString *result);
     bool RecvRegExpToShared(const ObjectId &objId, ReturnStatus *rs, nsString *source, uint32_t *flags);
 
--- a/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
+++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.cpp
@@ -131,17 +131,17 @@ RtspControllerChild::StopPlayAndPauseTim
 // RtspControllerChild::PRtspControllerChild
 //-----------------------------------------------------------------------------
 bool
 RtspControllerChild::RecvOnMediaDataAvailable(
                        const uint8_t& index,
                        const nsCString& data,
                        const uint32_t& length,
                        const uint32_t& offset,
-                       const InfallibleTArray<RtspMetadataParam>& metaArray)
+                       InfallibleTArray<RtspMetadataParam>&& metaArray)
 {
   nsRefPtr<RtspMetaData> meta = new RtspMetaData();
   nsresult rv = meta->DeserializeRtspMetaData(metaArray);
   NS_ENSURE_SUCCESS(rv, true);
 
   if (mListener) {
     mListener->OnMediaDataAvailable(index, data, length, offset, meta.get());
   }
@@ -159,17 +159,17 @@ int
 RtspControllerChild::GetMetaDataLength()
 {
   return mMetaArray.Length();
 }
 
 bool
 RtspControllerChild::RecvOnConnected(
                        const uint8_t& index,
-                       const InfallibleTArray<RtspMetadataParam>& metaArray)
+                       InfallibleTArray<RtspMetadataParam>&& metaArray)
 {
   // Deserialize meta data.
   nsRefPtr<RtspMetaData> meta = new RtspMetaData();
   nsresult rv = meta->DeserializeRtspMetaData(metaArray);
   NS_ENSURE_SUCCESS(rv, true);
   meta->GetTotalTracks(&mTotalTracks);
   if (mTotalTracks <= 0) {
     LOG(("RtspControllerChild::RecvOnConnected invalid tracks %d", mTotalTracks));
--- a/netwerk/protocol/rtsp/controller/RtspControllerChild.h
+++ b/netwerk/protocol/rtsp/controller/RtspControllerChild.h
@@ -28,24 +28,24 @@ class RtspControllerChild : public nsISt
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISTREAMINGPROTOCOLCONTROLLER
   NS_DECL_NSISTREAMINGPROTOCOLLISTENER
 
   RtspControllerChild(nsIChannel *channel);
   ~RtspControllerChild();
 
   bool RecvOnConnected(const uint8_t& index,
-                       const InfallibleTArray<RtspMetadataParam>& meta);
+                       InfallibleTArray<RtspMetadataParam>&& meta);
 
   bool RecvOnMediaDataAvailable(
          const uint8_t& index,
          const nsCString& data,
          const uint32_t& length,
          const uint32_t& offset,
-         const InfallibleTArray<RtspMetadataParam>& meta);
+         InfallibleTArray<RtspMetadataParam>&& meta);
 
   bool RecvOnDisconnected(const uint8_t& index,
                           const nsresult& reason);
 
   bool RecvAsyncOpenFailed(const nsresult& reason);
   void AddIPDLReference();
   void ReleaseIPDLReference();
   void AddMetaData(already_AddRefed<nsIStreamingProtocolMetaData>&& meta);