Backed out changeset cbc2c8a24438 (bug 1211266) for asan failures in test_fileapi_slice.html

--HG--
extra : commitid : 6n3H2TgzlUO
This commit is contained in:
Wes Kocher 2015-11-24 13:25:18 -08:00
Родитель edb144c4e2
Коммит 176f927280
8 изменённых файлов: 59 добавлений и 106 удалений

Просмотреть файл

@ -558,15 +558,14 @@ EnsureBlobForBackgroundManager(BlobImpl* aBlobImpl,
PBackgroundChild* aManager = nullptr)
{
MOZ_ASSERT(aBlobImpl);
RefPtr<BlobImpl> blobImpl = aBlobImpl;
if (!aManager) {
aManager = BackgroundChild::GetForCurrentThread();
if (!aManager) {
return blobImpl.forget();
}
MOZ_ASSERT(aManager);
}
RefPtr<BlobImpl> blobImpl = aBlobImpl;
const nsTArray<RefPtr<BlobImpl>>* subBlobImpls =
aBlobImpl->GetSubBlobImpls();
@ -671,8 +670,6 @@ WriteBlob(JSStructuredCloneWriter* aWriter,
RefPtr<BlobImpl> blobImpl = EnsureBlobForBackgroundManager(aBlob->Impl());
MOZ_ASSERT(blobImpl);
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(blobImpl->SetMutable(false)));
// We store the position of the blobImpl in the array as index.
if (JS_WriteUint32Pair(aWriter, SCTAG_DOM_BLOB,
aHolder->BlobImpls().Length())) {

Просмотреть файл

@ -1753,12 +1753,6 @@ protected:
BlobChild* mActor;
nsCOMPtr<nsIEventTarget> mActorTarget;
// We use this pointer to keep a live a blobImpl coming from a different
// process until this one is fully created. We set it to null when
// SendCreatedFromKnownBlob() is received. This is used only with KnownBlob
// params in the CTOR of a IPC BlobImpl.
RefPtr<BlobImpl> mDifferentProcessBlobImpl;
RefPtr<BlobImpl> mSameProcessBlobImpl;
const bool mIsSlice;
@ -1766,20 +1760,31 @@ protected:
public:
// For File.
RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aRemoteBlobImpl,
const nsAString& aName,
const nsAString& aContentType,
uint64_t aLength,
int64_t aModDate,
BlobDirState aDirState,
bool aIsSameProcessBlob);
BlobDirState aDirState);
// For Blob.
RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aRemoteBlobImpl,
const nsAString& aContentType,
uint64_t aLength);
// For same-process blobs.
RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aSameProcessBlobImpl,
const nsAString& aName,
const nsAString& aContentType,
uint64_t aLength,
bool aIsSameProcessBlob);
int64_t aModDate,
BlobDirState aDirState);
// For same-process blobs.
RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aSameProcessBlobImpl,
const nsAString& aContentType,
uint64_t aLength);
// For mystery blobs.
explicit
@ -1852,13 +1857,6 @@ public:
virtual BlobParent*
GetBlobParent() override;
void
NullifyDifferentProcessBlobImpl()
{
MOZ_ASSERT(mDifferentProcessBlobImpl);
mDifferentProcessBlobImpl = nullptr;
}
protected:
// For SliceImpl.
RemoteBlobImpl(const nsAString& aContentType, uint64_t aLength);
@ -2088,43 +2086,56 @@ private:
BlobChild::
RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aRemoteBlobImpl,
const nsAString& aName,
const nsAString& aContentType,
uint64_t aLength,
int64_t aModDate,
BlobDirState aDirState,
bool aIsSameProcessBlob)
BlobDirState aDirState)
: BlobImplBase(aName, aContentType, aLength, aModDate, aDirState)
, mIsSlice(false)
{
if (aIsSameProcessBlob) {
MOZ_ASSERT(aRemoteBlobImpl);
mSameProcessBlobImpl = aRemoteBlobImpl;
MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
} else {
mDifferentProcessBlobImpl = aRemoteBlobImpl;
}
CommonInit(aActor);
}
BlobChild::
RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
const nsAString& aContentType,
uint64_t aLength)
: BlobImplBase(aContentType, aLength)
, mIsSlice(false)
{
CommonInit(aActor);
}
BlobChild::
RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aSameProcessBlobImpl,
const nsAString& aName,
const nsAString& aContentType,
uint64_t aLength,
int64_t aModDate,
BlobDirState aDirState)
: BlobImplBase(aName, aContentType, aLength, aModDate, aDirState)
, mSameProcessBlobImpl(aSameProcessBlobImpl)
, mIsSlice(false)
{
MOZ_ASSERT(aSameProcessBlobImpl);
MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
CommonInit(aActor);
}
BlobChild::
RemoteBlobImpl::RemoteBlobImpl(BlobChild* aActor,
BlobImpl* aRemoteBlobImpl,
BlobImpl* aSameProcessBlobImpl,
const nsAString& aContentType,
uint64_t aLength,
bool aIsSameProcessBlob)
uint64_t aLength)
: BlobImplBase(aContentType, aLength)
, mSameProcessBlobImpl(aSameProcessBlobImpl)
, mIsSlice(false)
{
if (aIsSameProcessBlob) {
MOZ_ASSERT(aRemoteBlobImpl);
mSameProcessBlobImpl = aRemoteBlobImpl;
MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
} else {
mDifferentProcessBlobImpl = aRemoteBlobImpl;
}
MOZ_ASSERT(aSameProcessBlobImpl);
MOZ_ASSERT(gProcessType == GeckoProcessType_Default);
CommonInit(aActor);
}
@ -3030,12 +3041,10 @@ BlobChild::CommonInit(BlobChild* aOther, BlobImpl* aBlobImpl)
int64_t modDate = otherImpl->GetLastModified(rv);
MOZ_ASSERT(!rv.Failed());
remoteBlob = new RemoteBlobImpl(this, otherImpl, name, contentType, length,
modDate, otherImpl->GetDirState(),
false /* SameProcessBlobImpl */);
remoteBlob = new RemoteBlobImpl(this, name, contentType, length, modDate,
otherImpl->GetDirState());
} else {
remoteBlob = new RemoteBlobImpl(this, otherImpl, contentType, length,
false /* SameProcessBlobImpl */);
remoteBlob = new RemoteBlobImpl(this, contentType, length);
}
CommonInit(aOther->ParentID(), remoteBlob);
@ -3064,8 +3073,7 @@ BlobChild::CommonInit(const ChildBlobConstructorParams& aParams)
const NormalBlobConstructorParams& params =
blobParams.get_NormalBlobConstructorParams();
remoteBlob =
new RemoteBlobImpl(this, nullptr, params.contentType(), params.length(),
false /* SameProcessBlobImpl */);
new RemoteBlobImpl(this, params.contentType(), params.length());
break;
}
@ -3073,13 +3081,11 @@ BlobChild::CommonInit(const ChildBlobConstructorParams& aParams)
const FileBlobConstructorParams& params =
blobParams.get_FileBlobConstructorParams();
remoteBlob = new RemoteBlobImpl(this,
nullptr,
params.name(),
params.contentType(),
params.length(),
params.modDate(),
BlobDirState(params.dirState()),
false /* SameProcessBlobImpl */);
BlobDirState(params.dirState()));
break;
}
@ -3114,11 +3120,9 @@ BlobChild::CommonInit(const ChildBlobConstructorParams& aParams)
contentType,
size,
lastModifiedDate,
blobImpl->GetDirState(),
true /* SameProcessBlobImpl */);
blobImpl->GetDirState());
} else {
remoteBlob = new RemoteBlobImpl(this, blobImpl, contentType, size,
true /* SameProcessBlobImpl */);
remoteBlob = new RemoteBlobImpl(this, blobImpl, contentType, size);
}
break;
@ -3588,14 +3592,6 @@ BlobChild::DeallocPBlobStreamChild(PBlobStreamChild* aActor)
return true;
}
bool
BlobChild::RecvCreatedFromKnownBlob()
{
// Releasing the other blob now that this blob is fully created.
mRemoteBlobImpl->NullifyDifferentProcessBlobImpl();
return true;
}
/*******************************************************************************
* BlobParent
******************************************************************************/

Просмотреть файл

@ -220,9 +220,6 @@ private:
virtual bool
DeallocPBlobStreamChild(PBlobStreamChild* aActor) override;
virtual bool
RecvCreatedFromKnownBlob() override;
};
// Only let ContentChild call BlobChild::Startup() and ensure that

Просмотреть файл

@ -3515,18 +3515,6 @@ ContentParent::DeallocPBlobParent(PBlobParent* aActor)
return nsIContentParent::DeallocPBlobParent(aActor);
}
bool
ContentParent::RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams)
{
const ParentBlobConstructorParams& params = aParams.get_ParentBlobConstructorParams();
if (params.blobParams().type() == AnyBlobConstructorParams::TKnownBlobConstructorParams) {
return aActor->SendCreatedFromKnownBlob();
}
return true;
}
mozilla::PRemoteSpellcheckEngineParent *
ContentParent::AllocPRemoteSpellcheckEngineParent()
{

Просмотреть файл

@ -648,9 +648,6 @@ private:
override;
virtual bool DeallocPBlobParent(PBlobParent* aActor) override;
virtual bool RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override;
virtual bool RecvGetRandomValues(const uint32_t& length,

Просмотреть файл

@ -45,11 +45,6 @@ parent:
// Use only for testing!
sync GetFilePath()
returns (nsString filePath);
child:
// This method must be called by the parent when the PBlobParent is fully
// created in order to release the known blob.
CreatedFromKnownBlob();
};
} // namespace dom

Просмотреть файл

@ -13,7 +13,6 @@
#include "mozilla/AppProcessChecker.h"
#include "mozilla/Assertions.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/DOMTypes.h"
#include "mozilla/dom/NuwaParent.h"
#include "mozilla/dom/PBlobParent.h"
#include "mozilla/dom/MessagePortParent.h"
@ -244,18 +243,6 @@ BackgroundParentImpl::DeallocPBlobParent(PBlobParent* aActor)
return true;
}
bool
BackgroundParentImpl::RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& aParams)
{
const ParentBlobConstructorParams& params = aParams;
if (params.blobParams().type() == AnyBlobConstructorParams::TKnownBlobConstructorParams) {
return aActor->SendCreatedFromKnownBlob();
}
return true;
}
PFileDescriptorSetParent*
BackgroundParentImpl::AllocPFileDescriptorSetParent(
const FileDescriptor& aFileDescriptor)

Просмотреть файл

@ -64,10 +64,6 @@ protected:
virtual bool
DeallocPBlobParent(PBlobParent* aActor) override;
virtual bool
RecvPBlobConstructor(PBlobParent* aActor,
const BlobConstructorParams& params) override;
virtual PFileDescriptorSetParent*
AllocPFileDescriptorSetParent(const FileDescriptor& aFileDescriptor)
override;