Bug 828870 - All shared blobs must be immutable. r=khuey.

This commit is contained in:
Ben Turner 2013-01-10 19:16:40 +01:00
parent 0be1b0b551
commit 72bed700f7
2 changed files with 16 additions and 0 deletions

View File

@ -34,6 +34,7 @@
#include "nsIMemoryReporter.h"
#include "nsIMemoryInfoDumper.h"
#include "nsIMutable.h"
#include "nsIObserverService.h"
#include "nsTObserverArray.h"
#include "nsIObserver.h"
@ -645,6 +646,13 @@ ContentChild::GetOrCreateActorForBlob(nsIDOMBlob* aBlob)
// a real interface or something.
nsDOMFileBase* blob = static_cast<nsDOMFileBase*>(aBlob);
// All blobs shared between processes must be immutable.
nsCOMPtr<nsIMutable> mutableBlob = do_QueryInterface(aBlob);
if (!mutableBlob || NS_FAILED(mutableBlob->SetMutable(false))) {
NS_WARNING("Failed to make blob immutable!");
return nullptr;
}
nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryInterface(aBlob);
if (remoteBlob) {
BlobChild* actor =

View File

@ -63,6 +63,7 @@
#include "nsIDOMWindow.h"
#include "nsIFilePicker.h"
#include "nsIMemoryReporter.h"
#include "nsIMutable.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsIRemoteBlob.h"
@ -1519,6 +1520,13 @@ ContentParent::GetOrCreateActorForBlob(nsIDOMBlob* aBlob)
// a real interface or something.
nsDOMFileBase* blob = static_cast<nsDOMFileBase*>(aBlob);
// All blobs shared between processes must be immutable.
nsCOMPtr<nsIMutable> mutableBlob = do_QueryInterface(aBlob);
if (!mutableBlob || NS_FAILED(mutableBlob->SetMutable(false))) {
NS_WARNING("Failed to make blob immutable!");
return nullptr;
}
nsCOMPtr<nsIRemoteBlob> remoteBlob = do_QueryInterface(aBlob);
if (remoteBlob) {
BlobParent* actor =