Backed out changeset 9be76aad30b1 (bug 1263991)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 07 Jun 2016 12:10:26 +0200
changeset 300879 29121ecd02eb3f83cafebb0de084326e87a43158
parent 300878 ff0afa409a09f242253afdf5828260983bd7055a
child 300880 53c297b5ceeeee404102e833fa1271582564b593
push id19599
push usercbook@mozilla.com
push dateWed, 08 Jun 2016 10:16:21 +0000
treeherderfx-team@81f4cc3f6f4c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1263991
milestone50.0a1
backs out9be76aad30b130121b6fde7c79adaa687061c058
Backed out changeset 9be76aad30b1 (bug 1263991)
dom/fetch/FetchTypes.ipdlh
dom/fetch/InternalResponse.cpp
dom/fetch/InternalResponse.h
dom/flyweb/FlyWebPublishedServer.cpp
dom/flyweb/PFlyWebPublishedServer.ipdl
--- a/dom/fetch/FetchTypes.ipdlh
+++ b/dom/fetch/FetchTypes.ipdlh
@@ -47,15 +47,13 @@ struct IPCInternalResponse
   ResponseType type;
   nsCString[] urlList;
   uint32_t status;
   nsCString statusText;
   HeadersEntry[] headers;
   HeadersGuardEnum headersGuard;
   IPCChannelInfo channelInfo;
   OptionalPrincipalInfo principalInfo;
-  OptionalIPCStream body;
-  int64_t bodySize;
 };
 
 
 } // namespace ipc
 } // namespace mozilla
--- a/dom/fetch/InternalResponse.cpp
+++ b/dom/fetch/InternalResponse.cpp
@@ -5,19 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "InternalResponse.h"
 
 #include "mozilla/Assertions.h"
 #include "mozilla/dom/InternalHeaders.h"
 #include "mozilla/dom/cache/CacheTypes.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
-#include "mozilla/ipc/IPCStreamUtils.h"
 #include "nsIURI.h"
 #include "nsStreamUtils.h"
+#include "mozilla/dom/FetchTypes.h"
 
 namespace mozilla {
 namespace dom {
 
 InternalResponse::InternalResponse(uint16_t aStatus, const nsACString& aStatusText)
   : mType(ResponseType::Default)
   , mStatus(aStatus)
   , mStatusText(aStatusText)
@@ -45,19 +45,16 @@ InternalResponse::FromIPC(const IPCInter
                                            aIPCResponse.headersGuard());
 
   response->InitChannelInfo(aIPCResponse.channelInfo());
   if (aIPCResponse.principalInfo().type() == mozilla::ipc::OptionalPrincipalInfo::TPrincipalInfo) {
     UniquePtr<mozilla::ipc::PrincipalInfo> info(new mozilla::ipc::PrincipalInfo(aIPCResponse.principalInfo().get_PrincipalInfo()));
     response->SetPrincipalInfo(Move(info));
   }
 
-  nsCOMPtr<nsIInputStream> stream = DeserializeIPCStream(aIPCResponse.body());
-  response->SetBody(stream, aIPCResponse.bodySize());
-
   switch (aIPCResponse.type())
   {
     case ResponseType::Basic:
       response = response->BasicResponse();
       break;
     case ResponseType::Cors:
       response = response->CORSResponse();
       break;
@@ -76,71 +73,34 @@ InternalResponse::FromIPC(const IPCInter
 
   return response.forget();
 }
 
 InternalResponse::~InternalResponse()
 {
 }
 
-template void
-InternalResponse::ToIPC<PContentParent>
-  (IPCInternalResponse* aIPCResponse,
-   PContentParent* aManager,
-   UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);
-template void
-InternalResponse::ToIPC<PContentChild>
-  (IPCInternalResponse* aIPCResponse,
-   PContentChild* aManager,
-   UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);
-template void
-InternalResponse::ToIPC<mozilla::ipc::PBackgroundParent>
-  (IPCInternalResponse* aIPCResponse,
-   mozilla::ipc::PBackgroundParent* aManager,
-   UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);
-template void
-InternalResponse::ToIPC<mozilla::ipc::PBackgroundChild>
-  (IPCInternalResponse* aIPCResponse,
-   mozilla::ipc::PBackgroundChild* aManager,
-   UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);
-
-template<typename M>
 void
-InternalResponse::ToIPC(IPCInternalResponse* aIPCResponse,
-                        M* aManager,
-                        UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream)
+InternalResponse::ToIPC(IPCInternalResponse* aIPCResponse)
 {
   MOZ_ASSERT(aIPCResponse);
   MOZ_ASSERT(!mURLList.IsEmpty());
   aIPCResponse->type() = mType;
   aIPCResponse->urlList() = mURLList;
   aIPCResponse->status() = GetUnfilteredStatus();
   aIPCResponse->statusText() = GetUnfilteredStatusText();
 
   mHeaders->ToIPC(aIPCResponse->headers(), aIPCResponse->headersGuard());
 
   aIPCResponse->channelInfo() = mChannelInfo.AsIPCChannelInfo();
   if (mPrincipalInfo) {
     aIPCResponse->principalInfo() = *mPrincipalInfo;
   } else {
     aIPCResponse->principalInfo() = void_t();
   }
-
-  nsCOMPtr<nsIInputStream> body;
-  int64_t bodySize;
-  GetUnfilteredBody(getter_AddRefs(body), &bodySize);
-
-  if (body) {
-    aAutoStream.reset(new mozilla::ipc::AutoIPCStream(aIPCResponse->body()));
-    aAutoStream->Serialize(body, aManager);
-  } else {
-    aIPCResponse->body() = void_t();
-  }
-
-  aIPCResponse->bodySize() = bodySize;
 }
 
 already_AddRefed<InternalResponse>
 InternalResponse::Clone()
 {
   RefPtr<InternalResponse> clone = CreateIncompleteCopy();
 
   clone->mHeaders = new InternalHeaders(*mHeaders);
--- a/dom/fetch/InternalResponse.h
+++ b/dom/fetch/InternalResponse.h
@@ -12,17 +12,16 @@
 
 #include "mozilla/dom/ResponseBinding.h"
 #include "mozilla/dom/ChannelInfo.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
 namespace ipc {
 class PrincipalInfo;
-class AutoIPCStream;
 } // namespace ipc
 
 namespace dom {
 
 class InternalHeaders;
 class IPCInternalResponse;
 
 class InternalResponse final
@@ -32,21 +31,17 @@ class InternalResponse final
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(InternalResponse)
 
   InternalResponse(uint16_t aStatus, const nsACString& aStatusText);
 
   static already_AddRefed<InternalResponse>
   FromIPC(const IPCInternalResponse& aIPCResponse);
 
-  template<typename M>
-  void
-  ToIPC(IPCInternalResponse* aIPCResponse,
-        M* aManager,
-        UniquePtr<mozilla::ipc::AutoIPCStream>& aAutoStream);
+  void ToIPC(IPCInternalResponse* aIPCResponse);
 
   already_AddRefed<InternalResponse> Clone();
 
   static already_AddRefed<InternalResponse>
   NetworkError()
   {
     RefPtr<InternalResponse> response = new InternalResponse(0, EmptyCString());
     ErrorResult result;
--- a/dom/flyweb/FlyWebPublishedServer.cpp
+++ b/dom/flyweb/FlyWebPublishedServer.cpp
@@ -7,17 +7,16 @@
 #include "mozilla/dom/FlyWebPublishedServer.h"
 #include "mozilla/dom/FlyWebPublishBinding.h"
 #include "mozilla/dom/FlyWebService.h"
 #include "mozilla/dom/Request.h"
 #include "mozilla/dom/FlyWebServerEvents.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/InternalResponse.h"
-#include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/unused.h"
 #include "nsGlobalWindow.h"
 
 namespace mozilla {
 namespace dom {
 
 static LazyLogModule gFlyWebPublishedServerLog("FlyWebPublishedServer");
@@ -296,22 +295,18 @@ FlyWebPublishedServerChild::OnFetchRespo
     return;
   }
 
   uint64_t id = mPendingRequests.Get(aRequest);
   MOZ_ASSERT(id);
   mPendingRequests.Remove(aRequest);
 
   IPCInternalResponse ipcResp;
-  UniquePtr<mozilla::ipc::AutoIPCStream> autoStream;
-  aResponse->ToIPC(&ipcResp, Manager(), autoStream);
+  aResponse->ToIPC(&ipcResp);
   Unused << SendFetchResponse(ipcResp, id);
-  if (autoStream) {
-    autoStream->TakeOptionalValue();
-  }
 }
 
 already_AddRefed<WebSocket>
 FlyWebPublishedServerChild::OnWebSocketAccept(InternalRequest* aConnectRequest,
                                               const Optional<nsAString>& aProtocol,
                                               ErrorResult& aRv)
 {
   // Send ipdl message to parent
--- a/dom/flyweb/PFlyWebPublishedServer.ipdl
+++ b/dom/flyweb/PFlyWebPublishedServer.ipdl
@@ -1,20 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set sw=2 ts=8 et ft=cpp : */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 include protocol PContent;
-include protocol PSendStream;
-include protocol PFileDescriptorSet;
 include FetchTypes;
-include ChannelInfo;
-include PBackgroundSharedTypes;
 
 namespace mozilla {
 namespace dom {
 
 async protocol PFlyWebPublishedServer
 {
   manager PContent;