From 150c6ab2120bde184750ad00177977161258cb51 Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Fri, 15 Sep 2017 18:28:54 +0200 Subject: [PATCH] Backed out changeset 15edfaab92f6 (bug 1397128) --- dom/cache/Manager.cpp | 8 ++++---- dom/cache/StreamList.cpp | 7 +++++-- dom/cache/StreamList.h | 7 +------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp index 0656b0689cf1..14534f9f3e25 100644 --- a/dom/cache/Manager.cpp +++ b/dom/cache/Manager.cpp @@ -548,7 +548,7 @@ public: if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } if (NS_WARN_IF(!stream)) { return NS_ERROR_FILE_NOT_FOUND; } - mStreamList->Add(mResponse.mBodyId, Move(stream)); + mStreamList->Add(mResponse.mBodyId, stream); return rv; } @@ -614,7 +614,7 @@ public: if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } if (NS_WARN_IF(!stream)) { return NS_ERROR_FILE_NOT_FOUND; } - mStreamList->Add(mSavedResponses[i].mBodyId, Move(stream)); + mStreamList->Add(mSavedResponses[i].mBodyId, stream); } return rv; @@ -1162,7 +1162,7 @@ public: if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } if (NS_WARN_IF(!stream)) { return NS_ERROR_FILE_NOT_FOUND; } - mStreamList->Add(mSavedRequests[i].mBodyId, Move(stream)); + mStreamList->Add(mSavedRequests[i].mBodyId, stream); } return rv; @@ -1226,7 +1226,7 @@ public: if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } if (NS_WARN_IF(!stream)) { return NS_ERROR_FILE_NOT_FOUND; } - mStreamList->Add(mSavedResponse.mBodyId, Move(stream)); + mStreamList->Add(mSavedResponse.mBodyId, stream); return rv; } diff --git a/dom/cache/StreamList.cpp b/dom/cache/StreamList.cpp index 0f1fbdcc6833..991563a3b5d5 100644 --- a/dom/cache/StreamList.cpp +++ b/dom/cache/StreamList.cpp @@ -70,12 +70,15 @@ StreamList::Activate(CacheId aCacheId) } void -StreamList::Add(const nsID& aId, nsCOMPtr&& aStream) +StreamList::Add(const nsID& aId, nsIInputStream* aStream) { // All streams should be added on IO thread before we set the stream // control on the owning IPC thread. MOZ_DIAGNOSTIC_ASSERT(!mStreamControl); - mList.AppendElement(Entry(aId, Move(aStream))); + MOZ_DIAGNOSTIC_ASSERT(aStream); + Entry* entry = mList.AppendElement(); + entry->mId = aId; + entry->mStream = aStream; } already_AddRefed diff --git a/dom/cache/StreamList.h b/dom/cache/StreamList.h index f6151b4a3829..9ff65d20bafd 100644 --- a/dom/cache/StreamList.h +++ b/dom/cache/StreamList.h @@ -31,7 +31,7 @@ public: void Activate(CacheId aCacheId); - void Add(const nsID& aId, nsCOMPtr&& aStream); + void Add(const nsID& aId, nsIInputStream* aStream); already_AddRefed Extract(const nsID& aId); void NoteClosed(const nsID& aId); @@ -47,11 +47,6 @@ private: ~StreamList(); struct Entry { - explicit Entry(const nsID& aId, nsCOMPtr&& aStream) - : mId(aId) - , mStream(Move(aStream)) - {} - nsID mId; nsCOMPtr mStream; };