Bug 1047483 - patch 5 - Remove 'name' in the FilePropertyBag dictionary, r=smaug

This commit is contained in:
Andrea Marchesini 2014-10-08 17:15:23 +01:00
parent a1e153cad8
commit b975bc974a
5 changed files with 22 additions and 16 deletions

View File

@ -55,6 +55,7 @@ class FileInfo;
}; };
struct BlobPropertyBag; struct BlobPropertyBag;
struct ChromeFilePropertyBag;
struct FilePropertyBag; struct FilePropertyBag;
class FileImpl; class FileImpl;
@ -176,21 +177,21 @@ public:
static already_AddRefed<File> static already_AddRefed<File>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,
File& aData, File& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv); ErrorResult& aRv);
// File constructor - ChromeOnly // File constructor - ChromeOnly
static already_AddRefed<File> static already_AddRefed<File>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,
const nsAString& aData, const nsAString& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv); ErrorResult& aRv);
// File constructor - ChromeOnly // File constructor - ChromeOnly
static already_AddRefed<File> static already_AddRefed<File>
Constructor(const GlobalObject& aGlobal, Constructor(const GlobalObject& aGlobal,
nsIFile* aData, nsIFile* aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv); ErrorResult& aRv);
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

View File

@ -631,7 +631,7 @@ File::Constructor(
/* static */ already_AddRefed<File> /* static */ already_AddRefed<File>
File::Constructor(const GlobalObject& aGlobal, File::Constructor(const GlobalObject& aGlobal,
File& aData, File& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv) ErrorResult& aRv)
{ {
if (!nsContentUtils::IsCallerChrome()) { if (!nsContentUtils::IsCallerChrome()) {
@ -653,7 +653,7 @@ File::Constructor(const GlobalObject& aGlobal,
/* static */ already_AddRefed<File> /* static */ already_AddRefed<File>
File::Constructor(const GlobalObject& aGlobal, File::Constructor(const GlobalObject& aGlobal,
nsIFile* aData, nsIFile* aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv) ErrorResult& aRv)
{ {
if (!nsContentUtils::IsCallerChrome()) { if (!nsContentUtils::IsCallerChrome()) {
@ -677,7 +677,7 @@ File::Constructor(const GlobalObject& aGlobal,
/* static */ already_AddRefed<File> /* static */ already_AddRefed<File>
File::Constructor(const GlobalObject& aGlobal, File::Constructor(const GlobalObject& aGlobal,
const nsAString& aData, const nsAString& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv) ErrorResult& aRv)
{ {
if (!nsContentUtils::IsCallerChrome()) { if (!nsContentUtils::IsCallerChrome()) {

View File

@ -236,7 +236,7 @@ MultipartFileImpl::GetMozFullPathInternal(nsAString& aFilename,
void void
MultipartFileImpl::InitializeChromeFile(File& aBlob, MultipartFileImpl::InitializeChromeFile(File& aBlob,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv) ErrorResult& aRv)
{ {
NS_ASSERTION(!mImmutable, "Something went wrong ..."); NS_ASSERTION(!mImmutable, "Something went wrong ...");
@ -268,7 +268,7 @@ MultipartFileImpl::InitializeChromeFile(File& aBlob,
void void
MultipartFileImpl::InitializeChromeFile(nsPIDOMWindow* aWindow, MultipartFileImpl::InitializeChromeFile(nsPIDOMWindow* aWindow,
nsIFile* aFile, nsIFile* aFile,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
bool aIsFromNsIFile, bool aIsFromNsIFile,
ErrorResult& aRv) ErrorResult& aRv)
{ {
@ -340,7 +340,7 @@ MultipartFileImpl::InitializeChromeFile(nsPIDOMWindow* aWindow,
void void
MultipartFileImpl::InitializeChromeFile(nsPIDOMWindow* aWindow, MultipartFileImpl::InitializeChromeFile(nsPIDOMWindow* aWindow,
const nsAString& aData, const nsAString& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv) ErrorResult& aRv)
{ {
nsCOMPtr<nsIFile> file; nsCOMPtr<nsIFile> file;

View File

@ -67,17 +67,17 @@ public:
ErrorResult& aRv); ErrorResult& aRv);
void InitializeChromeFile(File& aData, void InitializeChromeFile(File& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv); ErrorResult& aRv);
void InitializeChromeFile(nsPIDOMWindow* aWindow, void InitializeChromeFile(nsPIDOMWindow* aWindow,
const nsAString& aData, const nsAString& aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
ErrorResult& aRv); ErrorResult& aRv);
void InitializeChromeFile(nsPIDOMWindow* aWindow, void InitializeChromeFile(nsPIDOMWindow* aWindow,
nsIFile* aData, nsIFile* aData,
const FilePropertyBag& aBag, const ChromeFilePropertyBag& aBag,
bool aIsFromNsIFile, bool aIsFromNsIFile,
ErrorResult& aRv); ErrorResult& aRv);

View File

@ -10,9 +10,9 @@ interface nsIFile;
ScalarValueString fileName, optional FilePropertyBag options), ScalarValueString fileName, optional FilePropertyBag options),
// These constructors are just for chrome callers: // These constructors are just for chrome callers:
Constructor(Blob fileBits, optional FilePropertyBag options), Constructor(Blob fileBits, optional ChromeFilePropertyBag options),
Constructor(nsIFile fileBits, optional FilePropertyBag options), Constructor(nsIFile fileBits, optional ChromeFilePropertyBag options),
Constructor(ScalarValueString fileBits, optional FilePropertyBag options), Constructor(ScalarValueString fileBits, optional ChromeFilePropertyBag options),
Exposed=(Window,Worker)] Exposed=(Window,Worker)]
interface File : Blob { interface File : Blob {
@ -28,11 +28,16 @@ interface File : Blob {
dictionary FilePropertyBag { dictionary FilePropertyBag {
DOMString type = ""; DOMString type = "";
DOMString name = ""; // TODO: to remove!
long long lastModified; long long lastModified;
}; };
dictionary ChromeFilePropertyBag : FilePropertyBag {
DOMString name = "";
};
// Mozilla extensions // Mozilla extensions
partial interface File { partial interface File {