зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1231100 - Get rid of nsIDOMFileReader - patch 2, r=sicking
This commit is contained in:
Родитель
c2230f21f8
Коммит
32580a380e
|
@ -10,6 +10,7 @@ const Cu = Components.utils;
|
|||
const Ci = Components.interfaces;
|
||||
const Cc = Components.classes;
|
||||
|
||||
Cu.importGlobalProperties(['FileReader']);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm");
|
||||
|
|
|
@ -16,6 +16,8 @@ Cu.import("resource:///modules/MigrationUtils.jsm");
|
|||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/LoginHelper.jsm");
|
||||
|
||||
Cu.importGlobalProperties(['FileReader']);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||
"resource://gre/modules/PlacesUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
|
||||
|
|
|
@ -11,6 +11,7 @@ const {LongStringActor} = require("devtools/server/actors/string");
|
|||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const {getSystemInfo, getSetting} = require("devtools/shared/system");
|
||||
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
Cu.import("resource://gre/modules/PermissionsTable.jsm")
|
||||
|
||||
var DeviceActor = exports.DeviceActor = protocol.ActorClass({
|
||||
|
|
|
@ -11,6 +11,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/UserCustomizations.jsm");
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
|
||||
var promise = require("promise");
|
||||
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
|
|
@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/Promise.jsm");
|
|||
Cu.import("resource://gre/modules/Webapps.jsm");
|
||||
Cu.import("resource://gre/modules/MessageBroadcaster.jsm");
|
||||
|
||||
Cu.importGlobalProperties(['File']);
|
||||
Cu.importGlobalProperties(['File', 'FileReader']);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
|
||||
"resource://gre/modules/FileUtils.jsm");
|
||||
|
|
|
@ -52,7 +52,7 @@ if (!this.runTest) {
|
|||
enableExperimental();
|
||||
}
|
||||
|
||||
Cu.importGlobalProperties(["indexedDB", "Blob", "File"]);
|
||||
Cu.importGlobalProperties(["indexedDB", "Blob", "File", "FileReader"]);
|
||||
|
||||
do_test_pending();
|
||||
testGenerator.next();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.importGlobalProperties(['Blob']);
|
||||
Cu.importGlobalProperties(['Blob', 'FileReader']);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/PhoneNumberUtils.jsm");
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#ifdef MOZ_WEBRTC
|
||||
#include "mozilla/dom/RTCIdentityProviderRegistrar.h"
|
||||
#endif
|
||||
#include "mozilla/dom/FileReaderBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/TextDecoderBinding.h"
|
||||
#include "mozilla/dom/TextEncoderBinding.h"
|
||||
|
@ -892,6 +893,8 @@ xpc::GlobalProperties::Parse(JSContext* cx, JS::HandleObject obj)
|
|||
fetch = true;
|
||||
} else if (!strcmp(name.ptr(), "caches")) {
|
||||
caches = true;
|
||||
} else if (!strcmp(name.ptr(), "FileReader")) {
|
||||
fileReader = true;
|
||||
} else {
|
||||
JS_ReportError(cx, "Unknown property name: %s", name.ptr());
|
||||
return false;
|
||||
|
@ -960,6 +963,9 @@ xpc::GlobalProperties::Define(JSContext* cx, JS::HandleObject obj)
|
|||
if (caches && !dom::cache::CacheStorage::DefineCaches(cx, obj))
|
||||
return false;
|
||||
|
||||
if (fileReader && !dom::FileReaderBinding::GetConstructorObject(cx, obj))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -3424,6 +3424,7 @@ struct GlobalProperties {
|
|||
bool rtcIdentityProvider : 1;
|
||||
bool fetch : 1;
|
||||
bool caches : 1;
|
||||
bool fileReader: 1;
|
||||
};
|
||||
|
||||
// Infallible.
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function run_test() {
|
||||
var Cu = Components.utils;
|
||||
var sb = new Cu.Sandbox('http://www.example.com',
|
||||
{ wantGlobalProperties: ["FileReader"] });
|
||||
sb.do_check_true = do_check_true;
|
||||
Cu.evalInSandbox('do_check_true((new FileReader()) instanceof FileReader);',
|
||||
sb);
|
||||
Cu.importGlobalProperties(["FileReader"]);
|
||||
do_check_true((new FileReader()) instanceof FileReader);
|
||||
}
|
|
@ -109,6 +109,7 @@ skip-if = os == "android" # native test components aren't available on Android
|
|||
[test_textDecoder.js]
|
||||
[test_url.js]
|
||||
[test_URLSearchParams.js]
|
||||
[test_fileReader.js]
|
||||
[test_crypto.js]
|
||||
[test_css.js]
|
||||
[test_rtcIdentityProvider.js]
|
||||
|
|
|
@ -33,6 +33,8 @@ Cu.import("resource://gre/modules/PromiseWorker.jsm", this);
|
|||
Cu.import("resource://gre/modules/Promise.jsm", this);
|
||||
Cu.import("resource://gre/modules/osfile.jsm", this);
|
||||
|
||||
Cu.importGlobalProperties(['FileReader']);
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
|
||||
"resource://gre/modules/NetUtil.jsm");
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.importGlobalProperties(['Blob']);
|
||||
Cu.importGlobalProperties(['Blob', 'FileReader']);
|
||||
|
||||
Cu.import("resource://gre/modules/PageThumbUtils.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -61,7 +61,7 @@ const Cc = Components.classes;
|
|||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.importGlobalProperties(['File']);
|
||||
Cu.importGlobalProperties(['File', 'FileReader']);
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
|
||||
|
|
Загрузка…
Ссылка в новой задаче