Bug 1095506 - Clean up and rename kSerializableDownloadProperties. r=paolo

--HG--
extra : rebase_source : 4ac9627e2d8d108e416e50b8746825714ff4e52e
This commit is contained in:
Steven MacLeod 2014-11-10 20:58:20 -05:00
parent e24f6cb755
commit 6b845d6e74

View File

@ -929,8 +929,8 @@ this.Download.prototype = {
} }
// These are serialized unless they are false, null, or empty strings. // These are serialized unless they are false, null, or empty strings.
for (let property of kSerializableDownloadProperties) { for (let property of kPlainSerializableDownloadProperties) {
if (property != "startTime" && this[property]) { if (this[property]) {
serializable[property] = this[property]; serializable[property] = this[property];
} }
} }
@ -963,7 +963,7 @@ this.Download.prototype = {
/** /**
* Defines which properties of the Download object are serializable. * Defines which properties of the Download object are serializable.
*/ */
const kSerializableDownloadProperties = [ const kPlainSerializableDownloadProperties = [
"succeeded", "succeeded",
"canceled", "canceled",
"totalBytes", "totalBytes",
@ -1024,14 +1024,14 @@ Download.fromSerializable = function (aSerializable) {
download.error = DownloadError.fromSerializable(aSerializable.errorObj); download.error = DownloadError.fromSerializable(aSerializable.errorObj);
} }
for (let property of kSerializableDownloadProperties) { for (let property of kPlainSerializableDownloadProperties) {
if (property in aSerializable) { if (property in aSerializable) {
download[property] = aSerializable[property]; download[property] = aSerializable[property];
} }
} }
deserializeUnknownProperties(download, aSerializable, property => deserializeUnknownProperties(download, aSerializable, property =>
kSerializableDownloadProperties.indexOf(property) == -1 && kPlainSerializableDownloadProperties.indexOf(property) == -1 &&
property != "startTime" && property != "startTime" &&
property != "source" && property != "source" &&
property != "target" && property != "target" &&