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
Родитель 718acf667b
Коммит 3bc314ce36
2 изменённых файлов: 16 добавлений и 0 удалений

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

@ -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 =

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

@ -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 =