Backed out changeset dafc51a29fb3 (bug 921918) Windows XP Debug Bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2013-11-25 08:55:05 +01:00
Родитель 17bbab2bd9
Коммит 052d87dd33
5 изменённых файлов: 201 добавлений и 198 удалений

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

@ -45,48 +45,6 @@ function defineLazyRegExp(obj, name, pattern) {
});
}
function RangedValue(name, min, max) {
this.name = name;
this.min = min;
this.max = max;
}
RangedValue.prototype = {
name: null,
min: null,
max: null,
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range [this.min, this.max].
*/
decode: function decode(data) {
let value = WSP.Octet.decode(data);
if ((value >= this.min) && (value <= this.max)) {
return value;
}
throw new WSP.CodeError(this.name + ": invalid value " + value);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param value
* An integer value within thr range [this.min, this.max].
*/
encode: function encode(data, value) {
if ((value < this.min) || (value > this.max)) {
throw new WSP.CodeError(this.name + ": invalid value " + value);
}
WSP.Octet.encode(data, value);
},
};
/**
* Internal decoding function for boolean values.
*
@ -379,21 +337,44 @@ this.MmsHeader = {
},
};
/**
* Cancel-status-value = Cancel Request Successfully received |
* Cancel Request corrupted
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.7
*/
this.CancelStatusValue = new RangedValue("Cancel-status-value", 128, 129);
/**
* Content-class-value = text | image-basic| image-rich | video-basic |
* video-rich | megapixel | content-basic | content-rich
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.9
*/
this.ContentClassValue = new RangedValue("Content-class-value", 128, 135);
this.ContentClassValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A integer value for each class.
*
* @throws CodeError if decoded value is not in range 128..135.
*/
decode: function decode(data) {
let value = WSP.Octet.decode(data);
if ((value >= 128) && (value <= 135)) {
return value;
}
throw new WSP.CodeError("Content-class-value: invalid class " + value);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param value
* A numeric content class value to be encoded.
*/
encode: function encode(data, value) {
if ((value < 128) || (value > 135)) {
throw new WSP.CodeError("Content-class-value: invalid class " + value);
}
WSP.Octet.encode(data, value);
},
};
/**
* When used in a PDU other than M-Mbox-Delete.conf and M-Delete.conf:
@ -988,7 +969,40 @@ this.MessageClassValue = {
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.30
*/
this.MessageTypeValue = new RangedValue("Message-type-value", 128, 151);
this.MessageTypeValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range 128..151.
*/
decode: function decode(data) {
let type = WSP.Octet.decode(data);
if ((type >= 128) && (type <= 151)) {
return type;
}
throw new WSP.CodeError("Message-type-value: invalid type " + type);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param type
* A numeric message type value to be encoded.
*
* @throws CodeError if the value is not in the range 128..151.
*/
encode: function encode(data, type) {
if ((type < 128) || (type > 151)) {
throw new WSP.CodeError("Message-type-value: invalid type " + type);
}
WSP.Octet.encode(data, type);
},
};
/**
* MM-flags-value = Value-length ( Add-token | Remove-token | Filter-token ) Encoded-string-value
@ -1061,7 +1075,40 @@ this.MmFlagsValue = {
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.33
*/
this.MmStateValue = new RangedValue("MM-state-value", 128, 132);
this.MmStateValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range 128..132.
*/
decode: function decode(data) {
let state = WSP.Octet.decode(data);
if ((state >= 128) && (state <= 132)) {
return state;
}
throw new WSP.CodeError("MM-state-value: invalid state " + state);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param state
* A numeric state value to be encoded.
*
* @throws CodeError if state is not in the range 128..132.
*/
encode: function encode(data, state) {
if ((state < 128) || (state > 132)) {
throw new WSP.CodeError("MM-state-value: invalid state " + state);
}
WSP.Octet.encode(data, state);
},
};
/**
* Priority-value = Low | Normal | High
@ -1071,14 +1118,38 @@ this.MmStateValue = new RangedValue("MM-state-value", 128, 132);
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.35
*/
this.PriorityValue = new RangedValue("Priority-value", 128, 130);
this.PriorityValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range 128..130.
*/
decode: function decode(data) {
let priority = WSP.Octet.decode(data);
if ((priority >= 128) && (priority <= 130)) {
return priority;
}
/**
* Read-status-value = Read | Deleted without being read
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.38
*/
this.ReadStatusValue = new RangedValue("Read-status-value", 128, 129);
throw new WSP.CodeError("Priority-value: invalid priority " + priority);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param priority
* A numeric priority value to be encoded.
*/
encode: function encode(data, priority) {
if ((priority < 128) || (priority > 130)) {
throw new WSP.CodeError("Priority-value: invalid priority " + priority);
}
WSP.Octet.encode(data, priority);
},
};
/**
* Recommended-Retrieval-Mode-value = Manual
@ -1108,7 +1179,38 @@ this.RecommendedRetrievalModeValue = {
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.43
*/
this.ReplyChargingValue = new RangedValue("Reply-charging-value", 128, 131);
this.ReplyChargingValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range 128..131.
*/
decode: function decode(data) {
let value = WSP.Octet.decode(data);
if ((value >= 128) && (value <= 131)) {
return value;
}
throw new WSP.CodeError("Reply-charging-value: invalid value " + value);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param value
* An integer value within thr range 128..131.
*/
encode: function encode(data, value) {
if ((value < 128) || (value > 131)) {
throw new WSP.CodeError("Reply-charging-value: invalid value " + value);
}
WSP.Octet.encode(data, value);
},
};
/**
* When used in a PDU other than M-Mbox-Delete.conf and M-Delete.conf:
@ -1197,13 +1299,6 @@ this.RetrieveStatusValue = {
},
};
/**
* Sender-visibility-value = Hide | Show
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.52
*/
this.SenderVisibilityValue = new RangedValue("Sender-visibility-value", 128, 129);
/**
* Status-value = Expired | Retrieved | Rejected | Deferred | Unrecognised |
* Indeterminate | Forwarded | Unreachable
@ -1218,7 +1313,40 @@ this.SenderVisibilityValue = new RangedValue("Sender-visibility-value", 128, 129
*
* @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.54
*/
this.StatusValue = new RangedValue("Status-value", 128, 135);
this.StatusValue = {
/**
* @param data
* A wrapped object containing raw PDU data.
*
* @return A decoded integer.
*
* @throws CodeError if decoded value is not in the range 128..135.
*/
decode: function decode(data) {
let status = WSP.Octet.decode(data);
if ((status >= 128) && (status <= 135)) {
return status;
}
throw new WSP.CodeError("Status-value: invalid status " + status);
},
/**
* @param data
* A wrapped object to store encoded raw data.
* @param value
* A numeric status value to be encoded.
*
* @throws CodeError if the value is not in the range 128..135.
*/
encode: function encode(data, value) {
if ((value < 128) || (value > 135)) {
throw new WSP.CodeError("Status-value: invalid status " + value);
}
WSP.Octet.encode(data, value);
},
};
this.PduHelper = {
/**
@ -1543,14 +1671,14 @@ const MMS_HEADER_FIELDS = (function () {
add("x-mms-report-allowed", 0x11, BooleanValue);
add("x-mms-response-status", 0x12, RetrieveStatusValue);
add("x-mms-response-text", 0x13, ResponseText);
add("x-mms-sender-visibility", 0x14, SenderVisibilityValue);
add("x-mms-sender-visibility", 0x14, BooleanValue);
add("x-mms-status", 0x15, StatusValue);
add("subject", 0x16, EncodedStringValue);
add("to", 0x17, Address);
add("x-mms-transaction-id", 0x18, WSP.TextString);
add("x-mms-retrieve-status", 0x19, RetrieveStatusValue);
add("x-mms-retrieve-text", 0x1A, EncodedStringValue);
add("x-mms-read-status", 0x1B, ReadStatusValue);
add("x-mms-read-status", 0x1B, BooleanValue);
add("x-mms-reply-charging", 0x1C, ReplyChargingValue);
add("x-mms-reply-charging-deadline", 0x1D, ExpiryValue);
add("x-mms-reply-charging-id", 0x1E, WSP.TextString);
@ -1586,7 +1714,7 @@ const MMS_HEADER_FIELDS = (function () {
add("x-mms-adaptation-allowed", 0x3C, BooleanValue);
add("x-mms-replace-id", 0x3D, WSP.TextString);
add("x-mms-cancel-id", 0x3E, WSP.TextString);
add("x-mms-cancel-status", 0x3F, CancelStatusValue);
add("x-mms-cancel-status", 0x3F, BooleanValue);
return names;
})();
@ -1631,7 +1759,6 @@ this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([
"Address",
"HeaderField",
"MmsHeader",
"CancelStatusValue",
"ContentClassValue",
"ContentLocationValue",
"ElementDescriptorValue",
@ -1646,12 +1773,10 @@ this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([
"MmFlagsValue",
"MmStateValue",
"PriorityValue",
"ReadStatusValue",
"RecommendedRetrievalModeValue",
"ReplyChargingValue",
"ResponseText",
"RetrieveStatusValue",
"SenderVisibilityValue",
"StatusValue",
// Parser

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

@ -1357,7 +1357,7 @@ function ReadRecTransaction(mmsConnection, messageID, toAddress) {
type: type}
headers["to"] = to;
headers["from"] = null;
headers["x-mms-read-status"] = MMS.MMS_PDU_READ_STATUS_READ;
headers["x-mms-read-status"] = true;
this.istream = MMS.PduHelper.compose(null, {headers: headers});
if (!this.istream) {

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

@ -1215,17 +1215,6 @@ MobileMessageDatabaseService.prototype = {
delete messageRecord.envelopeIdIndex;
}
// Convert some header fields that were originally decoded as BooleanValue
// to numeric enums.
for (let field of ["x-mms-cancel-status",
"x-mms-sender-visibility",
"x-mms-read-status"]) {
let value = messageRecord.headers[field];
if (value !== undefined) {
messageRecord.headers[field] = value ? 128 : 129;
}
}
cursor.update(messageRecord);
cursor.continue();
};

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

@ -95,21 +95,6 @@ this.MMS_PDU_STATUS_INDETERMINATE = 133;
this.MMS_PDU_STATUS_FORWARDED = 134;
this.MMS_PDU_STATUS_UNREACHABLE = 135;
// X-Mms-Cancel-Status values
// @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.7
this.MMS_PDU_CANCEL_STATUS_RECEIVED = 128;
this.MMS_PDU_CANCEL_STATUS_CORRUPTED = 129;
// X-Mms-Sender-Visibility
// @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.52
this.MMS_PDU_SENDER_VISIBILITY_HIDE = 128;
this.MMS_PDU_SENDER_VISIBILITY_SHOW = 129;
// X-Mms-Read-Status
// @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.38
this.MMS_PDU_READ_STATUS_READ = 128;
this.MMS_PDU_READ_STATUS_DELETED_UNREAD = 129;
// Maximum Values of MMS Parameters
// @see OMA-TS-MMS_CONF-V1_3-20110511-C 10.2.5
this.MMS_MAX_LENGTH_SUBJECT = 40;

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

@ -177,38 +177,6 @@ add_test(function test_MmsHeader_encode() {
run_next_test();
});
//
// Test target: CancelStatusValue
//
//// CancelStatusValue.decode ////
add_test(function test_CancelStatusValue_decode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_decode_test(MMS.CancelStatusValue, [i], i);
} else {
wsp_decode_test(MMS.CancelStatusValue, [i], null, "CodeError");
}
}
run_next_test();
});
//// CancelStatusValue.encode ////
add_test(function test_CancelStatusValue_encode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_encode_test(MMS.CancelStatusValue, i, [i]);
} else {
wsp_encode_test(MMS.CancelStatusValue, i, null, "CodeError");
}
}
run_next_test();
});
//
// Test target: ContentClassValue
//
@ -689,38 +657,6 @@ add_test(function test_PriorityValue_encode() {
run_next_test();
});
//
// Test target: ReadStatusValue
//
//// ReadStatusValue.decode ////
add_test(function test_ReadStatusValue_decode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_decode_test(MMS.ReadStatusValue, [i], i);
} else {
wsp_decode_test(MMS.ReadStatusValue, [i], null, "CodeError");
}
}
run_next_test();
});
//// ReadStatusValue.encode ////
add_test(function test_ReadStatusValue_encode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_encode_test(MMS.ReadStatusValue, i, [i]);
} else {
wsp_encode_test(MMS.ReadStatusValue, i, null, "CodeError");
}
}
run_next_test();
});
//
// Test target: RecommendedRetrievalModeValue
//
@ -829,38 +765,6 @@ add_test(function test_RetrieveStatusValue_decode() {
run_next_test();
});
//
// Test target: SenderVisibilityValue
//
//// SenderVisibilityValue.decode ////
add_test(function test_SenderVisibilityValue_decode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_decode_test(MMS.SenderVisibilityValue, [i], i);
} else {
wsp_decode_test(MMS.SenderVisibilityValue, [i], null, "CodeError");
}
}
run_next_test();
});
//// SenderVisibilityValue.encode ////
add_test(function test_SenderVisibilityValue_encode() {
for (let i = 0; i < 256; i++) {
if ((i >= 128) && (i <= 129)) {
wsp_encode_test(MMS.SenderVisibilityValue, i, [i]);
} else {
wsp_encode_test(MMS.SenderVisibilityValue, i, null, "CodeError");
}
}
run_next_test();
});
//
// Test target: StatusValue
//