Bug 1312410 - Fetch API should use MutableBlobStorage to store big Blobs on disk, r=qdot

This commit is contained in:
Andrea Marchesini
2016-10-26 09:07:25 +02:00
parent 87820057a6
commit 0ce4aeb4a5
10 changed files with 383 additions and 73 deletions

View File

@@ -31,6 +31,7 @@
#include "mozilla/dom/File.h"
#include "mozilla/dom/workers/Workers.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "mozilla/Unused.h"
#include "Fetch.h"
@@ -54,6 +55,8 @@ FetchDriver::FetchDriver(InternalRequest* aRequest, nsIPrincipal* aPrincipal,
, mFetchCalled(false)
#endif
{
MOZ_ASSERT(aRequest);
MOZ_ASSERT(aPrincipal);
}
FetchDriver::~FetchDriver()
@@ -82,6 +85,14 @@ FetchDriver::Fetch(FetchDriverObserver* aObserver)
MOZ_RELEASE_ASSERT(!mRequest->IsSynchronous(),
"Synchronous fetch not supported");
UniquePtr<mozilla::ipc::PrincipalInfo> principalInfo(new mozilla::ipc::PrincipalInfo());
nsresult rv = PrincipalToPrincipalInfo(mPrincipal, principalInfo.get());
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
mRequest->SetPrincipalInfo(Move(principalInfo));
if (NS_FAILED(HttpFetch())) {
FailWithNetworkError();
}