зеркало из https://github.com/mozilla/gecko-dev.git
Merge last PGO-green changeset of mozilla-inbound to mozilla-central
This commit is contained in:
Коммит
44a8beda6f
|
@ -86,9 +86,9 @@ nsChromeRegistry::LogMessageWithContext(nsIURI* aURL, uint32_t aLineNumber, uint
|
||||||
if (aURL)
|
if (aURL)
|
||||||
aURL->GetSpec(spec);
|
aURL->GetSpec(spec);
|
||||||
|
|
||||||
rv = error->Init(NS_ConvertUTF8toUTF16(formatted).get(),
|
rv = error->Init(NS_ConvertUTF8toUTF16(formatted),
|
||||||
NS_ConvertUTF8toUTF16(spec).get(),
|
NS_ConvertUTF8toUTF16(spec),
|
||||||
nullptr,
|
EmptyString(),
|
||||||
aLineNumber, 0, flags, "chrome registration");
|
aLineNumber, 0, flags, "chrome registration");
|
||||||
PR_smprintf_free(formatted);
|
PR_smprintf_free(formatted);
|
||||||
|
|
||||||
|
|
|
@ -3260,9 +3260,9 @@ nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
|
||||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = errorObject->InitWithWindowID(errorText.get(),
|
rv = errorObject->InitWithWindowID(errorText,
|
||||||
NS_ConvertUTF8toUTF16(spec).get(), // file name
|
NS_ConvertUTF8toUTF16(spec), // file name
|
||||||
aSourceLine.get(),
|
aSourceLine,
|
||||||
aLineNumber, aColumnNumber,
|
aLineNumber, aColumnNumber,
|
||||||
aErrorFlags, aCategory,
|
aErrorFlags, aCategory,
|
||||||
innerWindowID);
|
innerWindowID);
|
||||||
|
|
|
@ -1093,9 +1093,9 @@ nsEventSource::PrintErrorOnConsole(const char *aBundleURI,
|
||||||
}
|
}
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = errObj->InitWithWindowID(message.get(),
|
rv = errObj->InitWithWindowID(message,
|
||||||
mScriptFile.get(),
|
mScriptFile,
|
||||||
nullptr,
|
EmptyString(),
|
||||||
mScriptLine, 0,
|
mScriptLine, 0,
|
||||||
nsIScriptError::errorFlag,
|
nsIScriptError::errorFlag,
|
||||||
"Event Source", mInnerWindowID);
|
"Event Source", mInnerWindowID);
|
||||||
|
|
|
@ -683,10 +683,10 @@ ContentScriptErrorReporter(JSContext* aCx,
|
||||||
|
|
||||||
if (aReport) {
|
if (aReport) {
|
||||||
if (aReport->ucmessage) {
|
if (aReport->ucmessage) {
|
||||||
message.Assign(reinterpret_cast<const PRUnichar*>(aReport->ucmessage));
|
message.Assign(static_cast<const PRUnichar*>(aReport->ucmessage));
|
||||||
}
|
}
|
||||||
filename.AssignWithConversion(aReport->filename);
|
filename.AssignWithConversion(aReport->filename);
|
||||||
line.Assign(reinterpret_cast<const PRUnichar*>(aReport->uclinebuf));
|
line.Assign(static_cast<const PRUnichar*>(aReport->uclinebuf));
|
||||||
lineNumber = aReport->lineno;
|
lineNumber = aReport->lineno;
|
||||||
columnNumber = aReport->uctokenptr - aReport->uclinebuf;
|
columnNumber = aReport->uctokenptr - aReport->uclinebuf;
|
||||||
flags = aReport->flags;
|
flags = aReport->flags;
|
||||||
|
@ -700,7 +700,7 @@ ContentScriptErrorReporter(JSContext* aCx,
|
||||||
message.AssignWithConversion(aMessage);
|
message.AssignWithConversion(aMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = scriptError->Init(message.get(), filename.get(), line.get(),
|
rv = scriptError->Init(message, filename, line,
|
||||||
lineNumber, columnNumber, flags,
|
lineNumber, columnNumber, flags,
|
||||||
"Message manager content script");
|
"Message manager content script");
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
@ -731,7 +731,7 @@ ContentScriptErrorReporter(JSContext* aCx,
|
||||||
error.AppendInt(lineNumber, 10);
|
error.AppendInt(lineNumber, 10);
|
||||||
error.Append(": ");
|
error.Append(": ");
|
||||||
if (aReport->ucmessage) {
|
if (aReport->ucmessage) {
|
||||||
AppendUTF16toUTF8(reinterpret_cast<const PRUnichar*>(aReport->ucmessage),
|
AppendUTF16toUTF8(static_cast<const PRUnichar*>(aReport->ucmessage),
|
||||||
error);
|
error);
|
||||||
} else {
|
} else {
|
||||||
error.Append(aMessage);
|
error.Append(aMessage);
|
||||||
|
|
|
@ -130,9 +130,9 @@ nsWebSocket::PrintErrorOnConsole(const char *aBundleURI,
|
||||||
}
|
}
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = errorObject->InitWithWindowID(message.get(),
|
rv = errorObject->InitWithWindowID(message,
|
||||||
NS_ConvertUTF8toUTF16(mScriptFile).get(),
|
NS_ConvertUTF8toUTF16(mScriptFile),
|
||||||
nullptr, mScriptLine, 0,
|
EmptyString(), mScriptLine, 0,
|
||||||
nsIScriptError::errorFlag, "Web Socket",
|
nsIScriptError::errorFlag, "Web Socket",
|
||||||
mInnerWindowID);
|
mInnerWindowID);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
|
@ -218,10 +218,15 @@ XBL_ProtoErrorReporter(JSContext *cx,
|
||||||
if (errorObject && consoleService) {
|
if (errorObject && consoleService) {
|
||||||
uint32_t column = report->uctokenptr - report->uclinebuf;
|
uint32_t column = report->uctokenptr - report->uclinebuf;
|
||||||
|
|
||||||
|
const PRUnichar* ucmessage =
|
||||||
|
static_cast<const PRUnichar*>(report->ucmessage);
|
||||||
|
const PRUnichar* uclinebuf =
|
||||||
|
static_cast<const PRUnichar*>(report->uclinebuf);
|
||||||
|
|
||||||
errorObject->Init
|
errorObject->Init
|
||||||
(reinterpret_cast<const PRUnichar*>(report->ucmessage),
|
(ucmessage ? nsDependentString(ucmessage) : EmptyString(),
|
||||||
NS_ConvertUTF8toUTF16(report->filename).get(),
|
NS_ConvertUTF8toUTF16(report->filename),
|
||||||
reinterpret_cast<const PRUnichar*>(report->uclinebuf),
|
uclinebuf ? nsDependentString(uclinebuf) : EmptyString(),
|
||||||
report->lineno, column, report->flags,
|
report->lineno, column, report->flags,
|
||||||
"xbl javascript"
|
"xbl javascript"
|
||||||
);
|
);
|
||||||
|
|
|
@ -368,8 +368,10 @@ nsXMLDocument::Load(const nsAString& aUrl, bool *aReturn)
|
||||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = errorObject->InitWithWindowID(error.get(), NS_ConvertUTF8toUTF16(spec).get(),
|
rv = errorObject->InitWithWindowID(error,
|
||||||
nullptr, 0, 0, nsIScriptError::warningFlag,
|
NS_ConvertUTF8toUTF16(spec),
|
||||||
|
EmptyString(),
|
||||||
|
0, 0, nsIScriptError::warningFlag,
|
||||||
"DOM",
|
"DOM",
|
||||||
callingDoc ?
|
callingDoc ?
|
||||||
callingDoc->InnerWindowID() :
|
callingDoc->InnerWindowID() :
|
||||||
|
|
|
@ -1953,9 +1953,9 @@ PrintWarningOnConsole(JSContext *cx, const char *stringBundleProperty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult rv = scriptError->InitWithWindowID(msg.get(),
|
nsresult rv = scriptError->InitWithWindowID(msg,
|
||||||
sourcefile.get(),
|
sourcefile,
|
||||||
EmptyString().get(),
|
EmptyString(),
|
||||||
lineno,
|
lineno,
|
||||||
0, // column for error is not available
|
0, // column for error is not available
|
||||||
nsIScriptError::warningFlag,
|
nsIScriptError::warningFlag,
|
||||||
|
@ -5986,9 +5986,9 @@ IDBConstantGetter(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMutableHan
|
||||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
||||||
NS_WARN_IF_FALSE(errorObject, "Failed to create error object");
|
NS_WARN_IF_FALSE(errorObject, "Failed to create error object");
|
||||||
if (errorObject) {
|
if (errorObject) {
|
||||||
nsresult rv = errorObject->InitWithWindowID(warnText.get(),
|
nsresult rv = errorObject->InitWithWindowID(warnText,
|
||||||
nullptr, // file name
|
EmptyString(), // file name
|
||||||
nullptr, // source line
|
EmptyString(), // source line
|
||||||
0, 0, // Line/col number
|
0, 0, // Line/col number
|
||||||
nsIScriptError::warningFlag,
|
nsIScriptError::warningFlag,
|
||||||
"DOM Core", windowID);
|
"DOM Core", windowID);
|
||||||
|
|
|
@ -401,8 +401,8 @@ public:
|
||||||
? "chrome javascript"
|
? "chrome javascript"
|
||||||
: "content javascript";
|
: "content javascript";
|
||||||
|
|
||||||
rv = errorObject->InitWithWindowID(mErrorMsg.get(), mFileName.get(),
|
rv = errorObject->InitWithWindowID(mErrorMsg, mFileName,
|
||||||
mSourceLine.get(),
|
mSourceLine,
|
||||||
mLineNr, mColumn, mFlags,
|
mLineNr, mColumn, mFlags,
|
||||||
category, mInnerWindowID);
|
category, mInnerWindowID);
|
||||||
|
|
||||||
|
|
|
@ -364,6 +364,10 @@ IndexedDatabaseManager::FireWindowOnError(nsPIDOMWindow* aOwner,
|
||||||
|
|
||||||
nsScriptErrorEvent event(true, NS_LOAD_ERROR);
|
nsScriptErrorEvent event(true, NS_LOAD_ERROR);
|
||||||
request->FillScriptErrorEvent(&event);
|
request->FillScriptErrorEvent(&event);
|
||||||
|
NS_ABORT_IF_FALSE(event.fileName,
|
||||||
|
"FillScriptErrorEvent should give us a non-null string "
|
||||||
|
"for our error's fileName");
|
||||||
|
|
||||||
event.errorMsg = errorName.get();
|
event.errorMsg = errorName.get();
|
||||||
|
|
||||||
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(aOwner));
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(aOwner));
|
||||||
|
@ -385,9 +389,9 @@ IndexedDatabaseManager::FireWindowOnError(nsPIDOMWindow* aOwner,
|
||||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
if (NS_FAILED(scriptError->InitWithWindowID(event.errorMsg,
|
if (NS_FAILED(scriptError->InitWithWindowID(errorName,
|
||||||
event.fileName,
|
nsDependentString(event.fileName),
|
||||||
nullptr, event.lineNr,
|
EmptyString(), event.lineNr,
|
||||||
0, 0,
|
0, 0,
|
||||||
"IndexedDB",
|
"IndexedDB",
|
||||||
aOwner->WindowID()))) {
|
aOwner->WindowID()))) {
|
||||||
|
|
|
@ -1797,7 +1797,7 @@ ContentParent::RecvScriptError(const nsString& aMessage,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
nsCOMPtr<nsIScriptError> msg(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
|
nsCOMPtr<nsIScriptError> msg(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
|
||||||
nsresult rv = msg->Init(aMessage.get(), aSourceName.get(), aSourceLine.get(),
|
nsresult rv = msg->Init(aMessage, aSourceName, aSourceLine,
|
||||||
aLineNumber, aColNumber, aFlags, aCategory.get());
|
aLineNumber, aColNumber, aFlags, aCategory.get());
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -5,3 +5,4 @@ qemu = true
|
||||||
|
|
||||||
[test_between_emulators.py]
|
[test_between_emulators.py]
|
||||||
[test_incoming.js]
|
[test_incoming.js]
|
||||||
|
[test_outgoing.js]
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
MARIONETTE_TIMEOUT = 20000;
|
||||||
|
|
||||||
|
SpecialPowers.setBoolPref("dom.sms.enabled", true);
|
||||||
|
SpecialPowers.addPermission("sms", true, document);
|
||||||
|
SpecialPowers.addPermission("mobileconnection", true, document);
|
||||||
|
|
||||||
|
let sms = window.navigator.mozSms;
|
||||||
|
let receiver = "5555552368";
|
||||||
|
let body = "Hello SMS world!";
|
||||||
|
|
||||||
|
function checkSentMessage(message, sentDate) {
|
||||||
|
ok(message, "message is valid");
|
||||||
|
ok(message instanceof MozSmsMessage,
|
||||||
|
"message is instanceof " + message.constructor);
|
||||||
|
|
||||||
|
ok(message.id, "message.id is valid");
|
||||||
|
is(message.delivery, "sent", "message.delivery");
|
||||||
|
is(message.sender, null, "message.sender");
|
||||||
|
is(message.receiver, receiver, "message.receiver");
|
||||||
|
is(message.body, body, "message.body");
|
||||||
|
ok(message.timestamp instanceof Date,
|
||||||
|
"message.timestamp is instanceof " + message.timestamp.constructor);
|
||||||
|
// SMSC timestamp is in seconds.
|
||||||
|
ok(Math.floor(message.timestamp.getTime() / 1000) >= Math.floor(sentDate / 1000),
|
||||||
|
"sent timestamp is valid");
|
||||||
|
is(message.read, true, "message.read");
|
||||||
|
}
|
||||||
|
|
||||||
|
let sentMessages = null;
|
||||||
|
function checkSameSentMessage(message, now) {
|
||||||
|
checkSentMessage(message, now);
|
||||||
|
|
||||||
|
let sentMessage = sentMessages[message.id];
|
||||||
|
if (!sentMessage) {
|
||||||
|
sentMessages[message.id] = message;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The two message instance should be exactly the same, but since we had
|
||||||
|
// already checked most attributes of them, we only compare their
|
||||||
|
// timestamps here.
|
||||||
|
ok(sentMessage.timestamp.getTime() == message.timestamp.getTime(),
|
||||||
|
"the messages got from onsent event and request result must be the same");
|
||||||
|
}
|
||||||
|
|
||||||
|
function doSendMessageAndCheckSuccess(receivers, callback) {
|
||||||
|
sentMessages = [];
|
||||||
|
|
||||||
|
let now = Date.now();
|
||||||
|
let count;
|
||||||
|
|
||||||
|
function done() {
|
||||||
|
if (--count > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sms.removeEventListener("sent", onSmsSent);
|
||||||
|
setTimeout(callback, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function onSmsSent(event) {
|
||||||
|
log("SmsManager.onsent event received.");
|
||||||
|
|
||||||
|
ok(event instanceof MozSmsEvent,
|
||||||
|
"event is instanceof " + event.constructor);
|
||||||
|
// Event listener is removed in done().
|
||||||
|
|
||||||
|
checkSameSentMessage(event.message, now);
|
||||||
|
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onRequestSuccess(event) {
|
||||||
|
log("SmsRequest.onsuccess event received.");
|
||||||
|
|
||||||
|
ok(event.target instanceof MozSmsRequest,
|
||||||
|
"event.target is instanceof " + event.target.constructor);
|
||||||
|
event.target.removeEventListener("success", onRequestSuccess);
|
||||||
|
|
||||||
|
checkSameSentMessage(event.target.result, now);
|
||||||
|
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
|
||||||
|
sms.addEventListener("sent", onSmsSent);
|
||||||
|
|
||||||
|
let result = sms.send(receivers, body);
|
||||||
|
if (Array.isArray(receivers)) {
|
||||||
|
ok(Array.isArray(result),
|
||||||
|
"send() returns an array of requests if receivers is an array");
|
||||||
|
is(result.length, receivers.length, "returned array length");
|
||||||
|
|
||||||
|
// `receivers` is an array, so we have N request.onsuccess and N sms.onsent.
|
||||||
|
count = result.length * 2;
|
||||||
|
|
||||||
|
for (let i = 0; i < result.length; i++) {
|
||||||
|
let request = result[i];
|
||||||
|
ok(request instanceof MozSmsRequest,
|
||||||
|
"request is instanceof " + request.constructor);
|
||||||
|
request.addEventListener("success", onRequestSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// `receivers` is not an array, so we have one request.onsuccess and one
|
||||||
|
// sms.onsent.
|
||||||
|
count = 2;
|
||||||
|
|
||||||
|
let request = result;
|
||||||
|
ok(request instanceof MozSmsRequest,
|
||||||
|
"request is instanceof " + request.constructor);
|
||||||
|
request.addEventListener("success", onRequestSuccess);
|
||||||
|
}
|
||||||
|
|
||||||
|
function testSendMessage() {
|
||||||
|
log("Testing sending message to one receiver:");
|
||||||
|
doSendMessageAndCheckSuccess(receiver, testSendMessageToMultipleRecipients);
|
||||||
|
}
|
||||||
|
|
||||||
|
function testSendMessageToMultipleRecipients() {
|
||||||
|
log("Testing sending message to multiple receivers:");
|
||||||
|
// TODO: bug 788928 - add test cases for nsIDOMSmsManager.ondelivered event
|
||||||
|
doSendMessageAndCheckSuccess([receiver, receiver], cleanUp);
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanUp() {
|
||||||
|
SpecialPowers.removePermission("sms", document);
|
||||||
|
SpecialPowers.removePermission("mobileconnection", document);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
waitFor(testSendMessage, function () {
|
||||||
|
let connected = navigator.mozMobileConnection.voice.connected;
|
||||||
|
if (!connected) {
|
||||||
|
log("MobileConnection is not ready yet.");
|
||||||
|
}
|
||||||
|
return connected;
|
||||||
|
});
|
||||||
|
|
|
@ -34,6 +34,7 @@ const nsIRadioInterfaceLayer = Ci.nsIRadioInterfaceLayer;
|
||||||
|
|
||||||
const kNetworkInterfaceStateChangedTopic = "network-interface-state-changed";
|
const kNetworkInterfaceStateChangedTopic = "network-interface-state-changed";
|
||||||
const kSmsReceivedObserverTopic = "sms-received";
|
const kSmsReceivedObserverTopic = "sms-received";
|
||||||
|
const kSmsSentObserverTopic = "sms-sent";
|
||||||
const kSmsDeliveredObserverTopic = "sms-delivered";
|
const kSmsDeliveredObserverTopic = "sms-delivered";
|
||||||
const kMozSettingsChangedObserverTopic = "mozsettings-changed";
|
const kMozSettingsChangedObserverTopic = "mozsettings-changed";
|
||||||
const kSysMsgListenerReadyObserverTopic = "system-message-listener-ready";
|
const kSysMsgListenerReadyObserverTopic = "system-message-listener-ready";
|
||||||
|
@ -1018,6 +1019,8 @@ RadioInterfaceLayer.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
gSmsRequestManager.notifySmsSent(options.requestId, sms);
|
gSmsRequestManager.notifySmsSent(options.requestId, sms);
|
||||||
|
|
||||||
|
Services.obs.notifyObservers(options.sms, kSmsSentObserverTopic, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSmsDelivered: function handleSmsDelivered(message) {
|
handleSmsDelivered: function handleSmsDelivered(message) {
|
||||||
|
|
|
@ -2898,7 +2898,7 @@ let RIL = {
|
||||||
let messageStringLength = Buf.readUint32();
|
let messageStringLength = Buf.readUint32();
|
||||||
if (DEBUG) debug("Got new SMS, length " + messageStringLength);
|
if (DEBUG) debug("Got new SMS, length " + messageStringLength);
|
||||||
let message = GsmPDUHelper.readMessage();
|
let message = GsmPDUHelper.readMessage();
|
||||||
if (DEBUG) debug(message);
|
if (DEBUG) debug("Got new SMS: " + JSON.stringify(message));
|
||||||
|
|
||||||
// Read string delimiters. See Buf.readString().
|
// Read string delimiters. See Buf.readString().
|
||||||
Buf.readStringDelimiter(length);
|
Buf.readStringDelimiter(length);
|
||||||
|
@ -2958,11 +2958,13 @@ let RIL = {
|
||||||
_processSmsStatusReport: function _processSmsStatusReport(length) {
|
_processSmsStatusReport: function _processSmsStatusReport(length) {
|
||||||
let message = this._processReceivedSms(length);
|
let message = this._processReceivedSms(length);
|
||||||
if (!message) {
|
if (!message) {
|
||||||
|
if (DEBUG) debug("invalid SMS-STATUS-REPORT");
|
||||||
return PDU_FCS_UNSPECIFIED;
|
return PDU_FCS_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
let options = this._pendingSentSmsMap[message.messageRef];
|
let options = this._pendingSentSmsMap[message.messageRef];
|
||||||
if (!options) {
|
if (!options) {
|
||||||
|
if (DEBUG) debug("no pending SMS-SUBMIT message");
|
||||||
return PDU_FCS_OK;
|
return PDU_FCS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2985,12 +2987,14 @@ let RIL = {
|
||||||
|
|
||||||
// Pending. Waiting for next status report.
|
// Pending. Waiting for next status report.
|
||||||
if ((status >>> 5) == 0x01) {
|
if ((status >>> 5) == 0x01) {
|
||||||
|
if (DEBUG) debug("SMS-STATUS-REPORT: delivery still pending");
|
||||||
return PDU_FCS_OK;
|
return PDU_FCS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete this._pendingSentSmsMap[message.messageRef];
|
delete this._pendingSentSmsMap[message.messageRef];
|
||||||
|
|
||||||
if ((status >>> 5) != 0x00) {
|
if ((status >>> 5) != 0x00) {
|
||||||
|
if (DEBUG) debug("SMS-STATUS-REPORT: delivery failed");
|
||||||
// It seems unlikely to get a result code for a failure to deliver.
|
// It seems unlikely to get a result code for a failure to deliver.
|
||||||
// Even if, we don't want to do anything with this.
|
// Even if, we don't want to do anything with this.
|
||||||
return PDU_FCS_OK;
|
return PDU_FCS_OK;
|
||||||
|
@ -3525,6 +3529,7 @@ RIL[REQUEST_SEND_SMS] = function REQUEST_SEND_SMS(length, options) {
|
||||||
options.errorCode = Buf.readUint32();
|
options.errorCode = Buf.readUint32();
|
||||||
|
|
||||||
if (options.requestStatusReport) {
|
if (options.requestStatusReport) {
|
||||||
|
if (DEBUG) debug("waiting SMS-STATUS-REPORT for messageRef " + options.messageRef);
|
||||||
this._pendingSentSmsMap[options.messageRef] = options;
|
this._pendingSentSmsMap[options.messageRef] = options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1073,9 +1073,9 @@ public:
|
||||||
NS_WARN_IF_FALSE(scriptError, "Failed to create script error!");
|
NS_WARN_IF_FALSE(scriptError, "Failed to create script error!");
|
||||||
|
|
||||||
if (scriptError) {
|
if (scriptError) {
|
||||||
if (NS_FAILED(scriptError->InitWithWindowID(aMessage.get(),
|
if (NS_FAILED(scriptError->InitWithWindowID(aMessage,
|
||||||
aFilename.get(),
|
aFilename,
|
||||||
aLine.get(), aLineNumber,
|
aLine, aLineNumber,
|
||||||
aColumnNumber, aFlags,
|
aColumnNumber, aFlags,
|
||||||
"Web Worker",
|
"Web Worker",
|
||||||
aInnerWindowId))) {
|
aInnerWindowId))) {
|
||||||
|
|
|
@ -106,9 +106,9 @@ Decoder::Finish()
|
||||||
NS_ConvertASCIItoUTF16(mImage.GetURIString()));
|
NS_ConvertASCIItoUTF16(mImage.GetURIString()));
|
||||||
|
|
||||||
if (NS_SUCCEEDED(errorObject->InitWithWindowID(
|
if (NS_SUCCEEDED(errorObject->InitWithWindowID(
|
||||||
msg.get(),
|
msg,
|
||||||
NS_ConvertUTF8toUTF16(mImage.GetURIString()).get(),
|
NS_ConvertUTF8toUTF16(mImage.GetURIString()),
|
||||||
nullptr, 0, 0, nsIScriptError::errorFlag,
|
EmptyString(), 0, 0, nsIScriptError::errorFlag,
|
||||||
"Image", mImage.InnerWindowID()
|
"Image", mImage.InnerWindowID()
|
||||||
))) {
|
))) {
|
||||||
consoleService->LogMessage(errorObject);
|
consoleService->LogMessage(errorObject);
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
#include "nsIConsoleMessage.idl"
|
#include "nsIConsoleMessage.idl"
|
||||||
|
|
||||||
[scriptable, uuid(c6dd877a-87b6-47cc-968d-90f4514ec65f)]
|
[scriptable, uuid(ddc19b34-e22e-46d5-9f7f-c7768a7dc50a)]
|
||||||
interface nsIScriptError : nsIConsoleMessage
|
interface nsIScriptError : nsIConsoleMessage
|
||||||
{
|
{
|
||||||
/** pseudo-flag for default case */
|
/** pseudo-flag for default case */
|
||||||
|
@ -66,9 +66,9 @@ interface nsIScriptError : nsIConsoleMessage
|
||||||
returned if init() was used instead of initWithWindowID(). */
|
returned if init() was used instead of initWithWindowID(). */
|
||||||
readonly attribute unsigned long long innerWindowID;
|
readonly attribute unsigned long long innerWindowID;
|
||||||
|
|
||||||
void init(in wstring message,
|
void init(in AString message,
|
||||||
in wstring sourceName,
|
in AString sourceName,
|
||||||
in wstring sourceLine,
|
in AString sourceLine,
|
||||||
in uint32_t lineNumber,
|
in uint32_t lineNumber,
|
||||||
in uint32_t columnNumber,
|
in uint32_t columnNumber,
|
||||||
in uint32_t flags,
|
in uint32_t flags,
|
||||||
|
@ -77,9 +77,9 @@ interface nsIScriptError : nsIConsoleMessage
|
||||||
/* This should be called instead of nsIScriptError.init to
|
/* This should be called instead of nsIScriptError.init to
|
||||||
initialize with a window id. The window id should be for the
|
initialize with a window id. The window id should be for the
|
||||||
inner window associated with this error. */
|
inner window associated with this error. */
|
||||||
void initWithWindowID(in wstring message,
|
void initWithWindowID(in AString message,
|
||||||
in wstring sourceName,
|
in AString sourceName,
|
||||||
in wstring sourceLine,
|
in AString sourceLine,
|
||||||
in uint32_t lineNumber,
|
in uint32_t lineNumber,
|
||||||
in uint32_t columnNumber,
|
in uint32_t columnNumber,
|
||||||
in uint32_t flags,
|
in uint32_t flags,
|
||||||
|
|
|
@ -125,21 +125,19 @@ mozJSLoaderErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep)
|
||||||
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
||||||
|
|
||||||
if (consoleService && errorObject) {
|
if (consoleService && errorObject) {
|
||||||
/*
|
|
||||||
* Got an error object; prepare appropriate-width versions of
|
|
||||||
* various arguments to it.
|
|
||||||
*/
|
|
||||||
NS_ConvertASCIItoUTF16 fileUni(rep->filename);
|
|
||||||
|
|
||||||
uint32_t column = rep->uctokenptr - rep->uclinebuf;
|
uint32_t column = rep->uctokenptr - rep->uclinebuf;
|
||||||
|
|
||||||
rv = errorObject->Init(reinterpret_cast<const PRUnichar*>
|
const PRUnichar* ucmessage =
|
||||||
(rep->ucmessage),
|
static_cast<const PRUnichar*>(rep->ucmessage);
|
||||||
fileUni.get(),
|
const PRUnichar* uclinebuf =
|
||||||
reinterpret_cast<const PRUnichar*>
|
static_cast<const PRUnichar*>(rep->uclinebuf);
|
||||||
(rep->uclinebuf),
|
|
||||||
rep->lineno, column, rep->flags,
|
rv = errorObject->Init(
|
||||||
"component javascript");
|
ucmessage ? nsDependentString(ucmessage) : EmptyString(),
|
||||||
|
NS_ConvertASCIItoUTF16(rep->filename),
|
||||||
|
uclinebuf ? nsDependentString(uclinebuf) : EmptyString(),
|
||||||
|
rep->lineno, column, rep->flags,
|
||||||
|
"component javascript");
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
rv = consoleService->LogMessage(errorObject);
|
rv = consoleService->LogMessage(errorObject);
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
|
|
@ -2784,9 +2784,16 @@ nsXPCComponents_Utils::ReportError(const JS::Value &error, JSContext *cx)
|
||||||
|
|
||||||
uint32_t column = err->uctokenptr - err->uclinebuf;
|
uint32_t column = err->uctokenptr - err->uclinebuf;
|
||||||
|
|
||||||
|
const PRUnichar* ucmessage =
|
||||||
|
static_cast<const PRUnichar*>(err->ucmessage);
|
||||||
|
const PRUnichar* uclinebuf =
|
||||||
|
static_cast<const PRUnichar*>(err->uclinebuf);
|
||||||
|
|
||||||
nsresult rv = scripterr->InitWithWindowID(
|
nsresult rv = scripterr->InitWithWindowID(
|
||||||
static_cast<const PRUnichar*>(err->ucmessage), fileUni.get(),
|
ucmessage ? nsDependentString(ucmessage) : EmptyString(),
|
||||||
static_cast<const PRUnichar*>(err->uclinebuf), err->lineno,
|
fileUni,
|
||||||
|
uclinebuf ? nsDependentString(uclinebuf) : EmptyString(),
|
||||||
|
err->lineno,
|
||||||
column, err->flags, "XPConnect JavaScript", innerWindowID);
|
column, err->flags, "XPConnect JavaScript", innerWindowID);
|
||||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||||
|
|
||||||
|
@ -2817,9 +2824,9 @@ nsXPCComponents_Utils::ReportError(const JS::Value &error, JSContext *cx)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
||||||
nsresult rv = scripterr->InitWithWindowID(
|
nsresult rv = scripterr->InitWithWindowID(
|
||||||
reinterpret_cast<const PRUnichar *>(msgchars),
|
nsDependentString(static_cast<const PRUnichar *>(msgchars)),
|
||||||
NS_ConvertUTF8toUTF16(fileName).get(),
|
NS_ConvertUTF8toUTF16(fileName),
|
||||||
nullptr, lineNo, 0, 0, "XPConnect JavaScript", innerWindowID);
|
EmptyString(), lineNo, 0, 0, "XPConnect JavaScript", innerWindowID);
|
||||||
NS_ENSURE_SUCCESS(rv, NS_OK);
|
NS_ENSURE_SUCCESS(rv, NS_OK);
|
||||||
|
|
||||||
console->LogMessage(scripterr);
|
console->LogMessage(scripterr);
|
||||||
|
|
|
@ -1350,24 +1350,25 @@ XPCConvert::JSErrorToXPCException(XPCCallContext& ccx,
|
||||||
if (report) {
|
if (report) {
|
||||||
nsAutoString bestMessage;
|
nsAutoString bestMessage;
|
||||||
if (report && report->ucmessage) {
|
if (report && report->ucmessage) {
|
||||||
bestMessage = (const PRUnichar *)report->ucmessage;
|
bestMessage = static_cast<const PRUnichar*>(report->ucmessage);
|
||||||
} else if (message) {
|
} else if (message) {
|
||||||
CopyASCIItoUTF16(message, bestMessage);
|
CopyASCIItoUTF16(message, bestMessage);
|
||||||
} else {
|
} else {
|
||||||
bestMessage.AssignLiteral("JavaScript Error");
|
bestMessage.AssignLiteral("JavaScript Error");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PRUnichar* uclinebuf =
|
||||||
|
static_cast<const PRUnichar*>(report->uclinebuf);
|
||||||
|
|
||||||
data = new nsScriptError();
|
data = new nsScriptError();
|
||||||
if (!data)
|
data->InitWithWindowID(
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
bestMessage,
|
||||||
|
NS_ConvertASCIItoUTF16(report->filename),
|
||||||
|
uclinebuf ? nsDependentString(uclinebuf) : EmptyString(),
|
||||||
data->InitWithWindowID(bestMessage.get(),
|
report->lineno,
|
||||||
NS_ConvertASCIItoUTF16(report->filename).get(),
|
report->uctokenptr - report->uclinebuf, report->flags,
|
||||||
(const PRUnichar *)report->uclinebuf, report->lineno,
|
"XPConnect JavaScript",
|
||||||
report->uctokenptr - report->uclinebuf, report->flags,
|
nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(ccx.GetJSContext()));
|
||||||
"XPConnect JavaScript",
|
|
||||||
nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(ccx.GetJSContext()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
|
@ -1081,9 +1081,9 @@ nsXPCWrappedJSClass::CheckForException(XPCCallContext & ccx,
|
||||||
rv = location->GetFilename(getter_Copies(sourceName));
|
rv = location->GetFilename(getter_Copies(sourceName));
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = scriptError->InitWithWindowID(newMessage.get(),
|
rv = scriptError->InitWithWindowID(newMessage,
|
||||||
NS_ConvertASCIItoUTF16(sourceName).get(),
|
NS_ConvertASCIItoUTF16(sourceName),
|
||||||
nullptr,
|
EmptyString(),
|
||||||
lineNumber, 0, 0,
|
lineNumber, 0, 0,
|
||||||
"XPConnect JavaScript",
|
"XPConnect JavaScript",
|
||||||
nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(cx));
|
nsJSUtils::GetCurrentlyRunningCodeInnerWindowID(cx));
|
||||||
|
|
|
@ -91,9 +91,9 @@ nsScriptError::GetCategory(char **result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsScriptError::Init(const PRUnichar *message,
|
nsScriptError::Init(const nsAString& message,
|
||||||
const PRUnichar *sourceName,
|
const nsAString& sourceName,
|
||||||
const PRUnichar *sourceLine,
|
const nsAString& sourceLine,
|
||||||
uint32_t lineNumber,
|
uint32_t lineNumber,
|
||||||
uint32_t columnNumber,
|
uint32_t columnNumber,
|
||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
|
@ -104,9 +104,9 @@ nsScriptError::Init(const PRUnichar *message,
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsScriptError::InitWithWindowID(const PRUnichar *message,
|
nsScriptError::InitWithWindowID(const nsAString& message,
|
||||||
const PRUnichar *sourceName,
|
const nsAString& sourceName,
|
||||||
const PRUnichar *sourceLine,
|
const nsAString& sourceLine,
|
||||||
uint32_t lineNumber,
|
uint32_t lineNumber,
|
||||||
uint32_t columnNumber,
|
uint32_t columnNumber,
|
||||||
uint32_t flags,
|
uint32_t flags,
|
||||||
|
|
|
@ -406,9 +406,9 @@ nsCSSScanner::OutputError()
|
||||||
do_CreateInstance(gScriptErrorFactory, &rv);
|
do_CreateInstance(gScriptErrorFactory, &rv);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
rv = errorObject->InitWithWindowID(mError.get(),
|
rv = errorObject->InitWithWindowID(mError,
|
||||||
NS_ConvertUTF8toUTF16(mFileName).get(),
|
NS_ConvertUTF8toUTF16(mFileName),
|
||||||
EmptyString().get(),
|
EmptyString(),
|
||||||
mErrorLineNumber,
|
mErrorLineNumber,
|
||||||
mErrorColNumber,
|
mErrorColNumber,
|
||||||
nsIScriptError::warningFlag,
|
nsIScriptError::warningFlag,
|
||||||
|
|
|
@ -779,9 +779,9 @@ nsUserFontSet::LogMessage(gfxProxyFontEntry *aProxy,
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
uint64_t innerWindowID = GetPresContext()->Document()->InnerWindowID();
|
uint64_t innerWindowID = GetPresContext()->Document()->InnerWindowID();
|
||||||
rv = scriptError->InitWithWindowID(NS_ConvertUTF8toUTF16(msg).get(),
|
rv = scriptError->InitWithWindowID(NS_ConvertUTF8toUTF16(msg),
|
||||||
href.get(), // file
|
href, // file
|
||||||
text.get(), // src line
|
text, // src line
|
||||||
0, 0, // line & column number
|
0, 0, // line & column number
|
||||||
aFlags, // flags
|
aFlags, // flags
|
||||||
"CSS Loader", // category (make separate?)
|
"CSS Loader", // category (make separate?)
|
||||||
|
|
|
@ -220,7 +220,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*|*:-moz-full-screen {
|
*|*:not(:root):-moz-full-screen {
|
||||||
position: fixed !important;
|
position: fixed !important;
|
||||||
top: 0 !important;
|
top: 0 !important;
|
||||||
left: 0 !important;
|
left: 0 !important;
|
||||||
|
|
|
@ -928,9 +928,9 @@ nsExpatDriver::HandleError()
|
||||||
nsCOMPtr<nsIScriptError> serr(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
|
nsCOMPtr<nsIScriptError> serr(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
|
||||||
nsresult rv = NS_ERROR_FAILURE;
|
nsresult rv = NS_ERROR_FAILURE;
|
||||||
if (serr) {
|
if (serr) {
|
||||||
rv = serr->InitWithWindowID(description.get(),
|
rv = serr->InitWithWindowID(description,
|
||||||
mURISpec.get(),
|
mURISpec,
|
||||||
mLastLine.get(),
|
mLastLine,
|
||||||
lineNumber, colNumber,
|
lineNumber, colNumber,
|
||||||
nsIScriptError::errorFlag, "malformed-xml",
|
nsIScriptError::errorFlag, "malformed-xml",
|
||||||
mInnerWindowID);
|
mInnerWindowID);
|
||||||
|
|
|
@ -170,8 +170,8 @@ void LogMessageWithContext(FileLocation &aFile,
|
||||||
if (!console)
|
if (!console)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nsresult rv = error->Init(NS_ConvertUTF8toUTF16(formatted).get(),
|
nsresult rv = error->Init(NS_ConvertUTF8toUTF16(formatted),
|
||||||
NS_ConvertUTF8toUTF16(file).get(), NULL,
|
NS_ConvertUTF8toUTF16(file), EmptyString(),
|
||||||
aLineNumber, 0, nsIScriptError::warningFlag,
|
aLineNumber, 0, nsIScriptError::warningFlag,
|
||||||
"chrome registration");
|
"chrome registration");
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
|
|
|
@ -74,6 +74,8 @@ nsDirectoryService::GetCurrentProcessDirectory(nsIFile** aFile)
|
||||||
rv = nsDirectoryService::Create(nullptr,
|
rv = nsDirectoryService::Create(nullptr,
|
||||||
NS_GET_IID(nsIProperties),
|
NS_GET_IID(nsIProperties),
|
||||||
getter_AddRefs(dirService)); // needs to be around for life of product
|
getter_AddRefs(dirService)); // needs to be around for life of product
|
||||||
|
if (NS_FAILED(rv))
|
||||||
|
return rv;
|
||||||
|
|
||||||
if (dirService)
|
if (dirService)
|
||||||
{
|
{
|
||||||
|
|
Загрузка…
Ссылка в новой задаче