mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 948287 - [Download API] Accessing startTime attribute at download start fires NS_ERROR_UNEXPECTED in emulator. r=fabrice
This commit is contained in:
parent
f81682cfee
commit
75c36c29d1
@ -198,6 +198,7 @@ function createDOMDownloadObject(aWindow, aDownload) {
|
||||
|
||||
function DOMDownloadImpl() {
|
||||
debug("DOMDownloadImpl constructor ");
|
||||
|
||||
this.wrappedJSObject = this;
|
||||
this.totalBytes = 0;
|
||||
this.currentBytes = 0;
|
||||
@ -205,9 +206,11 @@ function DOMDownloadImpl() {
|
||||
this.path = null;
|
||||
this.state = "stopped";
|
||||
this.contentType = null;
|
||||
this.startTime = Date.now();
|
||||
this.error = null;
|
||||
|
||||
/* fields that require getters/setters */
|
||||
this._startTime = new Date();
|
||||
|
||||
/* private fields */
|
||||
this.id = null;
|
||||
}
|
||||
@ -244,6 +247,19 @@ DOMDownloadImpl.prototype = {
|
||||
return this.__DOM_IMPL__.getEventHandler("onstatechange");
|
||||
},
|
||||
|
||||
get startTime() {
|
||||
return this._startTime;
|
||||
},
|
||||
|
||||
set startTime(aStartTime) {
|
||||
if (aStartTime instanceof Date) {
|
||||
this._startTime = aStartTime;
|
||||
}
|
||||
else {
|
||||
this._startTime = new Date(aStartTime);
|
||||
}
|
||||
},
|
||||
|
||||
_init: function(aWindow, aDownload) {
|
||||
this._window = aWindow;
|
||||
this.id = aDownload.id;
|
||||
|
Loading…
Reference in New Issue
Block a user