diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/debian/changelog thunderbird-trunk-37.0~a1~hg20150108r17327.222808/debian/changelog
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/debian/changelog 2015-01-07 22:54:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/debian/changelog 2015-01-09 14:11:29.000000000 +0000
@@ -1,10 +1,10 @@
-thunderbird-trunk (37.0~a1~hg20150107r17323.222415-0ubuntu1~umd1~trusty) trusty; urgency=medium
+thunderbird-trunk (37.0~a1~hg20150108r17327.222808-0ubuntu1~umd1~trusty) trusty; urgency=medium
* Refresh patches
- update debian/patches/unity-menubar.patch
- update debian/patches/dont-include-hyphenation-patterns.patch
- -- Chris Coulson Wed, 07 Jan 2015 22:08:37 +0000
+ -- Chris Coulson Fri, 09 Jan 2015 12:13:28 +0000
thunderbird-trunk (36.0~a1~hg20141126r17147.217518-0ubuntu1) utopic; urgency=medium
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/l10n/changesets thunderbird-trunk-37.0~a1~hg20150108r17327.222808/l10n/changesets
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/l10n/changesets 2015-01-07 22:17:38.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/l10n/changesets 2015-01-09 12:42:43.000000000 +0000
@@ -24,7 +24,7 @@
hu 794:b45f6b60407e
id 512:b520186368ec
is 297:33af74865c25
-it 3576:b2e5691e68ae
+it 3580:2ada31bf14a7
ja 633:608df4a0c172
ja-JP-mac 634:aba6f4f0ee5e
ka 56:2ee9bc162267
@@ -34,9 +34,9 @@
nl 3800:8bd8b62c2435
nn-NO 636:2032d95af2a7
pa-IN 589:b51530b15a00
-pl 5018:9c57564a4b23
+pl 5023:aa68b815eead
pt-BR 664:723658175bdd
-pt-PT 2056:22b468633bda
+pt-PT 2057:0cb37830d909
rm 388:945a12b3635b
ro 414:9a349bbcf451
ru 2260:b1944c9224ca
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/l10n/pt-PT/mail/chrome/messenger/messengercompose/composeMsgs.properties thunderbird-trunk-37.0~a1~hg20150108r17327.222808/l10n/pt-PT/mail/chrome/messenger/messengercompose/composeMsgs.properties
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/l10n/pt-PT/mail/chrome/messenger/messengercompose/composeMsgs.properties 2015-01-07 22:17:11.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/l10n/pt-PT/mail/chrome/messenger/messengercompose/composeMsgs.properties 2015-01-09 12:41:20.000000000 +0000
@@ -295,7 +295,7 @@
## Attachment Reminder
## LOCALIZATION NOTE (mail.compose.attachment_reminder_keywords): comma separated
## words that that should trigger an attachment reminder.
-mail.compose.attachment_reminder_keywords=.doc,.pdf,.xls,.ppt,.rtf,.pps,anexo,anexar,anexado,cv,
+mail.compose.attachment_reminder_keywords=.doc,.pdf,.xls,.ppt,.rtf,.pps,anexo,anexar,anexado,cv
addAttachmentButton=Adicionar anexo
addAttachmentButton.accesskey=A
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mail/installer/package-manifest.in thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mail/installer/package-manifest.in
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mail/installer/package-manifest.in 2015-01-07 22:14:56.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mail/installer/package-manifest.in 2015-01-09 12:34:50.000000000 +0000
@@ -436,6 +436,7 @@
; layout
@RESPATH@/components/content_events.xpt
+@RESPATH@/components/content_geckomediaplugins.xpt
@RESPATH@/components/content_html.xpt
@RESPATH@/components/content_xslt.xpt
@RESPATH@/components/html5.xpt
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/public/nsIMsgFolder.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/public/nsIMsgFolder.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/public/nsIMsgFolder.idl 2015-01-07 22:14:56.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/public/nsIMsgFolder.idl 2015-01-09 12:34:49.000000000 +0000
@@ -30,7 +30,7 @@
// enumerated type for determining if a message has been replied to, forwarded, etc.
typedef long nsMsgDispositionState;
-[scriptable, uuid(9ce446f3-398c-4462-a4c6-0ce562d5bd30)]
+[scriptable, uuid(8EC4D122-1082-4fa2-B97C-4AE852B254D2)]
interface nsIMsgFolder : nsISupports {
const nsMsgBiffState nsMsgBiffState_NewMail = 0; // User has new mail waiting.
@@ -547,7 +547,6 @@
*/
nsIInputStream getMsgInputStream(in nsIMsgDBHdr aHdr, out boolean aReusable);
- readonly attribute nsIInputStream offlineStoreInputStream;
void DownloadMessagesForOffline(in nsIArray messages,
in nsIMsgWindow window);
nsIMsgFolder getChildWithURI(in ACString uri, in boolean deep,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/public/nsIMsgPluggableStore.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/public/nsIMsgPluggableStore.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/public/nsIMsgPluggableStore.idl 2015-01-07 22:14:56.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/public/nsIMsgPluggableStore.idl 2015-01-09 12:34:49.000000000 +0000
@@ -17,7 +17,7 @@
interface nsIMsgDatabase;
interface nsITransaction;
-[scriptable, uuid(eccf0046-99db-4b08-8e14-29fa254f59c6)]
+[scriptable, uuid(2a861ed8-b4c2-4443-8c20-5e8a217a6310)]
/**
* Pluggable message store interface. Each incoming server can have a different
@@ -321,4 +321,12 @@
*/
void changeKeywords(in nsIArray aHdrArray, in ACString aKeywords,
in boolean aAdd);
+
+ /**
+ * Identifies a specific type of store. Please use this only for legacy
+ * bug fixes, and not as a method to change behavior!
+ *
+ * Typical values: "mbox", "maildir"
+ */
+ readonly attribute ACString storeType;
};
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/util/nsMsgDBFolder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/util/nsMsgDBFolder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/base/util/nsMsgDBFolder.cpp 2015-01-07 22:14:56.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/base/util/nsMsgDBFolder.cpp 2015-01-09 12:34:50.000000000 +0000
@@ -751,14 +751,6 @@
return msgStore->GetSummaryFile(this, aSummaryFile);
}
-NS_IMETHODIMP nsMsgDBFolder::GetOfflineStoreInputStream(nsIInputStream **stream)
-{
- nsCOMPtr localStore;
- nsresult rv = GetFilePath(getter_AddRefs(localStore));
- NS_ENSURE_SUCCESS(rv, rv);
- return NS_NewLocalFileInputStream(stream, localStore);
-}
-
bool nsMsgDBFolder::VerifyOfflineMessage(nsIMsgDBHdr *msgHdr, nsIInputStream *fileStream)
{
nsCOMPtr seekableStream = do_QueryInterface(fileStream);
@@ -1791,13 +1783,6 @@
}
else
m_offlineHeader->SetLineCount(m_numOfflineMsgLines);
-#ifdef _DEBUG
- nsCOMPtr inputStream;
- GetOfflineStoreInputStream(getter_AddRefs(inputStream));
- if (inputStream)
- NS_ASSERTION(VerifyOfflineMessage(m_offlineHeader, inputStream),
- "offline message doesn't start with From ");
-#endif
}
if (msgStore)
msgStore->FinishNewMessage(m_tempMessageStream, m_offlineHeader);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/db/msgdb/src/nsMsgThread.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/db/msgdb/src/nsMsgThread.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/db/msgdb/src/nsMsgThread.cpp 2015-01-07 22:14:56.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/db/msgdb/src/nsMsgThread.cpp 2015-01-09 12:34:51.000000000 +0000
@@ -56,8 +56,8 @@
bool found = m_mdbDB->m_threads.RemoveElement(this);
NS_ASSERTION(found, "removing thread not in threads array");
}
- else
- NS_ERROR("null db in thread");
+ else // This can happen if db is forced closed
+ NS_WARNING("null db in thread");
Clear();
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/imap/src/nsImapMailFolder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/imap/src/nsImapMailFolder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/imap/src/nsImapMailFolder.cpp 2015-01-07 22:14:57.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/imap/src/nsImapMailFolder.cpp 2015-01-09 12:34:52.000000000 +0000
@@ -6982,12 +6982,21 @@
{
// Some offline stores may contain a bug where the storeToken is set but
// the messageOffset is zero. Detect cases like this, and use storeToken
- // to set the missing messageOffset. Note that offline stores at least for
- // now do not fully support pluggable stores, so this assumes mbox.
- nsCString storeToken;
- origHdr->GetStringProperty("storeToken", getter_Copies(storeToken));
- if (!storeToken.IsEmpty())
- messageOffset = ParseUint64Str(storeToken.get());
+ // to set the missing messageOffset. Note this assumes mbox.
+ nsCOMPtr offlineStore;
+ (void) GetMsgStore(getter_AddRefs(offlineStore));
+ if (offlineStore)
+ {
+ nsAutoCString type;
+ offlineStore->GetStoreType(type);
+ if (type.EqualsLiteral("mbox"))
+ {
+ nsCString storeToken;
+ origHdr->GetStringProperty("storeToken", getter_Copies(storeToken));
+ if (!storeToken.IsEmpty())
+ messageOffset = ParseUint64Str(storeToken.get());
+ }
+ }
}
origHdr->GetOfflineMessageSize(&messageSize);
if (!messageSize)
@@ -7134,7 +7143,8 @@
// on the UI thread but we should check if the offline store is locked.
bool isLocked;
GetLocked(&isLocked);
- nsCOMPtr inputStream;
+ nsCOMPtr inputStream;
+ bool reusable = false;
nsCOMPtr outputStream;
nsTArray addedKeys;
nsTArray srcKeyArray;
@@ -7144,7 +7154,6 @@
nsOfflineImapOperationType deleteOpType = nsIMsgOfflineImapOperation::kDeletedMsg;
if (!deleteToTrash)
deleteOpType = nsIMsgOfflineImapOperation::kMsgMarkedDeleted;
- srcFolder->GetOfflineStoreInputStream(getter_AddRefs(inputStream));
nsCString messageIds;
rv = BuildIdsAndKeyArray(messages, messageIds, srcKeyArray);
// put fake message in destination db, delete source if move
@@ -7253,6 +7262,9 @@
destMsgHdrs->AppendElement(newMailHdr, false);
srcFolder->HasMsgOffline(originalKey, &hasMsgOffline);
newMailHdr->SetUint32Property("pseudoHdr", 1);
+ if (!reusable)
+ (void)srcFolder->GetMsgInputStream(newMailHdr, &reusable,
+ getter_AddRefs(inputStream));
if (inputStream && hasMsgOffline && !isLocked)
{
@@ -8286,7 +8298,6 @@
if (msgKey == nsMsgKey_None)
mDatabase->GetNextFakeOfflineMsgKey(&msgKey);
- nsCOMPtr messages(do_CreateInstance(NS_ARRAY_CONTRACTID));
nsCOMPtr op;
rv = mDatabase->GetOfflineOpForKey(msgKey, true, getter_AddRefs(op));
@@ -8322,7 +8333,6 @@
// Tell the parser to use the offset that will be in the dest stream, not the
// temp file.
- nsCString storeToken;
uint64_t offset;
fakeHdr->GetMessageOffset(&offset);
// This will fail for > 4GB mbox folders, see bug 793865
@@ -8360,16 +8370,24 @@
msgParser->FinishHeader();
uint32_t resultFlags;
- fakeHdr->SetMessageOffset(curOfflineStorePos);
- char storeToken[100];
- PR_snprintf(storeToken, sizeof(storeToken), "%lld", curOfflineStorePos);
- fakeHdr->SetStringProperty("storeToken", storeToken);
fakeHdr->OrFlags(nsMsgMessageFlags::Offline | nsMsgMessageFlags::Read, &resultFlags);
fakeHdr->SetOfflineMessageSize(fileSize);
fakeHdr->SetUint32Property("pseudoHdr", 1);
mDatabase->AddNewHdrToDB(fakeHdr, true /* notify */);
SetFlag(nsMsgFolderFlags::OfflineEvents);
+
+ // Call FinishNewMessage before setting pending attributes, as in
+ // maildir it copies from tmp to cur and may change the storeToken
+ // to get a unique filename.
+ nsCOMPtr msgStore;
+ GetMsgStore(getter_AddRefs(msgStore));
+ if (msgStore)
+ msgStore->FinishNewMessage(offlineStore, fakeHdr);
+
+ nsCOMPtr messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
+ NS_ENSURE_SUCCESS(rv, rv);
messages->AppendElement(fakeHdr, false);
+
SetPendingAttributes(messages, false);
// Gloda needs this notification to index the fake message.
nsCOMPtr
@@ -8379,10 +8397,6 @@
inputStream->Close();
inputStream = nullptr;
delete inputStreamBuffer;
- nsCOMPtr msgStore;
- GetMsgStore(getter_AddRefs(msgStore));
- if (msgStore)
- msgStore->FinishNewMessage(offlineStore, fakeHdr);
}
offlineStore->Close();
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/imap/src/nsImapOfflineSync.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/imap/src/nsImapOfflineSync.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/imap/src/nsImapOfflineSync.cpp 2015-01-07 22:14:57.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/imap/src/nsImapOfflineSync.cpp 2015-01-09 12:34:52.000000000 +0000
@@ -402,7 +402,9 @@
if (NS_SUCCEEDED(rv) && destFolder)
{
nsCOMPtr offlineStoreInputStream;
- rv = destFolder->GetOfflineStoreInputStream(getter_AddRefs(offlineStoreInputStream));
+ bool reusable;
+ rv = destFolder->GetMsgInputStream(
+ mailHdr, &reusable, getter_AddRefs(offlineStoreInputStream));
if (NS_SUCCEEDED(rv) && offlineStoreInputStream)
{
nsCOMPtr seekStream = do_QueryInterface(offlineStoreInputStream);
@@ -415,7 +417,7 @@
// now, copy the dest folder offline store msg to the temp file
int32_t inputBufferSize = 10240;
char *inputBuffer = nullptr;
-
+
while (!inputBuffer && (inputBufferSize >= 512))
{
inputBuffer = (char *) PR_Malloc(inputBufferSize);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsLocalMailFolder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsLocalMailFolder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsLocalMailFolder.cpp 2015-01-07 22:14:57.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsLocalMailFolder.cpp 2015-01-09 12:34:52.000000000 +0000
@@ -2004,6 +2004,11 @@
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr seekableStream = do_QueryInterface(mCopyState->m_fileStream, &rv);
+
+ // XXX ToDo: When copying multiple messages from a non-offline-enabled IMAP
+ // server, this fails. (The copy succeeds because the file stream is created
+ // subsequently in StartMessage) We should not be warning on an expected error.
+ // Perhaps there are unexpected consequences of returning early?
NS_ENSURE_SUCCESS(rv, rv);
seekableStream->Seek(nsISeekableStream::NS_SEEK_END, 0);
@@ -2197,18 +2202,19 @@
if (!aCopySucceeded || mCopyState->m_writeFailed)
{
- if (mCopyState->m_curDstKey != nsMsgKey_None)
- mCopyState->m_msgStore->DiscardNewMessage(mCopyState->m_fileStream,
- mCopyState->m_newHdr);
-
if (mCopyState->m_fileStream)
+ {
+ if (mCopyState->m_curDstKey != nsMsgKey_None)
+ mCopyState->m_msgStore->DiscardNewMessage(mCopyState->m_fileStream,
+ mCopyState->m_newHdr);
mCopyState->m_fileStream->Close();
+ }
if (!mCopyState->m_isMove)
{
- // passing true because the messages that have been successfully
- // copied have their corresponding hdrs in place. The message that has
- // failed has been truncated so the msf file and berkeley mailbox
+ // passing true because the messages that have been successfully
+ // copied have their corresponding hdrs in place. The message that has
+ // failed has been truncated so the msf file and berkeley mailbox
// are in sync.
(void) OnCopyCompleted(mCopyState->m_srcSupport, true);
// enable the dest folder
@@ -2221,7 +2227,6 @@
nsRefPtr localUndoTxn = mCopyState->m_undoMsgTxn;
- nsCOMPtr seekableStream;
NS_ASSERTION(mCopyState->m_leftOver == 0, "whoops, something wrong with previous copy");
mCopyState->m_leftOver = 0; // reset to 0.
// need to reset this in case we're move/copying multiple msgs.
@@ -2229,9 +2234,19 @@
// flush the copied message. We need a close at the end to get the
// file size and time updated correctly.
- if (mCopyState->m_fileStream)
+ //
+ // These filestream closes are handled inconsistently in the code. In some
+ // cases, this is done in EndMessage, while in others it is done here in
+ // EndCopy. When we do the close in EndMessage, we'll set
+ // mCopyState->m_fileStream to null since it is no longer needed, and detect
+ // here the null stream so we know that we don't have to close it here.
+ //
+ // Similarly, m_parseMsgState->GetNewMsgHdr() returns a null hdr if the hdr
+ // has already been processed by EndMessage so it is not doubly added here.
+
+ nsCOMPtr seekableStream(do_QueryInterface(mCopyState->m_fileStream));
+ if (seekableStream)
{
- seekableStream = do_QueryInterface(mCopyState->m_fileStream);
if (mCopyState->m_dummyEnvelopeNeeded)
{
uint32_t bytesWritten;
@@ -2240,30 +2255,14 @@
if (mCopyState->m_parseMsgState)
mCopyState->m_parseMsgState->ParseAFolderLine(CRLF, MSG_LINEBREAK_LEN);
}
- // flush the copied message. We need a close at the end to get the
- // file size and time updated correctly.
- seekableStream = do_QueryInterface(mCopyState->m_fileStream);
- if (mCopyState->m_dummyEnvelopeNeeded)
- {
- uint32_t bytesWritten;
- seekableStream->Seek(nsISeekableStream::NS_SEEK_END, 0);
- mCopyState->m_fileStream->Write(MSG_LINEBREAK, MSG_LINEBREAK_LEN,
- &bytesWritten);
- if (mCopyState->m_parseMsgState)
- mCopyState->m_parseMsgState->ParseAFolderLine(CRLF, MSG_LINEBREAK_LEN);
- }
- // flush the copied message. We need a close at the end to get the
- // file size and time updated correctly.
rv = mCopyState->m_msgStore->FinishNewMessage(mCopyState->m_fileStream,
- mCopyState->m_newHdr);
+ mCopyState->m_newHdr);
if (NS_SUCCEEDED(rv) && mCopyState->m_newHdr)
mCopyState->m_newHdr->GetMessageKey(&mCopyState->m_curDstKey);
if (multipleCopiesFinished)
mCopyState->m_fileStream->Close();
else
mCopyState->m_fileStream->Flush();
- mCopyState->m_msgStore->FinishNewMessage(mCopyState->m_fileStream,
- mCopyState->m_newHdr);
}
//Copy the header to the new database
if (mCopyState->m_message)
@@ -2580,6 +2579,11 @@
if (mCopyState->m_parseMsgState)
mCopyState->m_parseMsgState->ParseAFolderLine(CRLF, MSG_LINEBREAK_LEN);
+ rv = mCopyState->m_msgStore->FinishNewMessage(mCopyState->m_fileStream,
+ mCopyState->m_newHdr);
+ mCopyState->m_fileStream->Close();
+ mCopyState->m_fileStream = nullptr; // all done with the file stream
+
// CopyFileMessage() and CopyMessages() from servers other than mailbox
if (mCopyState->m_parseMsgState)
{
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsMsgBrkMBoxStore.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsMsgBrkMBoxStore.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsMsgBrkMBoxStore.cpp 2015-01-07 22:14:57.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsMsgBrkMBoxStore.cpp 2015-01-09 12:34:52.000000000 +0000
@@ -1005,6 +1005,12 @@
return NS_OK;
}
+NS_IMETHODIMP nsMsgBrkMBoxStore::GetStoreType(nsACString& aType)
+{
+ aType.AssignLiteral("mbox");
+ return NS_OK;
+}
+
// Iterates over the files in the "path" directory, and adds subfolders to
// parent for each mailbox file found.
nsresult
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsMsgMaildirStore.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsMsgMaildirStore.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mailnews/local/src/nsMsgMaildirStore.cpp 2015-01-07 22:14:57.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mailnews/local/src/nsMsgMaildirStore.cpp 2015-01-09 12:34:52.000000000 +0000
@@ -977,21 +977,56 @@
NS_ENSURE_ARG_POINTER(aDstFolder);
NS_ENSURE_ARG_POINTER(aCopyDone);
NS_ENSURE_ARG_POINTER(aUndoAction);
- uint32_t messageCount;
- nsresult rv = aHdrArray->GetLength(&messageCount);
- NS_ENSURE_SUCCESS(rv, rv);
+
+ *aCopyDone = false;
+
nsCOMPtr srcFolder;
+ nsresult rv;
+ nsCOMPtr msgHdr = do_QueryElementAt(aHdrArray, 0, &rv);
+ NS_ENSURE_SUCCESS(rv, rv);
+ rv = msgHdr->GetFolder(getter_AddRefs(srcFolder));
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ // Both source and destination folders must use maildir type store.
+ nsCOMPtr srcStore;
+ nsAutoCString srcType;
+ srcFolder->GetMsgStore(getter_AddRefs(srcStore));
+ if (srcStore)
+ srcStore->GetStoreType(srcType);
+ nsCOMPtr dstStore;
+ nsAutoCString dstType;
+ aDstFolder->GetMsgStore(getter_AddRefs(dstStore));
+ if (dstStore)
+ dstStore->GetStoreType(dstType);
+ if (!srcType.EqualsLiteral("maildir") || !dstType.EqualsLiteral("maildir"))
+ return NS_OK;
+
+ // Both source and destination must be local folders. In theory we could
+ // do efficient copies of the offline store of IMAP, but this is not
+ // supported yet. For that, we need to deal with both correct handling
+ // of deletes from the src server, and msgKey = UIDL in the dst folder.
+ nsCOMPtr destLocalFolder(do_QueryInterface(aDstFolder));
+ if (!destLocalFolder)
+ return NS_OK;
+ nsCOMPtr srcLocalFolder(do_QueryInterface(srcFolder));
+ if (!srcLocalFolder)
+ return NS_OK;
+
+ // We should be able to use a file move for an efficient copy.
+
nsCOMPtr destFolderPath;
nsCOMPtr destDB;
- nsCOMPtr srcDB;
aDstFolder->GetMsgDatabase(getter_AddRefs(destDB));
- aDstFolder->GetFilePath(getter_AddRefs(destFolderPath));
+ rv = aDstFolder->GetFilePath(getter_AddRefs(destFolderPath));
+ NS_ENSURE_SUCCESS(rv, rv);
destFolderPath->Append(NS_LITERAL_STRING("cur"));
- nsCOMPtr msgHdr = do_QueryElementAt(aHdrArray, 0, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
- rv = msgHdr->GetFolder(getter_AddRefs(srcFolder));
+ nsCOMPtr srcFolderPath;
+ rv = srcFolder->GetFilePath(getter_AddRefs(srcFolderPath));
NS_ENSURE_SUCCESS(rv, rv);
+ srcFolderPath->Append(NS_LITERAL_STRING("cur"));
+
+ nsCOMPtr srcDB;
srcFolder->GetMsgDatabase(getter_AddRefs(srcDB));
nsRefPtr msgTxn = new nsLocalMoveCopyMsgTxn;
NS_ENSURE_TRUE(msgTxn, NS_ERROR_OUT_OF_MEMORY);
@@ -1003,34 +1038,40 @@
msgTxn->SetTransactionType(nsIMessenger::eCopyMsg);
}
+ if (aListener)
+ aListener->OnStartCopy();
+
nsCOMPtr dstHdrs(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
+ uint32_t messageCount;
+ rv = aHdrArray->GetLength(&messageCount);
+ NS_ENSURE_SUCCESS(rv, rv);
+
for (uint32_t i = 0; i < messageCount; i++)
{
- nsCOMPtr msgHdr = do_QueryElementAt(aHdrArray, i, &rv);
+ nsCOMPtr srcHdr = do_QueryElementAt(aHdrArray, i, &rv);
if (NS_FAILED(rv))
+ {
+ PR_LOG(MailDirLog, PR_LOG_ALWAYS,
+ ("srcHdr null\n"));
continue;
+ }
nsMsgKey srcKey;
- msgHdr->GetMessageKey(&srcKey);
+ srcHdr->GetMessageKey(&srcKey);
msgTxn->AddSrcKey(srcKey);
- msgHdr->GetFolder(getter_AddRefs(srcFolder));
- nsCOMPtr path;
- rv = srcFolder->GetFilePath(getter_AddRefs(path));
- NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString fileName;
msgHdr->GetStringProperty("storeToken", getter_Copies(fileName));
if (fileName.IsEmpty())
- return NS_ERROR_FAILURE;
-
- if (fileName.IsEmpty())
{
PR_LOG(MailDirLog, PR_LOG_ALWAYS,
("GetMsgInputStream - empty storeToken!!\n"));
return NS_ERROR_FAILURE;
}
- path->Append(NS_LITERAL_STRING("cur"));
- path->AppendNative(fileName);
+ nsCOMPtr srcFile;
+ rv = srcFolderPath->Clone(getter_AddRefs(srcFile));
+ NS_ENSURE_SUCCESS(rv, rv);
+ srcFile->AppendNative(fileName);
nsCOMPtr destFile;
destFolderPath->Clone(getter_AddRefs(destFile));
@@ -1044,26 +1085,33 @@
destFile->GetNativeLeafName(fileName);
}
if (aIsMove)
- path->MoveToNative(destFolderPath, fileName);
+ rv = srcFile->MoveToNative(destFolderPath, fileName);
else
- path->CopyToNative(destFolderPath, fileName);
+ rv = srcFile->CopyToNative(destFolderPath, fileName);
+ NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr destHdr;
if (destDB)
{
- rv = destDB->CopyHdrFromExistingHdr(nsMsgKey_None, msgHdr, true, getter_AddRefs(destHdr));
+ rv = destDB->CopyHdrFromExistingHdr(nsMsgKey_None, srcHdr, true, getter_AddRefs(destHdr));
NS_ENSURE_SUCCESS(rv, rv);
destHdr->SetStringProperty("storeToken", fileName.get());
dstHdrs->AppendElement(destHdr, false);
nsMsgKey dstKey;
destHdr->GetMessageKey(&dstKey);
msgTxn->AddDstKey(dstKey);
+ if (aListener)
+ aListener->SetMessageKey(dstKey);
}
}
nsCOMPtr notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
if (notifier)
notifier->NotifyMsgsMoveCopyCompleted(aIsMove, aHdrArray, aDstFolder,
dstHdrs);
+
+ // For now, we only support local dest folders, and for those we are done and
+ // can delete the messages. Perhaps this should be moved into the folder
+ // when we try to support other folder types.
if (aIsMove)
{
for (uint32_t i = 0; i < messageCount; ++i)
@@ -1072,11 +1120,11 @@
rv = srcDB->DeleteHeader(msgDBHdr, nullptr, false, true);
}
}
+
*aCopyDone = true;
nsCOMPtr srcSupports(do_QueryInterface(srcFolder));
- nsCOMPtr localDest(do_QueryInterface(aDstFolder));
- if (localDest)
- localDest->OnCopyCompleted(srcSupports, true);
+ if (destLocalFolder)
+ destLocalFolder->OnCopyCompleted(srcSupports, true);
if (aListener)
aListener->OnStopCopy(NS_OK);
msgTxn.forget(aUndoAction);
@@ -1359,6 +1407,12 @@
return NS_OK;
}
+NS_IMETHODIMP nsMsgMaildirStore::GetStoreType(nsACString& aType)
+{
+ aType.AssignLiteral("maildir");
+ return NS_OK;
+}
+
/**
* Finds the directory associated with this folder. That is if the path is
* c:\Inbox, it will return c:\Inbox.sbd if it succeeds. Path is strictly
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/addon-sdk/source/python-lib/cuddlefish/runner.py thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/addon-sdk/source/python-lib/cuddlefish/runner.py
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/addon-sdk/source/python-lib/cuddlefish/runner.py 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/addon-sdk/source/python-lib/cuddlefish/runner.py 2015-01-09 12:36:25.000000000 +0000
@@ -492,7 +492,6 @@
env['MOZ_DISABLE_NONLOCAL_CONNECTIONS'] = '1'
env['MOZ_NO_REMOTE'] = '1'
env['XPCOM_DEBUG_BREAK'] = 'stack'
- env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
env.update(extra_environment)
if norun:
cmdargs.append("-no-remote")
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/dolphin/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/dolphin/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/dolphin/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/dolphin/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -15,15 +15,15 @@
-
+
-
+
-
+
@@ -129,7 +129,7 @@
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -19,16 +19,16 @@
-
-
+
+
-
+
-
+
@@ -102,6 +102,7 @@
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-ics/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-ics/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-ics/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-ics/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -19,16 +19,16 @@
-
-
+
+
-
+
-
+
@@ -102,6 +102,7 @@
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-jb/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-jb/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-jb/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-jb/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -17,10 +17,10 @@
-
-
+
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-kk/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-kk/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/emulator-kk/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/emulator-kk/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -15,15 +15,15 @@
-
+
-
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -17,10 +17,10 @@
-
-
+
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame-kk/releng-flame-kk.tt thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame-kk/releng-flame-kk.tt
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame-kk/releng-flame-kk.tt 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame-kk/releng-flame-kk.tt 2015-01-09 12:36:27.000000000 +0000
@@ -1,9 +1,9 @@
[
{
-"size": 120750384,
-"digest": "0e0a0b0dcca020e3283ce8deb33d0eed48fab16ef2fd919120bd7b5abba00713210be17f466d11bf77cca3c9e3b663805be61774476cc669f0a75736d901edfd",
+"size": 135359412,
+"digest": "45e677c9606cc4eec44ef4761df47ff431df1ffad17a5c6d21ce700a1c47f79e87a4aa9f30ae47ff060bd64f5b775d995780d88211f9a759ffa0d076beb4816b",
"algorithm": "sha512",
"filename": "backup-flame.tar.xz",
-"comment": "v188-1"
+"comment": "v18D"
}
]
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame-kk/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame-kk/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/flame-kk/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/flame-kk/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -15,15 +15,15 @@
-
+
-
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/gaia.json thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/gaia.json
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/gaia.json 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/gaia.json 2015-01-09 12:36:27.000000000 +0000
@@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
- "revision": "6505a7b6b4c727a9b561c1220b4ecf726248c5c5",
+ "revision": "85bbbd703dba85b58c5b9d5902bc784c9f763c1d",
"repo_path": "integration/gaia-central"
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/hamachi/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/hamachi/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/hamachi/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/hamachi/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -17,11 +17,11 @@
-
-
+
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/helix/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/helix/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/helix/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/helix/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -15,8 +15,8 @@
-
-
+
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/nexus-4/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/nexus-4/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/nexus-4/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/nexus-4/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -17,10 +17,10 @@
-
-
+
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/wasabi/sources.xml thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/wasabi/sources.xml
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/config/wasabi/sources.xml 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/config/wasabi/sources.xml 2015-01-09 12:36:27.000000000 +0000
@@ -17,12 +17,12 @@
-
-
+
+
-
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/confvars.sh thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/confvars.sh
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/b2g/confvars.sh 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/b2g/confvars.sh 2015-01-09 12:36:27.000000000 +0000
@@ -59,6 +59,11 @@
if test "$OS_TARGET" = "Android"; then
MOZ_NUWA_PROCESS=1
MOZ_B2G_LOADER=1
+# Warnings-as-errors cannot be enabled on gcc <= 4.4 due to bug 915555.
+if test "$GCC_MAJOR_VERSION" -gt 4 -o \
+ "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -gt 4; then
+MOZ_ENABLE_WARNINGS_AS_ERRORS=1
+fi
fi
MOZ_JSDOWNLOADS=1
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/app/profile/firefox.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/app/profile/firefox.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/app/profile/firefox.js 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/app/profile/firefox.js 2015-01-09 12:36:27.000000000 +0000
@@ -862,7 +862,7 @@
#endif
// Toggles between the two Preferences implementations, pop-up window and in-content
-#ifndef RELEASE_BUILD
+#ifdef EARLY_BETA_OR_EARLIER
pref("browser.preferences.inContent", true);
pref("browser.preferences.instantApply", true);
#else
@@ -1644,6 +1644,7 @@
pref("loop.enabled", true);
pref("loop.server", "https://loop.services.mozilla.com/v0");
pref("loop.seenToS", "unseen");
+pref("loop.showPartnerLogo", true);
pref("loop.gettingStarted.seen", false);
pref("loop.gettingStarted.url", "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/hello/start/");
pref("loop.gettingStarted.resumeOnFirstJoin", false);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser-fxaccounts.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser-fxaccounts.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser-fxaccounts.js 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser-fxaccounts.js 2015-01-09 12:36:27.000000000 +0000
@@ -266,11 +266,6 @@
Weave.Notifications.removeAll(this.SYNC_MIGRATION_NOTIFICATION_TITLE);
return;
}
- if (gBrowser.currentURI.spec.split("?")[0] == "about:accounts") {
- // If the current tab is about:accounts, assume the user just completed a
- // migration step and don't bother them with a redundant notification.
- return;
- }
let note = null;
switch (this._migrationInfo.state) {
case this.fxaMigrator.STATE_USER_FXA: {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser.js 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser.js 2015-01-09 12:36:27.000000000 +0000
@@ -1738,7 +1738,7 @@
saveDocument(gBrowser.selectedBrowser.contentDocumentAsCPOW);
break;
case "SendMail":
- MailIntegration.sendLinkForWindow(window.content);
+ MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);
break;
default:
return;
@@ -2643,11 +2643,6 @@
let transportSecurityInfo = serhelper.deserializeObject(securityInfo);
transportSecurityInfo.QueryInterface(Ci.nsITransportSecurityInfo)
- if (transportSecurityInfo.failedCertChain == null) {
- Cu.reportError("transportSecurityInfo didn't have a failedCertChain for a failedChannel");
- return;
- }
-
showReportStatus("activity");
/*
@@ -2677,11 +2672,14 @@
// Convert the nsIX509CertList into a format that can be parsed into
// JSON
let asciiCertChain = [];
- let certs = transportSecurityInfo.failedCertChain.getEnumerator();
- while (certs.hasMoreElements()) {
- let cert = certs.getNext();
- cert.QueryInterface(Ci.nsIX509Cert);
- asciiCertChain.push(btoa(getDERString(cert)));
+
+ if (transportSecurityInfo.failedCertChain) {
+ let certs = transportSecurityInfo.failedCertChain.getEnumerator();
+ while (certs.hasMoreElements()) {
+ let cert = certs.getNext();
+ cert.QueryInterface(Ci.nsIX509Cert);
+ asciiCertChain.push(btoa(getDERString(cert)));
+ }
}
let report = {
@@ -6526,9 +6524,8 @@
}
var MailIntegration = {
- sendLinkForWindow: function (aWindow) {
- this.sendMessage(aWindow.location.href,
- aWindow.document.title);
+ sendLinkForBrowser: function (aBrowser) {
+ this.sendMessage(aBrowser.currentURI.spec, aBrowser.contentTitle);
},
sendMessage: function (aBody, aSubject) {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser-sets.inc thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser-sets.inc
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/browser-sets.inc 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/browser-sets.inc 2015-01-09 12:36:27.000000000 +0000
@@ -25,7 +25,7 @@
+ oncommand="MailIntegration.sendLinkForBrowser(gBrowser.selectedBrowser);"/>
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_bug846489_content.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_bug846489_content.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_bug846489_content.js 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_bug846489_content.js 1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
-addMessageListener("Browser:SSLErrorReportStatus", function(message) {
- sendSyncMessage("ssler-test:SSLErrorReportStatus", {reportStatus:message.data.reportStatus});
-});
-
-addMessageListener("ssler-test:SetAutoPref", function(message) {
- let checkbox = content.document.getElementById("automaticallyReportInFuture");
-
- // we use "click" because otherwise the 'changed' event will not fire
- if (checkbox.checked != message.data.value) {
- checkbox.click();
- }
-
- sendSyncMessage("ssler-test:AutoPrefUpdated", {});
-});
-
-addMessageListener("ssler-test:SendBtnClick", function(message) {
- if (message.data && message.data.forceUI) {
- content.dispatchEvent(new content.CustomEvent("AboutNetErrorOptions",
- {
- detail: "{\"enabled\": true, \"automatic\": false}"
- }));
- }
- let btn = content.document.getElementById("reportCertificateError");
- btn.click();
-});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_bug846489.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_bug846489.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_bug846489.js 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_bug846489.js 1970-01-01 00:00:00.000000000 +0000
@@ -1,327 +0,0 @@
-var badPin = "https://include-subdomains.pinning.example.com";
-var enabledPref = false;
-var automaticPref = false;
-var urlPref = "security.ssl.errorReporting.url";
-var enforcement_level = 1;
-
-function loadFrameScript() {
- let mm = Cc["@mozilla.org/globalmessagemanager;1"]
- .getService(Ci.nsIMessageListenerManager);
- const ROOT = getRootDirectory(gTestPath);
- mm.loadFrameScript(ROOT+"browser_bug846489_content.js", true);
-}
-
-add_task(function*(){
- waitForExplicitFinish();
- loadFrameScript();
- SimpleTest.requestCompleteLog();
- yield testSendReportDisabled();
- yield testSendReportManual();
- yield testSendReportAuto();
- yield testSendReportError();
- yield testSetAutomatic();
-});
-
-// creates a promise of the message in an error page
-function createNetworkErrorMessagePromise(aBrowser) {
- return new Promise(function(resolve, reject) {
- // Error pages do not fire "load" events, so use a progressListener.
- var originalDocumentURI = aBrowser.contentDocument.documentURI;
-
- var progressListener = {
- onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
- // Make sure nothing other than an error page is loaded.
- if (!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE)) {
- reject("location change was not to an error page");
- }
- },
-
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
- let doc = aBrowser.contentDocument;
-
- if (doc.getElementById("reportCertificateError")) {
- // Wait until the documentURI changes (from about:blank) this should
- // be the error page URI.
- var documentURI = doc.documentURI;
- if (documentURI == originalDocumentURI) {
- return;
- }
-
- aWebProgress.removeProgressListener(progressListener,
- Ci.nsIWebProgress.NOTIFY_LOCATION |
- Ci.nsIWebProgress.NOTIFY_STATE_REQUEST);
- var matchArray = /about:neterror\?.*&d=([^&]*)/.exec(documentURI);
- if (!matchArray) {
- reject("no network error message found in URI")
- return;
- }
-
- var errorMsg = matchArray[1];
- resolve(decodeURIComponent(errorMsg));
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference])
- };
-
- aBrowser.addProgressListener(progressListener,
- Ci.nsIWebProgress.NOTIFY_LOCATION |
- Ci.nsIWebProgress.NOTIFY_STATE_REQUEST);
- });
-}
-
-// check we can set the 'automatically send' pref
-let testSetAutomatic = Task.async(function*() {
- setup();
- let tab = gBrowser.addTab(badPin, {skipAnimation: true});
- let browser = tab.linkedBrowser;
- let mm = browser.messageManager;
-
- gBrowser.selectedTab = tab;
-
- // ensure we have the correct error message from about:neterror
- let netError = createNetworkErrorMessagePromise(browser);
- yield netError;
-
- // ensure that setting automatic when unset works
- let prefEnabled = new Promise(function(resolve, reject){
- mm.addMessageListener("ssler-test:AutoPrefUpdated", function() {
- if (Services.prefs.getBoolPref("security.ssl.errorReporting.automatic")) {
- resolve();
- } else {
- reject();
- }
- });
- });
-
- mm.sendAsyncMessage("ssler-test:SetAutoPref",{value:true});
-
- yield prefEnabled;
-
- // ensure un-setting automatic, when set, works
- let prefDisabled = new Promise(function(resolve, reject){
- mm.addMessageListener("ssler-test:AutoPrefUpdated", function () {
- if (!Services.prefs.getBoolPref("security.ssl.errorReporting.automatic")) {
- resolve();
- } else {
- reject();
- }
- });
- });
-
- mm.sendAsyncMessage("ssler-test:SetAutoPref",{value:false});
-
- yield prefDisabled;
-
- gBrowser.removeTab(tab);
- cleanup();
-});
-
-// test that manual report sending (with button clicks) works
-let testSendReportManual = Task.async(function*() {
- setup();
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
- Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?succeed");
-
- let tab = gBrowser.addTab(badPin, {skipAnimation: true});
- let browser = tab.linkedBrowser;
- let mm = browser.messageManager;
-
- gBrowser.selectedTab = tab;
-
- // ensure we have the correct error message from about:neterror
- let netError = createNetworkErrorMessagePromise(browser);
- yield netError;
- netError.then(function(val){
- is(val.startsWith("An error occurred during a connection to include-subdomains.pinning.example.com"), true ,"ensure the correct error message came from about:neterror");
- });
-
- // Check the report starts on click
- let btn = browser.contentDocument.getElementById("reportCertificateError");
-
- // check the content script sends the message to report
- let reportWillStart = new Promise(function(resolve, reject){
- mm.addMessageListener("Browser:SendSSLErrorReport", function() {
- resolve();
- });
- });
-
- let deferredReportActivity = Promise.defer()
- let deferredReportSucceeds = Promise.defer();
-
- // ensure we see the correct statuses in the correct order...
- mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
- switch(message.data.reportStatus) {
- case "activity":
- deferredReportActivity.resolve(message.data.reportStatus);
- break;
- case "complete":
- deferredReportSucceeds.resolve(message.data.reportStatus);
- break;
- case "error":
- deferredReportSucceeds.reject();
- deferredReportActivity.reject();
- break;
- }
- });
-
- // ... once the button is clicked, that is
- mm.sendAsyncMessage("ssler-test:SendBtnClick",{});
-
- yield reportWillStart;
-
- yield deferredReportActivity.promise;
- yield deferredReportSucceeds.promise;
-
- gBrowser.removeTab(tab);
- cleanup();
-});
-
-// test that automatic sending works
-let testSendReportAuto = Task.async(function*() {
- setup();
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
- Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", true);
- Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?succeed");
-
- let tab = gBrowser.addTab(badPin, {skipAnimation: true});
- let browser = tab.linkedBrowser;
- let mm = browser.messageManager;
-
- gBrowser.selectedTab = tab;
-
- let reportWillStart = Promise.defer();
- mm.addMessageListener("Browser:SendSSLErrorReport", function() {
- reportWillStart.resolve();
- });
-
- let deferredReportActivity = Promise.defer();
- let deferredReportSucceeds = Promise.defer();
-
- mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
- switch(message.data.reportStatus) {
- case "activity":
- deferredReportActivity.resolve(message.data.reportStatus);
- break;
- case "complete":
- deferredReportSucceeds.resolve(message.data.reportStatus);
- break;
- case "error":
- deferredReportSucceeds.reject();
- deferredReportActivity.reject();
- break;
- }
- });
-
- // Ensure the error page loads
- let netError = createNetworkErrorMessagePromise(browser);
- yield netError;
-
- // Ensure the reporting steps all occur with no interaction
- yield reportWillStart;
- yield deferredReportActivity.promise;
- yield deferredReportSucceeds.promise;
-
- gBrowser.removeTab(tab);
- cleanup();
-});
-
-// test that an error is shown if there's a problem with the report server
-let testSendReportError = Task.async(function*() {
- setup();
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
- Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", true);
- Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?error");
-
- let tab = gBrowser.addTab(badPin, {skipAnimation: true});
- let browser = tab.linkedBrowser;
- let mm = browser.messageManager;
-
- gBrowser.selectedTab = tab;
-
- // check the report send starts....
- let reportWillStart = new Promise(function(resolve, reject){
- mm.addMessageListener("Browser:SendSSLErrorReport", function() {
- resolve();
- });
- });
-
- let netError = createNetworkErrorMessagePromise(browser);
- yield netError;
- yield reportWillStart;
-
- // and that errors are seen
- let reportErrors = new Promise(function(resolve, reject) {
- mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
- switch(message.data.reportStatus) {
- case "complete":
- reject(message.data.reportStatus);
- break;
- case "error":
- resolve(message.data.reportStatus);
- break;
- }
- });
- });
-
- yield reportErrors;
-
- gBrowser.removeTab(tab);
- cleanup();
-});
-
-let testSendReportDisabled = Task.async(function*() {
- setup();
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", false);
- Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://offdomain.com");
-
- let tab = gBrowser.addTab(badPin, {skipAnimation: true});
- let browser = tab.linkedBrowser;
- let mm = browser.messageManager;
-
- gBrowser.selectedTab = tab;
-
- // Ensure we have an error page
- let netError = createNetworkErrorMessagePromise(browser);
- yield netError;
-
- let reportErrors = new Promise(function(resolve, reject) {
- mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
- switch(message.data.reportStatus) {
- case "complete":
- reject(message.data.reportStatus);
- break;
- case "error":
- resolve(message.data.reportStatus);
- break;
- }
- });
- });
-
- // click the button
- mm.sendAsyncMessage("ssler-test:SendBtnClick",{forceUI:true});
-
- // check we get an error
- yield reportErrors;
-
- gBrowser.removeTab(tab);
- cleanup();
-});
-
-function setup() {
- // ensure the relevant prefs are set
- enabledPref = Services.prefs.getBoolPref("security.ssl.errorReporting.enabled");
- automaticPref = Services.prefs.getBoolPref("security.ssl.errorReporting.automatic");
- urlPref = Services.prefs.getCharPref("security.ssl.errorReporting.url");
-
- enforcement_level = Services.prefs.getIntPref("security.cert_pinning.enforcement_level");
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
-}
-
-function cleanup() {
- // reset prefs for other tests in the run
- Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", enabledPref);
- Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", automaticPref);
- Services.prefs.setCharPref("security.ssl.errorReporting.url", urlPref);
-}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser.ini 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser.ini 2015-01-09 12:36:28.000000000 +0000
@@ -10,10 +10,10 @@
browser_bug479408_sample.html
browser_bug678392-1.html
browser_bug678392-2.html
- browser_bug846489_content.js
browser_bug970746.xhtml
browser_fxa_oauth.html
browser_registerProtocolHandler_notification.html
+ browser_ssl_error_reports_content.js
browser_star_hsts.sjs
browser_tab_dragdrop2_frame1.xul
browser_web_channel.html
@@ -153,7 +153,6 @@
[browser_bug419612.js]
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug422590.js]
-[browser_bug846489.js]
[browser_bug423833.js]
skip-if = true # bug 428712
[browser_bug424101.js]
@@ -399,6 +398,7 @@
searchSuggestionUI.html
searchSuggestionUI.js
[browser_selectTabAtIndex.js]
+[browser_ssl_error_reports.js]
[browser_star_hsts.js]
[browser_subframe_favicons_not_used.js]
[browser_tabDrop.js]
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_ssl_error_reports_content.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_ssl_error_reports_content.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_ssl_error_reports_content.js 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_ssl_error_reports_content.js 2015-01-09 12:36:28.000000000 +0000
@@ -0,0 +1,25 @@
+addMessageListener("Browser:SSLErrorReportStatus", function(message) {
+ sendSyncMessage("ssler-test:SSLErrorReportStatus", {reportStatus:message.data.reportStatus});
+});
+
+addMessageListener("ssler-test:SetAutoPref", function(message) {
+ let checkbox = content.document.getElementById("automaticallyReportInFuture");
+
+ // we use "click" because otherwise the 'changed' event will not fire
+ if (checkbox.checked != message.data.value) {
+ checkbox.click();
+ }
+
+ sendSyncMessage("ssler-test:AutoPrefUpdated", {});
+});
+
+addMessageListener("ssler-test:SendBtnClick", function(message) {
+ if (message.data && message.data.forceUI) {
+ content.dispatchEvent(new content.CustomEvent("AboutNetErrorOptions",
+ {
+ detail: "{\"enabled\": true, \"automatic\": false}"
+ }));
+ }
+ let btn = content.document.getElementById("reportCertificateError");
+ btn.click();
+});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_ssl_error_reports.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_ssl_error_reports.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/browser_ssl_error_reports.js 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/browser_ssl_error_reports.js 2015-01-09 12:36:28.000000000 +0000
@@ -0,0 +1,331 @@
+let badChainURL = "https://badchain.include-subdomains.pinning.example.com";
+let noCertURL = "https://fail-handshake.example.com";
+let enabledPref = false;
+let automaticPref = false;
+let urlPref = "security.ssl.errorReporting.url";
+let enforcement_level = 1;
+
+function loadFrameScript() {
+ let mm = Cc["@mozilla.org/globalmessagemanager;1"]
+ .getService(Ci.nsIMessageListenerManager);
+ const ROOT = getRootDirectory(gTestPath);
+ mm.loadFrameScript(ROOT + "browser_ssl_error_reports_content.js", true);
+}
+
+add_task(function*(){
+ waitForExplicitFinish();
+ loadFrameScript();
+ SimpleTest.requestCompleteLog();
+ yield testSendReportDisabled();
+ yield testSendReportManual(badChainURL, "succeed");
+ yield testSendReportManual(noCertURL, "nocert");
+ yield testSendReportAuto();
+ yield testSendReportError();
+ yield testSetAutomatic();
+});
+
+// creates a promise of the message in an error page
+function createNetworkErrorMessagePromise(aBrowser) {
+ return new Promise(function(resolve, reject) {
+ // Error pages do not fire "load" events, so use a progressListener.
+ let originalDocumentURI = aBrowser.contentDocument.documentURI;
+
+ let progressListener = {
+ onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
+ // Make sure nothing other than an error page is loaded.
+ if (!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE)) {
+ reject("location change was not to an error page");
+ }
+ },
+
+ onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
+ let doc = aBrowser.contentDocument;
+
+ if (doc.getElementById("reportCertificateError")) {
+ // Wait until the documentURI changes (from about:blank) this should
+ // be the error page URI.
+ let documentURI = doc.documentURI;
+ if (documentURI == originalDocumentURI) {
+ return;
+ }
+
+ aWebProgress.removeProgressListener(progressListener,
+ Ci.nsIWebProgress.NOTIFY_LOCATION |
+ Ci.nsIWebProgress.NOTIFY_STATE_REQUEST);
+ let matchArray = /about:neterror\?.*&d=([^&]*)/.exec(documentURI);
+ if (!matchArray) {
+ reject("no network error message found in URI")
+ return;
+ }
+
+ let errorMsg = matchArray[1];
+ resolve(decodeURIComponent(errorMsg));
+ }
+ },
+
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
+ Ci.nsISupportsWeakReference])
+ };
+
+ aBrowser.addProgressListener(progressListener,
+ Ci.nsIWebProgress.NOTIFY_LOCATION |
+ Ci.nsIWebProgress.NOTIFY_STATE_REQUEST);
+ });
+}
+
+// check we can set the 'automatically send' pref
+let testSetAutomatic = Task.async(function*() {
+ setup();
+ let tab = gBrowser.addTab(badChainURL, {skipAnimation: true});
+ let browser = tab.linkedBrowser;
+ let mm = browser.messageManager;
+
+ gBrowser.selectedTab = tab;
+
+ // ensure we have the correct error message from about:neterror
+ let netError = createNetworkErrorMessagePromise(browser);
+ yield netError;
+
+ // ensure that setting automatic when unset works
+ let prefEnabled = new Promise(function(resolve, reject){
+ mm.addMessageListener("ssler-test:AutoPrefUpdated", function() {
+ if (Services.prefs.getBoolPref("security.ssl.errorReporting.automatic")) {
+ resolve();
+ } else {
+ reject();
+ }
+ });
+ });
+
+ mm.sendAsyncMessage("ssler-test:SetAutoPref",{value:true});
+
+ yield prefEnabled;
+
+ // ensure un-setting automatic, when set, works
+ let prefDisabled = new Promise(function(resolve, reject){
+ mm.addMessageListener("ssler-test:AutoPrefUpdated", function () {
+ if (!Services.prefs.getBoolPref("security.ssl.errorReporting.automatic")) {
+ resolve();
+ } else {
+ reject();
+ }
+ });
+ });
+
+ mm.sendAsyncMessage("ssler-test:SetAutoPref",{value:false});
+
+ yield prefDisabled;
+
+ gBrowser.removeTab(tab);
+ cleanup();
+});
+
+// test that manual report sending (with button clicks) works
+let testSendReportManual = Task.async(function*(testURL, suffix) {
+ setup();
+ Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
+ Services.prefs.setCharPref("security.ssl.errorReporting.url",
+ "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?" + suffix);
+
+ let tab = gBrowser.addTab(testURL, {skipAnimation: true});
+ let browser = tab.linkedBrowser;
+ let mm = browser.messageManager;
+
+ gBrowser.selectedTab = tab;
+
+ // ensure we have the correct error message from about:neterror
+ let netError = createNetworkErrorMessagePromise(browser);
+ yield netError;
+ netError.then(function(val){
+ is(val.startsWith("An error occurred during a connection to"), true,
+ "ensure the correct error message came from about:neterror");
+ });
+
+ // Check the report starts on click
+ let btn = browser.contentDocument.getElementById("reportCertificateError");
+
+ // check the content script sends the message to report
+ let reportWillStart = new Promise(function(resolve, reject){
+ mm.addMessageListener("Browser:SendSSLErrorReport", function() {
+ resolve();
+ });
+ });
+
+ let deferredReportActivity = Promise.defer()
+ let deferredReportSucceeds = Promise.defer();
+
+ // ensure we see the correct statuses in the correct order...
+ mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
+ switch(message.data.reportStatus) {
+ case "activity":
+ deferredReportActivity.resolve(message.data.reportStatus);
+ break;
+ case "complete":
+ deferredReportSucceeds.resolve(message.data.reportStatus);
+ break;
+ case "error":
+ deferredReportSucceeds.reject();
+ deferredReportActivity.reject();
+ break;
+ }
+ });
+
+ // ... once the button is clicked, that is
+ mm.sendAsyncMessage("ssler-test:SendBtnClick",{});
+
+ yield reportWillStart;
+
+ yield deferredReportActivity.promise;
+ yield deferredReportSucceeds.promise;
+
+ gBrowser.removeTab(tab);
+ cleanup();
+});
+
+// test that automatic sending works
+let testSendReportAuto = Task.async(function*() {
+ setup();
+ Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
+ Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", true);
+ Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?succeed");
+
+ let tab = gBrowser.addTab(badChainURL, {skipAnimation: true});
+ let browser = tab.linkedBrowser;
+ let mm = browser.messageManager;
+
+ gBrowser.selectedTab = tab;
+
+ let reportWillStart = Promise.defer();
+ mm.addMessageListener("Browser:SendSSLErrorReport", function() {
+ reportWillStart.resolve();
+ });
+
+ let deferredReportActivity = Promise.defer();
+ let deferredReportSucceeds = Promise.defer();
+
+ mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
+ switch(message.data.reportStatus) {
+ case "activity":
+ deferredReportActivity.resolve(message.data.reportStatus);
+ break;
+ case "complete":
+ deferredReportSucceeds.resolve(message.data.reportStatus);
+ break;
+ case "error":
+ deferredReportSucceeds.reject();
+ deferredReportActivity.reject();
+ break;
+ }
+ });
+
+ // Ensure the error page loads
+ let netError = createNetworkErrorMessagePromise(browser);
+ yield netError;
+
+ // Ensure the reporting steps all occur with no interaction
+ yield reportWillStart;
+ yield deferredReportActivity.promise;
+ yield deferredReportSucceeds.promise;
+
+ gBrowser.removeTab(tab);
+ cleanup();
+});
+
+// test that an error is shown if there's a problem with the report server
+let testSendReportError = Task.async(function*() {
+ setup();
+ Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", true);
+ Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", true);
+ Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://example.com/browser/browser/base/content/test/general/pinning_reports.sjs?error");
+
+ let tab = gBrowser.addTab(badChainURL, {skipAnimation: true});
+ let browser = tab.linkedBrowser;
+ let mm = browser.messageManager;
+
+ gBrowser.selectedTab = tab;
+
+ // check the report send starts....
+ let reportWillStart = new Promise(function(resolve, reject){
+ mm.addMessageListener("Browser:SendSSLErrorReport", function() {
+ resolve();
+ });
+ });
+
+ let netError = createNetworkErrorMessagePromise(browser);
+ yield netError;
+ yield reportWillStart;
+
+ // and that errors are seen
+ let reportErrors = new Promise(function(resolve, reject) {
+ mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
+ switch(message.data.reportStatus) {
+ case "complete":
+ reject(message.data.reportStatus);
+ break;
+ case "error":
+ resolve(message.data.reportStatus);
+ break;
+ }
+ });
+ });
+
+ yield reportErrors;
+
+ gBrowser.removeTab(tab);
+ cleanup();
+});
+
+let testSendReportDisabled = Task.async(function*() {
+ setup();
+ Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", false);
+ Services.prefs.setCharPref("security.ssl.errorReporting.url", "https://offdomain.com");
+
+ let tab = gBrowser.addTab(badChainURL, {skipAnimation: true});
+ let browser = tab.linkedBrowser;
+ let mm = browser.messageManager;
+
+ gBrowser.selectedTab = tab;
+
+ // Ensure we have an error page
+ let netError = createNetworkErrorMessagePromise(browser);
+ yield netError;
+
+ let reportErrors = new Promise(function(resolve, reject) {
+ mm.addMessageListener("ssler-test:SSLErrorReportStatus", function(message) {
+ switch(message.data.reportStatus) {
+ case "complete":
+ reject(message.data.reportStatus);
+ break;
+ case "error":
+ resolve(message.data.reportStatus);
+ break;
+ }
+ });
+ });
+
+ // click the button
+ mm.sendAsyncMessage("ssler-test:SendBtnClick",{forceUI:true});
+
+ // check we get an error
+ yield reportErrors;
+
+ gBrowser.removeTab(tab);
+ cleanup();
+});
+
+function setup() {
+ // ensure the relevant prefs are set
+ enabledPref = Services.prefs.getBoolPref("security.ssl.errorReporting.enabled");
+ automaticPref = Services.prefs.getBoolPref("security.ssl.errorReporting.automatic");
+ urlPref = Services.prefs.getCharPref("security.ssl.errorReporting.url");
+
+ enforcement_level = Services.prefs.getIntPref("security.cert_pinning.enforcement_level");
+ Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
+}
+
+function cleanup() {
+ // reset prefs for other tests in the run
+ Services.prefs.setBoolPref("security.ssl.errorReporting.enabled", enabledPref);
+ Services.prefs.setBoolPref("security.ssl.errorReporting.automatic", automaticPref);
+ Services.prefs.setCharPref("security.ssl.errorReporting.url", urlPref);
+}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/pinning_reports.sjs thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/pinning_reports.sjs
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/base/content/test/general/pinning_reports.sjs 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/base/content/test/general/pinning_reports.sjs 2015-01-09 12:36:28.000000000 +0000
@@ -3,39 +3,67 @@
"MIIC2jCCAcKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAmMSQwIgYDVQQDExtBbHRlcm5hdGUgVHJ1c3RlZCBBdXRob3JpdHkwHhcNMTQwOTI1MjEyMTU0WhcNMjQwOTI1MjEyMTU0WjAmMSQwIgYDVQQDExtBbHRlcm5hdGUgVHJ1c3RlZCBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDBT+BwAhO52IWgSIdZZifU9LHOs3IR/+8DCC0WP5d/OuyKlZ6Rqd0tsd3i7durhQyjHSbLf2lJStcnFjcVEbEnNI76RuvlN8xLLn5eV+2Ayr4cZYKztudwRmw+DV/iYAiMSy0hs7m3ssfX7qpoi1aNRjUanwU0VTCPQhF1bEKAC2du+C5Z8e92zN5t87w7bYr7lt+m8197XliXEu+0s9RgnGwGaZ296BIRz6NOoJYTa43n06LU1I1+Z4d6lPdzUFrSR0GBaMhUSurUBtOin3yWiMhg1VHX/KwqGc4als5GyCVXy8HGrA/0zQPOhetxrlhEVAdK/xBt7CZvByj1Rcc7AgMBAAGjEzARMA8GA1UdEwQIMAYBAf8CAQAwDQYJKoZIhvcNAQELBQADggEBAJq/hogSRqzPWTwX4wTn/DVSNdWwFLv53qep9YrSMJ8ZsfbfK9Es4VP4dBLRQAVMJ0Z5mW1I6d/n0KayTanuUBvemYdxPi/qQNSs8UJcllqdhqWzmzAg6a0LxrMnEeKzPBPD6q8PwQ7tYP+B4sBN9tnnsnyPgti9ZiNZn5FwXZliHXseQ7FE9/SqHlLw5LXW3YtKjuti6RmuV6fq3j+D4oeC5vb1mKgIyoTqGN6ze57v8RHi+pQ8Q+kmoUn/L3Z2YmFe4SKN/4WoyXr8TdejpThGOCGCAd3565s5gOx5QfSQX11P8NZKO8hcN0tme3VzmGpHK0Z/6MTmdpNaTwQ6odk="
];
-function handleRequest(request, response)
-{
- if (request.queryString === "succeed") {
- // read the report from the client
- let inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
- inputStream.init(request.bodyInputStream, 0x01, 0004, 0);
-
- let body = "";
- if (inputStream) {
- while (inputStream.available()) {
- body = body + inputStream.read(inputStream.available());
- }
+function parseReport(request) {
+ // read the report from the request
+ let inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream);
+ inputStream.init(request.bodyInputStream, 0x01, 0004, 0);
+
+ let body = "";
+ if (inputStream) {
+ while (inputStream.available()) {
+ body = body + inputStream.read(inputStream.available());
}
- // parse the report
- let report = JSON.parse(body);
- let certChain = report.failedCertChain;
-
- // ensure the cert chain is what we expect
- for (idx in certChain) {
- if (certChain[idx] !== EXPECTED_CHAIN[idx]) {
- // if the chain differs, send an error response to cause test
- // failure
+ }
+ // parse the report
+ return JSON.parse(body);
+}
+
+function handleRequest(request, response) {
+ let report = {};
+ let certChain = [];
+
+ switch (request.queryString) {
+ case "succeed":
+ report = parseReport(request);
+ certChain = report.failedCertChain;
+
+ // ensure the cert chain is what we expect
+ for (idx in certChain) {
+ if (certChain[idx] !== EXPECTED_CHAIN[idx]) {
+ // if the chain differs, send an error response to cause test
+ // failure
+ response.setStatusLine("1.1", 500, "Server error");
+ response.write("The report contained an unexpected chain");
+ return;
+ }
+ }
+
+ // if all is as expected, send the 201 the client expects
+ response.setStatusLine("1.1", 201, "Created");
+ response.write("OK");
+ break;
+ case "nocert":
+ report = parseReport(request);
+ certChain = report.failedCertChain;
+
+ if (certChain && certChain.length > 0) {
+ // We're not expecting a chain; if there is one, send an error
response.setStatusLine("1.1", 500, "Server error");
response.write("The report contained an unexpected chain");
return;
}
- }
- // if all is as expected, send the 201 the client expects
- response.setStatusLine("1.1", 201, "Created");
- response.write("OK");
- } else if (request.queryString === "error") {
- response.setStatusLine("1.1", 500, "Server error");
- response.write("server error");
+ // if all is as expected, send the 201 the client expects
+ response.setStatusLine("1.1", 201, "Created");
+ response.write("OK");
+ break;
+ case "error":
+ response.setStatusLine("1.1", 500, "Server error");
+ response.write("server error");
+ break;
+ default:
+ response.setStatusLine("1.1", 500, "Server error");
+ response.write("succeed, nocert or error expected");
+ break;
}
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/customizableui/CustomizableWidgets.jsm thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/customizableui/CustomizableWidgets.jsm
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/customizableui/CustomizableWidgets.jsm 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/customizableui/CustomizableWidgets.jsm 2015-01-09 12:36:29.000000000 +0000
@@ -920,7 +920,7 @@
tooltiptext: "email-link-button.tooltiptext3",
onCommand: function(aEvent) {
let win = aEvent.view;
- win.MailIntegration.sendLinkForWindow(win.content);
+ win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser)
}
}, {
id: "loop-button",
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/js/panel.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/js/panel.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/js/panel.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/js/panel.js 2015-01-09 12:36:30.000000000 +0000
@@ -201,13 +201,29 @@
return {
seenToS: getPref("seenToS"),
- gettingStartedSeen: getPref("gettingStarted.seen")
+ gettingStartedSeen: getPref("gettingStarted.seen"),
+ showPartnerLogo: getPref("showPartnerLogo")
};
},
+ renderPartnerLogo: function() {
+ if (!this.state.showPartnerLogo) {
+ return null;
+ }
+
+ var locale = mozL10n.getLanguage();
+ navigator.mozLoop.setLoopPref('showPartnerLogo', false);
+ return (
+ React.createElement("p", {id: "powered-by", className: "powered-by"},
+ mozL10n.get("powered_by_beforeLogo"),
+ React.createElement("img", {id: "powered-by-logo", className: locale}),
+ mozL10n.get("powered_by_afterLogo")
+ )
+ );
+ },
+
render: function() {
if (!this.state.gettingStartedSeen || this.state.seenToS == "unseen") {
- var locale = mozL10n.getLanguage();
var terms_of_use_url = navigator.mozLoop.getLoopPref('legal.ToS_url');
var privacy_notice_url = navigator.mozLoop.getLoopPref('legal.privacy_url');
var tosHTML = mozL10n.get("legal_text_and_links3", {
@@ -224,11 +240,7 @@
),
});
return React.createElement("div", {id: "powered-by-wrapper"},
- React.createElement("p", {id: "powered-by"},
- mozL10n.get("powered_by_beforeLogo"),
- React.createElement("img", {id: "powered-by-logo", className: locale}),
- mozL10n.get("powered_by_afterLogo")
- ),
+ this.renderPartnerLogo(),
React.createElement("p", {className: "terms-service",
dangerouslySetInnerHTML: {__html: tosHTML}})
);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/js/panel.jsx thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/js/panel.jsx
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/js/panel.jsx 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/js/panel.jsx 2015-01-09 12:36:30.000000000 +0000
@@ -201,13 +201,29 @@
return {
seenToS: getPref("seenToS"),
- gettingStartedSeen: getPref("gettingStarted.seen")
+ gettingStartedSeen: getPref("gettingStarted.seen"),
+ showPartnerLogo: getPref("showPartnerLogo")
};
},
+ renderPartnerLogo: function() {
+ if (!this.state.showPartnerLogo) {
+ return null;
+ }
+
+ var locale = mozL10n.getLanguage();
+ navigator.mozLoop.setLoopPref('showPartnerLogo', false);
+ return (
+
+ {mozL10n.get("powered_by_beforeLogo")}
+
+ {mozL10n.get("powered_by_afterLogo")}
+
+ );
+ },
+
render: function() {
if (!this.state.gettingStartedSeen || this.state.seenToS == "unseen") {
- var locale = mozL10n.getLanguage();
var terms_of_use_url = navigator.mozLoop.getLoopPref('legal.ToS_url');
var privacy_notice_url = navigator.mozLoop.getLoopPref('legal.privacy_url');
var tosHTML = mozL10n.get("legal_text_and_links3", {
@@ -224,11 +240,7 @@
),
});
return
-
- {mozL10n.get("powered_by_beforeLogo")}
-
- {mozL10n.get("powered_by_afterLogo")}
-
+ {this.renderPartnerLogo()}
;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/activeRoomStore.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/activeRoomStore.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/activeRoomStore.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/activeRoomStore.js 2015-01-09 12:36:30.000000000 +0000
@@ -203,6 +203,11 @@
* @param {sharedActions.SetupRoomInfo} actionData
*/
setupRoomInfo: function(actionData) {
+ if (this._onUpdateListener) {
+ console.error("Room info already set up!");
+ return;
+ }
+
this.setStoreState({
roomName: actionData.roomName,
roomOwner: actionData.roomOwner,
@@ -211,10 +216,11 @@
roomUrl: actionData.roomUrl
});
- this._mozLoop.rooms.on("update:" + actionData.roomToken,
- this._handleRoomUpdate.bind(this));
- this._mozLoop.rooms.on("delete:" + actionData.roomToken,
- this._handleRoomDelete.bind(this));
+ this._onUpdateListener = this._handleRoomUpdate.bind(this);
+ this._onDeleteListener = this._handleRoomDelete.bind(this);
+
+ this._mozLoop.rooms.on("update:" + actionData.roomToken, this._onUpdateListener);
+ this._mozLoop.rooms.on("delete:" + actionData.roomToken, this._onDeleteListener);
},
/**
@@ -390,10 +396,16 @@
windowUnload: function() {
this._leaveRoom(ROOM_STATES.CLOSING);
+ if (!this._onUpdateListener) {
+ return;
+ }
+
// If we're closing the window, we can stop listening to updates.
var roomToken = this.getStoreState().roomToken;
- this._mozLoop.rooms.off("update:" + roomToken);
- this._mozLoop.rooms.off("delete:" + roomToken);
+ this._mozLoop.rooms.off("update:" + roomToken, this._onUpdateListener);
+ this._mozLoop.rooms.off("delete:" + roomToken, this._onDeleteListener);
+ delete this._onUpdateListener;
+ delete this._onDeleteListener;
},
/**
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/feedbackViews.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/feedbackViews.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/feedbackViews.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/feedbackViews.js 2015-01-09 12:36:30.000000000 +0000
@@ -76,7 +76,7 @@
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing"),
- other: l10n.get("feedback_category_other")
+ other: l10n.get("feedback_category_other2")
};
},
@@ -119,8 +119,7 @@
handleCategoryChange: function(event) {
var category = event.target.value;
this.setState({
- category: category,
- description: category == "other" ? "" : this._getCategories()[category]
+ category: category
});
if (category == "other") {
this.refs.description.getDOMNode().focus();
@@ -131,10 +130,6 @@
this.setState({description: event.target.value});
},
- handleDescriptionFieldFocus: function(event) {
- this.setState({category: "other", description: ""});
- },
-
handleFormSubmit: function(event) {
event.preventDefault();
// XXX this feels ugly, we really want a feedbackActions object here.
@@ -146,8 +141,6 @@
},
render: function() {
- var descriptionDisplayValue = this.state.category === "other" ?
- this.state.description : "";
return (
React.createElement(FeedbackLayout, {title: l10n.get("feedback_what_makes_you_sad"),
reset: this.props.reset},
@@ -157,8 +150,7 @@
React.createElement("input", {type: "text", ref: "description", name: "description",
className: "feedback-description",
onChange: this.handleDescriptionFieldChange,
- onFocus: this.handleDescriptionFieldFocus,
- value: descriptionDisplayValue,
+ value: this.state.description,
placeholder:
l10n.get("feedback_custom_category_text_placeholder")})
),
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/feedbackViews.jsx thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/feedbackViews.jsx
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/content/shared/js/feedbackViews.jsx 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/content/shared/js/feedbackViews.jsx 2015-01-09 12:36:30.000000000 +0000
@@ -76,7 +76,7 @@
video_quality: l10n.get("feedback_category_video_quality"),
disconnected : l10n.get("feedback_category_was_disconnected"),
confusing: l10n.get("feedback_category_confusing"),
- other: l10n.get("feedback_category_other")
+ other: l10n.get("feedback_category_other2")
};
},
@@ -119,8 +119,7 @@
handleCategoryChange: function(event) {
var category = event.target.value;
this.setState({
- category: category,
- description: category == "other" ? "" : this._getCategories()[category]
+ category: category
});
if (category == "other") {
this.refs.description.getDOMNode().focus();
@@ -131,10 +130,6 @@
this.setState({description: event.target.value});
},
- handleDescriptionFieldFocus: function(event) {
- this.setState({category: "other", description: ""});
- },
-
handleFormSubmit: function(event) {
event.preventDefault();
// XXX this feels ugly, we really want a feedbackActions object here.
@@ -146,8 +141,6 @@
},
render: function() {
- var descriptionDisplayValue = this.state.category === "other" ?
- this.state.description : "";
return (
@@ -157,8 +150,7 @@
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/MozLoopAPI.jsm thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/MozLoopAPI.jsm
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/MozLoopAPI.jsm 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/MozLoopAPI.jsm 2015-01-09 12:36:30.000000000 +0000
@@ -43,13 +43,23 @@
* We can work around this by copying the properties we care about onto a regular
* object.
*
- * @param {Error} error Error object to copy
- * @param {nsIDOMWindow} targetWindow The content window to attach the API
+ * @param {Error|nsIException} error Error object to copy
+ * @param {nsIDOMWindow} targetWindow The content window to clone into
*/
const cloneErrorObject = function(error, targetWindow) {
let obj = new targetWindow.Error();
- for (let prop of Object.getOwnPropertyNames(error)) {
+ let props = Object.getOwnPropertyNames(error);
+ // nsIException properties are not enumerable, so we'll try to copy the most
+ // common and useful ones.
+ if (!props.length) {
+ props.push("message", "filename", "lineNumber", "columnNumber", "stack");
+ }
+ for (let prop of props) {
let value = error[prop];
+ // for nsIException objects, the property may not be defined.
+ if (typeof value == "undefined") {
+ continue;
+ }
if (typeof value != "string" && typeof value != "number") {
value = String(value);
}
@@ -78,6 +88,11 @@
return value;
}
+ // HAWK request errors contain an nsIException object inside `value`.
+ if (("error" in value) && (value.error instanceof Ci.nsIException)) {
+ value = value.error;
+ }
+
// Strip Function properties, since they can not be cloned across boundaries
// like this.
for (let prop of Object.getOwnPropertyNames(value)) {
@@ -87,7 +102,7 @@
}
// Inspect for an error this way, because the Error object is special.
- if (value.constructor.name == "Error") {
+ if (value.constructor.name == "Error" || value instanceof Ci.nsIException) {
return cloneErrorObject(value, targetWindow);
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/standalone/content/l10n/en-US/loop.properties thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/standalone/content/l10n/en-US/loop.properties
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/standalone/content/l10n/en-US/loop.properties 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/standalone/content/l10n/en-US/loop.properties 2015-01-09 12:36:30.000000000 +0000
@@ -74,7 +74,7 @@
feedback_category_video_quality=Video quality
feedback_category_was_disconnected=Was disconnected
feedback_category_confusing=Confusing
-feedback_category_other=Other:
+feedback_category_other2=Other
feedback_custom_category_text_placeholder=What went wrong?
feedback_submit_button=Submit
feedback_back_button=Back
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/standalone/content/libs/l10n-gaia-02ca67948fe8.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/standalone/content/libs/l10n-gaia-02ca67948fe8.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/standalone/content/libs/l10n-gaia-02ca67948fe8.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/standalone/content/libs/l10n-gaia-02ca67948fe8.js 2015-01-09 12:36:31.000000000 +0000
@@ -1241,11 +1241,19 @@
// Getting ready
function negotiate(available, requested, defaultLocale) {
- if (available.indexOf(requested[0]) === -1 ||
- requested[0] === defaultLocale) {
+ var supportedLocale;
+ for (var i = 0; i < requested.length; ++i) {
+ var locale = requested[i];
+ if (available.indexOf(locale) !== -1) {
+ supportedLocale = locale;
+ break;
+ }
+ }
+ if (!supportedLocale ||
+ supportedLocale === defaultLocale) {
return [defaultLocale];
} else {
- return [requested[0], defaultLocale];
+ return [supportedLocale, defaultLocale];
}
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/test/desktop-local/panel_test.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/test/desktop-local/panel_test.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/test/desktop-local/panel_test.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/test/desktop-local/panel_test.js 2015-01-09 12:36:31.000000000 +0000
@@ -1052,5 +1052,21 @@
TestUtils.findRenderedDOMComponentWithClass(view, "terms-service");
});
+ it("should render the telefonica logo after the first time use",
+ function() {
+ navigator.mozLoop.getLoopPref = function(key) {
+ return {
+ "gettingStarted.seen": false,
+ "seenToS": "unseen",
+ "showPartnerLogo": false
+ }[key];
+ };
+
+ var view = TestUtils.renderIntoDocument(
+ React.createElement(loop.panel.ToSView));
+
+ expect(view.getDOMNode().querySelector(".powered-by")).eql(null);
+ });
+
});
});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/test/shared/feedbackViews_test.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/test/shared/feedbackViews_test.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/loop/test/shared/feedbackViews_test.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/loop/test/shared/feedbackViews_test.js 2015-01-09 12:36:31.000000000 +0000
@@ -133,16 +133,6 @@
expect(comp.getDOMNode().querySelector("form button").disabled).eql(false);
});
- it("should empty the description field when a predefined category is " +
- "chosen",
- function() {
- clickSadFace(comp);
-
- fillSadFeedbackForm(comp, "confusing");
-
- expect(comp.getDOMNode().querySelector(".feedback-description").value).eql("");
- });
-
it("should enable the form submit button once a predefined category is " +
"chosen",
function() {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/preferences/cookies.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/preferences/cookies.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/components/preferences/cookies.js 2015-01-07 22:15:19.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/components/preferences/cookies.js 2015-01-09 12:36:31.000000000 +0000
@@ -555,7 +555,8 @@
let buttonLabel = this._bundle.getString("removeSelectedCookies");
let removeSelectedCookies = document.getElementById("removeSelectedCookies");
- removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel);
+ removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel)
+ .replace("#1", selectedCookieCount);
removeSelectedCookies.disabled = !(seln.count > 0);
},
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/debugger/test/browser_dbg_pretty-print-07.js 2015-01-09 12:36:33.000000000 +0000
@@ -35,8 +35,9 @@
}
function testPrettyPrinted({ error, source }) {
- ok(!error);
- ok(source.contains("\n "));
+ ok(!error, "Should not get an error while pretty-printing");
+ ok(source.contains("\n "),
+ "Source should be pretty-printed");
disablePrettyPrint();
}
@@ -45,8 +46,9 @@
}
function testUgly({ error, source }) {
- ok(!error);
- ok(!source.contains("\n "));
+ ok(!error, "Should not get an error while disabling pretty-printing");
+ ok(!source.contains("\n "),
+ "Source should not be pretty after disabling pretty-printing");
closeDebuggerAndFinish(gPanel);
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/debugger/test/code_math_bogus_map.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/debugger/test/code_math_bogus_map.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/debugger/test/code_math_bogus_map.js 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/debugger/test/code_math_bogus_map.js 2015-01-09 12:36:34.000000000 +0000
@@ -1,4 +1,4 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
function stopMe(){throw Error("boom");}try{stopMe();var a=1;a=a*2;}catch(e){};
-
+//# sourceMappingURL=bogus.map
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/scratchpad/test/browser_scratchpad_pprint_error_goto_line.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/scratchpad/test/browser_scratchpad_pprint_error_goto_line.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/scratchpad/test/browser_scratchpad_pprint_error_goto_line.js 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/scratchpad/test/browser_scratchpad_pprint_error_goto_line.js 2015-01-09 12:36:35.000000000 +0000
@@ -15,28 +15,38 @@
openScratchpad(runTests);
}, true);
- content.location = "data:text/html;charset=utf8,test Scratchpad pretty print error goto line.";
+ content.location = "data:text/html;charset=utf8,"
+ + "test Scratchpad pretty print error goto line.";
}
function testJumpToPrettyPrintError(sp, error, remark) {
info("will test jumpToLine after prettyPrint error" + remark);
- // CodeMirror lines and columns are 0-based, Scratchpad UI and error
- // stack are 1-based.
- is(/Invalid regexp flag \(3:10\)/.test(error), true, "prettyPrint expects error in editor text:\n" + error);
- const errorLine = 3, errorColumn = 10;
- const editorDoc = sp.editor.container.contentDocument;
- sp.editor.jumpToLine();
- const lineInput = editorDoc.querySelector("input");
- const errorLocation = lineInput.value;
- const [ inputLine, inputColumn ] = errorLocation.split(":");
- is(inputLine, errorLine, "jumpToLine input field is set from editor selection (line)");
- is(inputColumn, errorColumn, "jumpToLine input field is set from editor selection (column)");
- EventUtils.synthesizeKey("VK_RETURN", { }, editorDoc.defaultView);
- // CodeMirror lines and columns are 0-based, Scratchpad UI and error
- // stack are 1-based.
- const cursor = sp.editor.getCursor();
- is(inputLine, cursor.line + 1, "jumpToLine goto error location (line)");
- is(inputColumn, cursor.ch + 1, "jumpToLine goto error location (column)");
+
+ // CodeMirror lines and columns are 0-based, Scratchpad UI and error
+ // stack are 1-based.
+ is(/Invalid regular expression flag \(3:10\)/.test(error), true,
+ "prettyPrint expects error in editor text:\n" + error);
+
+ sp.editor.jumpToLine();
+
+ const editorDoc = sp.editor.container.contentDocument;
+ const lineInput = editorDoc.querySelector("input");
+ const errorLocation = lineInput.value;
+ const [ inputLine, inputColumn ] = errorLocation.split(":");
+ const errorLine = 3, errorColumn = 10;
+
+ is(inputLine, errorLine,
+ "jumpToLine input field is set from editor selection (line)");
+ is(inputColumn, errorColumn,
+ "jumpToLine input field is set from editor selection (column)");
+
+ EventUtils.synthesizeKey("VK_RETURN", { }, editorDoc.defaultView);
+
+ // CodeMirror lines and columns are 0-based, Scratchpad UI and error
+ // stack are 1-based.
+ const cursor = sp.editor.getCursor();
+ is(inputLine, cursor.line + 1, "jumpToLine goto error location (line)");
+ is(inputColumn, cursor.ch + 1, "jumpToLine goto error location (column)");
}
function runTests(sw, sp)
@@ -49,12 +59,14 @@
"// line 5",
""
].join("\n"));
+
sp.prettyPrint().then(aFulfill => {
ok(false, "Expecting Invalid regexp flag (3:10)");
finish();
}, error => {
testJumpToPrettyPrintError(sp, error, " (Bug 1005471, first time)");
});
+
sp.prettyPrint().then(aFulfill => {
ok(false, "Expecting Invalid regexp flag (3:10)");
finish();
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js 2015-01-09 12:36:36.000000000 +0000
@@ -13,26 +13,30 @@
get3(front, "create-node")
]);
- let t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
- yield oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
- yield oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
- yield oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.4, t2]);
- yield oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [1, t3]);
- yield oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [0.15, t4]);
- yield oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.75, t5]);
- yield oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [0.05, t6]);
+ yield oscNode.addAutomationEvent("frequency", "setValueAtTime", [300, 0.1]);
+ yield oscNode.addAutomationEvent("frequency", "linearRampToValueAtTime", [500, 0.4]);
+ yield oscNode.addAutomationEvent("frequency", "exponentialRampToValueAtTime", [200, 0.6]);
// End with a setTargetAtTime event, as the target approaches infinity, which will
// give us more points to render than the default 2000
- yield oscNode.addAutomationEvent("frequency", "setTargetAtTime", [1, t7, 0.5]);
+ yield oscNode.addAutomationEvent("frequency", "setTargetAtTime", [1000, 2, 0.5]);
- let { events, values } = yield oscNode.getAutomationData("frequency");
+ var { events, values } = yield oscNode.getAutomationData("frequency");
- is(events.length, 8, "8 recorded events returned.");
- is(values.length, 4000, "6000 value points returned when ending with exponentiall approaching automator.");
+ is(events.length, 4, "4 recorded events returned.");
+ is(values.length, 4000, "4000 value points returned when ending with exponentiall approaching automator.");
- checkAutomationValue(values, 1, 0.05);
- checkAutomationValue(values, 2, 0.87);
- checkAutomationValue(values, 3, 0.98);
+ checkAutomationValue(values, 2.01, 215.055)
+ checkAutomationValue(values, 2.1, 345.930);
+ checkAutomationValue(values, 3, 891.601);
+ checkAutomationValue(values, 5, 998.01);
+
+ // Refetch the automation data to ensure it recalculates correctly (bug 1118071)
+ var { events, values } = yield oscNode.getAutomationData("frequency");
+
+ checkAutomationValue(values, 2.01, 215.055)
+ checkAutomationValue(values, 2.1, 345.930);
+ checkAutomationValue(values, 3, 891.601);
+ checkAutomationValue(values, 5, 998.01);
yield removeTab(target.tab);
});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/webconsole/test/browser_webconsole_bug_599725_response_headers.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/webconsole/test/browser_webconsole_bug_599725_response_headers.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/devtools/webconsole/test/browser_webconsole_bug_599725_response_headers.js 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/devtools/webconsole/test/browser_webconsole_bug_599725_response_headers.js 2015-01-09 12:36:36.000000000 +0000
@@ -16,12 +16,6 @@
{
let deferred = promise.defer();
- loads++;
- ok(aRequest, "page load was logged");
- if (loads != 2) {
- return;
- }
-
let headers = null;
function readHeader(aName)
@@ -64,6 +58,11 @@
function waitForRequest() {
let deferred = promise.defer();
HUDService.lastFinishedRequest.callback = (req, console) => {
+ loads++;
+ ok(req, "page load was logged");
+ if (loads != 2) {
+ return;
+ }
performTest(req, console).then(deferred.resolve);
};
return deferred.promise;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/installer/Makefile.in thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/installer/Makefile.in
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/installer/Makefile.in 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/installer/Makefile.in 2015-01-09 12:36:37.000000000 +0000
@@ -147,6 +147,14 @@
ifdef CLANG_CL
DEFINES += -DCLANG_CL
endif
+ifeq (x86,$(CPU_ARCH))
+ifdef _MSC_VER
+ifndef CLANG_CL
+DEFINES += -DWOW_HELPER
+endif
+endif
+endif
+
libs::
$(MAKE) -C $(DEPTH)/browser/locales langpack
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/installer/package-manifest.in thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/installer/package-manifest.in
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/installer/package-manifest.in 2015-01-07 22:15:21.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/installer/package-manifest.in 2015-01-09 12:36:37.000000000 +0000
@@ -783,6 +783,9 @@
#if defined(MOZ_SANDBOX)
#if defined(XP_WIN)
@BINPATH@/@DLL_PREFIX@sandboxbroker@DLL_SUFFIX@
+#if defined(WOW_HELPER)
+@BINPATH@/wow_helper.exe
+#endif
#endif
#endif
@@ -895,13 +898,14 @@
@RESPATH@/components/nsTerminatorTelemetry.js
@RESPATH@/components/terminator.manifest
-#ifdef MOZ_ASAN
-#ifdef CLANG_CXX
+#if defined(CLANG_CXX)
+#if defined(MOZ_ASAN) || defined(MOZ_TSAN)
@BINPATH@/llvm-symbolizer
#endif
-#ifdef CLANG_CL
-@BINPATH@/clang_rt.asan_dynamic-i386.dll
#endif
+
+#if defined(MOZ_ASAN) && defined(CLANG_CL)
+@BINPATH@/clang_rt.asan_dynamic-i386.dll
#endif
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/loop/loop.properties thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/loop/loop.properties
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/loop/loop.properties 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/loop/loop.properties 2015-01-09 12:36:37.000000000 +0000
@@ -271,7 +271,7 @@
feedback_category_video_quality=Video quality
feedback_category_was_disconnected=Was disconnected
feedback_category_confusing=Confusing
-feedback_category_other=Other:
+feedback_category_other2=Other
feedback_custom_category_text_placeholder=What went wrong?
feedback_submit_button=Submit
feedback_back_button=Back
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/preferences/cookies.dtd thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/preferences/cookies.dtd
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/preferences/cookies.dtd 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/preferences/cookies.dtd 2015-01-09 12:36:37.000000000 +0000
@@ -7,6 +7,10 @@
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/preferences/preferences.properties thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/preferences/preferences.properties
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/locales/en-US/chrome/browser/preferences/preferences.properties 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/locales/en-US/chrome/browser/preferences/preferences.properties 2015-01-09 12:36:37.000000000 +0000
@@ -95,6 +95,10 @@
# LOCALIZATION NOTE (removeSelectedCookies):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals
+# If you need to display the number of selected elements in your language,
+# you can use #1 in your localization as a placeholder for the number.
+# For example this is the English string with numbers:
+# removeSelectedCookied=Remove #1 Selected;Remove #1 Selected
removeSelectedCookies=Remove Selected;Remove Selected
#### Offline apps
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/themes/osx/customizableui/panelUIOverlay.css thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/themes/osx/customizableui/panelUIOverlay.css
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/themes/osx/customizableui/panelUIOverlay.css 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/themes/osx/customizableui/panelUIOverlay.css 2015-01-09 12:36:39.000000000 +0000
@@ -177,3 +177,7 @@
width: 32px;
height: 32px;
}
+
+toolbarpaletteitem[place="palette"] > .toolbarbutton-1 > .toolbarbutton-menubutton-button {
+ padding: 3px 1px;
+}
\ No newline at end of file
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/themes/shared/incontentprefs/preferences.inc.css thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/themes/shared/incontentprefs/preferences.inc.css
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/browser/themes/shared/incontentprefs/preferences.inc.css 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/browser/themes/shared/incontentprefs/preferences.inc.css 2015-01-09 12:36:39.000000000 +0000
@@ -194,6 +194,10 @@
padding-bottom: 0; /* no padding needed in inContent prefs */
}
+#tabsElement {
+ -moz-margin-end: 4px; /* add the 4px end-margin of other elements */
+}
+
#encryptionPanel {
margin-top: 15px;
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/autoconf/toolchain.m4 thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/autoconf/toolchain.m4
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/autoconf/toolchain.m4 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/autoconf/toolchain.m4 2015-01-09 12:36:40.000000000 +0000
@@ -15,7 +15,7 @@
#if defined(__clang__)
COMPILER clang-cl _MSC_VER
#else
-COMPILER msvc _MSC_VER
+COMPILER msvc _MSC_FULL_VER
#endif
#elif defined(__clang__)
COMPILER clang __clang_major__.__clang_minor__.__clang_patchlevel__
@@ -55,6 +55,13 @@
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
GNU_LD=1
fi
+
+if test "$compiler" = "msvc"; then
+ MSVC_VERSION_FULL="$CXX_VERSION"
+ CC_VERSION=`echo ${CC_VERSION} | cut -c 1-4`
+ CXX_VERSION=`echo ${CXX_VERSION} | cut -c 1-4`
+fi
+
INTEL_CC=
INTEL_CXX=
if test "$compiler" = "icc"; then
@@ -78,9 +85,10 @@
# getting the right version here manually.
CC_VERSION=1800
CXX_VERSION=1800
- # Build on clang-cl with MSVC 2013 with fallback emulation.
- CFLAGS="$CFLAGS -fmsc-version=1800 -fallback"
- CXXFLAGS="$CXXFLAGS -fmsc-version=1800 -fallback"
+ MSVC_VERSION_FULL=180030723
+ # Build on clang-cl with MSVC 2013 Update 3 with fallback emulation.
+ CFLAGS="$CFLAGS -fms-compatibility-version=18.00.30723 -fallback"
+ CXXFLAGS="$CXXFLAGS -fms-compatibility-version=18.00.30723 -fallback"
fi
if test "$GNU_CC"; then
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/autoconf/winsdk.m4 thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/autoconf/winsdk.m4
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/autoconf/winsdk.m4 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/autoconf/winsdk.m4 2015-01-09 12:36:40.000000000 +0000
@@ -6,32 +6,17 @@
dnl Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
dnl from there
AC_DEFUN([MOZ_FIND_WINSDK_VERSION], [
- MOZ_CHECK_HEADERS([winsdkver.h])
- if test "$ac_cv_header_winsdkver_h" = "yes"; then
- dnl Get the highest _WIN32_WINNT and NTDDI versions supported
- dnl Take the higher of the two
- dnl This is done because the Windows 7 beta SDK reports its
- dnl NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
- AC_CACHE_CHECK(for highest Windows version supported by this SDK,
- ac_cv_winsdk_maxver,
- [cat > conftest.h < conftest.h <
-#include
-#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
-#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
-#else
-#define WINSDK_MAXVER NTDDI_MAXVER
-#endif
-
-WINSDK_MAXVER
+WINVER_MAXVER
EOF
ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
rm -f conftest.h
])
- MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
- else
- dnl Any SDK which doesn't have WinSDKVer.h is too old.
- AC_MSG_ERROR([Your SDK does not have WinSDKVer.h. It is probably too old. Please upgrade to a newer SDK or try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
- fi
+ dnl WinSDKVer.h returns the version number in 4-digit format while many
+ dnl consumers expect 8. Therefore, pad the result with an extra 4 zeroes.
+ MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}0000
])
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/automation.py.in thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/automation.py.in
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/automation.py.in 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/automation.py.in 2015-01-09 12:36:40.000000000 +0000
@@ -504,7 +504,6 @@
env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
- env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
# Set WebRTC logging in case it is not set yet
env.setdefault('NSPR_LOG_MODULES', 'signaling:5,mtransport:5,datachannel:5,jsep:5,MediaPipelineFactory:5')
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/automationutils.py thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/automationutils.py
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/automationutils.py 2015-01-07 22:15:22.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/automationutils.py 2015-01-09 12:36:40.000000000 +0000
@@ -330,7 +330,6 @@
# crashreporter
env['GNOME_DISABLE_CRASH_DIALOG'] = '1'
env['XRE_NO_WINDOWS_CRASH_DIALOG'] = '1'
- env['NS_TRACE_MALLOC_DISABLE_STACKS'] = '1'
if crashreporter and not debugger:
env['MOZ_CRASHREPORTER_NO_REPORT'] = '1'
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/pgo/server-locations.txt thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/pgo/server-locations.txt
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/pgo/server-locations.txt 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/pgo/server-locations.txt 2015-01-09 12:36:41.000000000 +0000
@@ -20,7 +20,8 @@
# number is the default for the protocol.
#
# Unrecognized options are ignored. Recognized options are "primary" and
-# "privileged", "nocert", "cert=some_cert_nickname", "redir=hostname".
+# "privileged", "nocert", "cert=some_cert_nickname", "redir=hostname" and
+# "failHandshake".
#
# "primary" denotes a location which is the canonical location of
# the server; this location is the one assumed for requests which don't
@@ -32,6 +33,9 @@
# "nocert" makes sense only for https:// hosts and means there is not
# any certificate automatically generated for this host.
#
+# "failHandshake" causes the tls handshake to fail (by sending a client hello to
+# the client).
+#
# "cert=nickname" tells the pgo server to use a particular certificate
# for this host. The certificate is referenced by its nickname that must
# not contain any spaces. The certificate key files (PKCS12 modules)
@@ -227,7 +231,8 @@
https://bad.include-subdomains.pinning-dynamic.example.com:443 privileged,cert=dynamicPinningBad
# Host for static pin tests
-https://include-subdomains.pinning.example.com:443 privileged,cert=staticPinningBad
+https://badchain.include-subdomains.pinning.example.com:443 privileged,cert=staticPinningBad
+https://fail-handshake.example.com:443 privileged,failHandshake
# Hosts for sha1 console warning tests
https://sha1ee.example.com:443 privileged,cert=sha1_end_entity
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/fix-warnings-as-errors.patch thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/fix-warnings-as-errors.patch
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/fix-warnings-as-errors.patch 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/fix-warnings-as-errors.patch 2015-01-09 12:36:41.000000000 +0000
@@ -0,0 +1,70 @@
+# HG changeset patch
+# Parent f89b28ea7c7b7fcb54c34e74fcb047626300bfba
+# User Dave Hylands
+Bug 1073003 - Fix warnings in stlport causing errors in emulator build.
+
+diff --git a/build/stlport/stlport/stl/_istream.c b/build/stlport/stlport/stl/_istream.c
+--- a/build/stlport/stlport/stl/_istream.c
++++ b/build/stlport/stlport/stl/_istream.c
+@@ -1140,17 +1140,16 @@ basic_istream<_CharT, _Traits>::ignore(s
+ template
+ basic_istream<_CharT, _Traits>&
+ basic_istream<_CharT, _Traits>::ignore(streamsize __n, int_type __delim) {
+ sentry __sentry(*this, _No_Skip_WS());
+ this->_M_gcount = 0;
+
+ if (__sentry) {
+ basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf();
+- typedef _STLP_PRIV _Constant_unary_fun _Const_bool;
+ typedef _STLP_PRIV _Constant_binary_fun
+ _Const_streamsize;
+ const streamsize __maxss = (numeric_limits::max)();
+
+ if (__n == (numeric_limits::max)()) {
+ if (__buf->gptr() != __buf->egptr())
+ _M_gcount = _M_ignore_buffered(this, __buf,
+ __maxss, _Const_streamsize(__maxss),
+diff --git a/build/stlport/stlport/stl/_slist.c b/build/stlport/stlport/stl/_slist.c
+--- a/build/stlport/stlport/stl/_slist.c
++++ b/build/stlport/stlport/stl/_slist.c
+@@ -143,17 +143,16 @@ void _Slist_unique(slist<_Tp, _Alloc>& _
+ }
+ }
+ }
+
+ template
+ void _Slist_merge(slist<_Tp, _Alloc>& __that, slist<_Tp, _Alloc>& __x,
+ _StrictWeakOrdering __comp) {
+ typedef _Slist_node<_Tp> _Node;
+- typedef _STLP_PRIV _Slist_node_base _Node_base;
+ if (__that.get_allocator() == __x.get_allocator()) {
+ typename slist<_Tp, _Alloc>::iterator __ite(__that.before_begin());
+ while (__ite._M_node->_M_next && !__x.empty()) {
+ if (__comp(__x.front(), __STATIC_CAST(_Node*, __ite._M_node->_M_next)->_M_data)) {
+ _STLP_VERBOSE_ASSERT(!__comp(__STATIC_CAST(_Node*, __ite._M_node->_M_next)->_M_data, __x.front()),
+ _StlMsg_INVALID_STRICT_WEAK_PREDICATE)
+ __that.splice_after(__ite, __x, __x.before_begin());
+ }
+diff --git a/build/stlport/stlport/stl/config/features.h b/build/stlport/stlport/stl/config/features.h
+--- a/build/stlport/stlport/stl/config/features.h
++++ b/build/stlport/stlport/stl/config/features.h
+@@ -303,17 +303,18 @@
+ # undef _STLP_NO_DEFAULT_NON_TYPE_PARAM
+ # define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1
+ #endif
+
+ #if !defined (_STLP_STATIC_ASSERT)
+ /* Some compiler support 0 size array so we use negative size array to generate
+ * a compilation time error.
+ */
+-# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1];
++//# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1];
++# define _STLP_STATIC_ASSERT(expr) static_assert(expr, "static_assert failed");
+ #endif
+
+ /* apple mpw exception handling bug */
+ #ifndef _STLP_MPWFIX_TRY
+ # define _STLP_MPWFIX_TRY
+ #endif
+ #ifndef _STLP_MPWFIX_CATCH
+ # define _STLP_MPWFIX_CATCH
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/moz.build 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/moz.build 2015-01-09 12:36:41.000000000 +0000
@@ -9,9 +9,6 @@
# name for the Library for convenience in moz.build.
STATIC_LIBRARY_NAME = 'stlport_static'
-if not CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
- OS_LIBS += ['-static-libstdc++']
-
FORCE_STATIC_LIB = True
SOURCES += [
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/README.mozilla thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/README.mozilla
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/README.mozilla 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/README.mozilla 2015-01-09 12:36:41.000000000 +0000
@@ -7,3 +7,6 @@
The following patches are applied on top:
- android-mozilla-config.patch: Adjusts Android-specific configuration
to the mozilla codebase use of the STL.
+
+- fix-warnings-as-errors.patch: Fixes warnings which were causing the
+ B2G emulator-ICS build to fail (related to bug 1073003).
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/config/features.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/config/features.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/config/features.h 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/config/features.h 2015-01-09 12:36:41.000000000 +0000
@@ -308,7 +308,8 @@
/* Some compiler support 0 size array so we use negative size array to generate
* a compilation time error.
*/
-# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1];
+//# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1];
+# define _STLP_STATIC_ASSERT(expr) static_assert(expr, "static_assert failed");
#endif
/* apple mpw exception handling bug */
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/_istream.c thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/_istream.c
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/_istream.c 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/_istream.c 2015-01-09 12:36:41.000000000 +0000
@@ -1145,7 +1145,6 @@
if (__sentry) {
basic_streambuf<_CharT, _Traits>* __buf = this->rdbuf();
- typedef _STLP_PRIV _Constant_unary_fun _Const_bool;
typedef _STLP_PRIV _Constant_binary_fun
_Const_streamsize;
const streamsize __maxss = (numeric_limits::max)();
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/_slist.c thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/_slist.c
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/build/stlport/stlport/stl/_slist.c 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/build/stlport/stlport/stl/_slist.c 2015-01-09 12:36:41.000000000 +0000
@@ -148,7 +148,6 @@
void _Slist_merge(slist<_Tp, _Alloc>& __that, slist<_Tp, _Alloc>& __x,
_StrictWeakOrdering __comp) {
typedef _Slist_node<_Tp> _Node;
- typedef _STLP_PRIV _Slist_node_base _Node_base;
if (__that.get_allocator() == __x.get_allocator()) {
typename slist<_Tp, _Alloc>::iterator __ite(__that.before_begin());
while (__ite._M_node->_M_next && !__x.empty()) {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/CLOBBER thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/CLOBBER
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/CLOBBER 2015-01-07 22:15:18.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/CLOBBER 2015-01-09 12:36:23.000000000 +0000
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
-Bug 1066383 - Clobber needed due to build system not reliably picking up an IDL removal.
+Bug 1056337 - Change default compiler for B2G ICS builds.
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/config/config.mk thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/config/config.mk
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/config/config.mk 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/config/config.mk 2015-01-09 12:36:41.000000000 +0000
@@ -228,17 +228,17 @@
endif
#
-# Handle trace-malloc and DMD in optimized builds.
+# Handle DMD in optimized builds.
# No opt to give sane callstacks.
#
-ifneq (,$(NS_TRACE_MALLOC)$(MOZ_DMD))
+ifdef MOZ_DMD
MOZ_OPTIMIZE_FLAGS=-Zi -Od -UDEBUG -DNDEBUG
ifdef HAVE_64BIT_BUILD
OS_LDFLAGS = -DEBUG -OPT:REF,ICF
else
OS_LDFLAGS = -DEBUG -OPT:REF
endif
-endif # NS_TRACE_MALLOC || MOZ_DMD
+endif # MOZ_DMD
endif # MOZ_DEBUG
@@ -421,20 +421,20 @@
#//------------------------------------------------------------------------
ifdef USE_STATIC_LIBS
RTL_FLAGS=-MT # Statically linked multithreaded RTL
-ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
+ifdef MOZ_DEBUG
ifndef MOZ_NO_DEBUG_RTL
RTL_FLAGS=-MTd # Statically linked multithreaded MSVC4.0 debug RTL
endif
-endif # MOZ_DEBUG || NS_TRACE_MALLOC
+endif # MOZ_DEBUG
else # !USE_STATIC_LIBS
RTL_FLAGS=-MD # Dynamically linked, multithreaded RTL
-ifneq (,$(MOZ_DEBUG)$(NS_TRACE_MALLOC))
+ifdef MOZ_DEBUG
ifndef MOZ_NO_DEBUG_RTL
RTL_FLAGS=-MDd # Dynamically linked, multithreaded MSVC4.0 debug RTL
endif
-endif # MOZ_DEBUG || NS_TRACE_MALLOC
+endif # MOZ_DEBUG
endif # USE_STATIC_LIBS
endif # WINNT && !GNU_CC
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/configure.in thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/configure.in
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/configure.in 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/configure.in 2015-01-09 12:36:42.000000000 +0000
@@ -415,30 +415,27 @@
MOZ_METRO=)
if test -n "$MOZ_METRO"; then
AC_DEFINE(MOZ_METRO)
- # Target the Windows 8 Kit
- WINSDK_TARGETVER=602
- WINVER=502
# toolkit/library/makefile.in needs these, see nsDllMain.
CRTDLLVERSION=110
CRTEXPDLLVERSION=1-1-0
-else
- # Target the Windows 7 SDK by default
- WINSDK_TARGETVER=601
- WINVER=502
fi
AC_SUBST(CRTDLLVERSION)
AC_SUBST(CRTEXPDLLVERSION)
+# Target the Windows 8.1 SDK by default
+WINSDK_TARGETVER=603
+WINVER=502
+
MOZ_ARG_WITH_STRING(windows-version,
[ --with-windows-version=WINSDK_TARGETVER
- Windows SDK version to target. Lowest version
- currently allowed is 601 (Win7), highest is 602 (Win8)],
+ Windows SDK version to target. Win8.1 (603) is
+ currently the minimum supported version.],
WINSDK_TARGETVER=$withval)
-# Currently only two sdk versions allowed, 601 and 602
+# Currently only version 603 is allowed
case "$WINSDK_TARGETVER" in
-601|602)
+603)
MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
;;
@@ -474,8 +471,9 @@
changequote([,])
# Determine compiler version
- _CC_MAJOR_VERSION=`echo ${CC_VERSION} | cut -c 1-2`
- _CC_MINOR_VERSION=`echo ${CC_VERSION} | cut -c 3-4`
+ _CC_MAJOR_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 1-2`
+ _CC_MINOR_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 3-4`
+ _CC_BUILD_VERSION=`echo ${MSVC_VERSION_FULL} | cut -c 5-`
_MSC_VER=${CC_VERSION}
_CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | cut -c 1-2`
@@ -487,13 +485,15 @@
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
- if test "$_CC_MAJOR_VERSION" = "18"; then
+ if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" -ge "30723"; then
_CC_SUITE=12
MSVS_VERSION=2013
MSVC_C_RUNTIME_DLL=msvcr120.dll
MSVC_CXX_RUNTIME_DLL=msvcp120.dll
else
- AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
+ AC_MSG_ERROR([This version (${_CC_MAJOR_VERSION}.${_CC_MINOR_VERSION}.${_CC_BUILD_VERSION}) of the MSVC compiler is unsupported.
+You must install Visual C++ 2013 Update 3 or newer in order to build.
+See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
fi
AC_SUBST(MSVS_VERSION)
AC_SUBST(MSVC_C_RUNTIME_DLL)
@@ -685,7 +685,7 @@
# causing problems with local implementations with the same name.
AC_DEFINE(STRSAFE_NO_DEPRECATE)
- MOZ_WINSDK_MAXVER=0x06020000
+ MOZ_WINSDK_MAXVER=0x06030000
fi # !GNU_CC
AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
@@ -5880,10 +5880,6 @@
MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_47.dll
AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.1.])
;;
- 0x0602*)
- MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_46.dll
- AC_MSG_RESULT([Found D3D compiler in Windows SDK 8.0.])
- ;;
esac
if test -n "$MOZ_D3DCOMPILER_VISTA_DLL"; then
@@ -6032,15 +6028,6 @@
MOZ_GAMEPAD_BACKEND=cocoa
;;
WINNT)
- case "$MOZ_WINSDK_MAXVER" in
- # We support building with the Windows 7 SDK otherwise, but
- # Gamepad support requires the Windows 8 SDK for some HID headers.
- 0x0601*)
- AC_MSG_ERROR([The Windows 8 SDK or newer is required to build Gamepad support. Please install a newer Windows SDK or reconfigure with --disable-gamepad to disable gamepad support.])
- ;;
- *)
- ;;
- esac
MOZ_GAMEPAD_BACKEND=windows
;;
Linux)
@@ -7063,21 +7050,6 @@
fi
dnl ========================================================
-dnl = Enable trace malloc
-dnl ========================================================
-NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
-MOZ_ARG_ENABLE_BOOL(trace-malloc,
-[ --enable-trace-malloc Enable malloc tracing; also disables DMD and jemalloc],
- NS_TRACE_MALLOC=1,
- NS_TRACE_MALLOC= )
-if test "$NS_TRACE_MALLOC"; then
- # Please, Mr. Linker Man, don't take away our symbol names
- MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
- AC_DEFINE(NS_TRACE_MALLOC)
-fi
-AC_SUBST(NS_TRACE_MALLOC)
-
-dnl ========================================================
dnl = Enable DMD
dnl ========================================================
@@ -7086,11 +7058,6 @@
MOZ_DMD=1,
MOZ_DMD= )
-dnl The two options are conflicting. Fails the configure to alert the user.
-if test "$NS_TRACE_MALLOC" -a "$MOZ_DMD"; then
- AC_MSG_ERROR([--enable-trace-malloc and --enable-dmd are conflicting options])
-fi
-
if test "$MOZ_DMD"; then
AC_DEFINE(MOZ_DMD)
@@ -7112,10 +7079,6 @@
MOZ_MEMORY=1,
MOZ_MEMORY=)
-if test "$NS_TRACE_MALLOC"; then
- MOZ_MEMORY=
-fi
-
case "${OS_TARGET}" in
Android|WINNT|Darwin)
MOZ_GLUE_IN_PROGRAM=
@@ -7138,11 +7101,6 @@
MOZ_REPLACE_MALLOC=1,
MOZ_REPLACE_MALLOC= )
-dnl The two options are conflicting. Fails the configure to alert the user.
-if test "$NS_TRACE_MALLOC" -a "$MOZ_REPLACE_MALLOC"; then
- AC_MSG_ERROR([--enable-trace-malloc and --enable-replace-malloc are conflicting options])
-fi
-
if test -n "$MOZ_REPLACE_MALLOC" -a -z "$MOZ_MEMORY"; then
dnl We don't want to enable jemalloc unconditionally because it may be a
dnl deliberate choice not to enable it (bug 702250, for instance)
@@ -7617,9 +7575,9 @@
AC_LANG_RESTORE
fi
-# Demangle only for debug or trace-malloc or DMD builds
+# Demangle only for debug or DMD builds
MOZ_DEMANGLE_SYMBOLS=
-if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then
+if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
MOZ_DEMANGLE_SYMBOLS=1
AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
fi
@@ -7977,13 +7935,6 @@
dnl Graphics checks.
dnl ========================================================
-if test "${OS_TARGET}" = "WINNT"; then
- if $PERL -e "exit($MOZ_WINSDK_MAXVER < 0x06020000)"; then
- MOZ_ENABLE_DIRECT2D1_1=1
- AC_SUBST(MOZ_ENABLE_DIRECT2D1_1)
- fi
-fi
-
if test "${OS_TARGET}" = "WINNT" -o \
"${OS_ARCH}" = "Darwin" -o \
"${MOZ_WIDGET_TOOLKIT}" = "android" -o \
@@ -8158,17 +8109,12 @@
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
;;
windows)
- WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
+ WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
+ WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
- if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
- WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
- WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
- MOZ_ENABLE_D2D_SURFACE=1
- MOZ_ENABLE_DWRITE_FONT=1
- else
- WIN32_DWRITE_FONT_FEATURE=
- WIN32_D2D_SURFACE_FEATURE=
- fi
+ WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
+ MOZ_ENABLE_D2D_SURFACE=1
+ MOZ_ENABLE_DWRITE_FONT=1
MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
@@ -8451,7 +8397,7 @@
fi
dnl ========================================================
-if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC" -o "$MOZ_DMD"; then
+if test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
fi
@@ -9024,7 +8970,8 @@
# B2G: bug 866301
if test "$MOZ_WIDGET_TOOLKIT" = "android" ||
- test "$MOZ_BUILD_APP" = "b2g"; then
+ test "$MOZ_BUILD_APP" = "b2g" ||
+ test "$MOZ_BUILD_APP" = "b2g/dev"; then
_INTL_API=no
else
_INTL_API=yes
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/LoadInfo.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/LoadInfo.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/LoadInfo.cpp 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/LoadInfo.cpp 2015-01-09 12:36:43.000000000 +0000
@@ -28,6 +28,8 @@
, mSecurityFlags(aSecurityFlags)
, mContentPolicyType(aContentPolicyType)
, mBaseURI(aBaseURI)
+ , mInnerWindowID(aLoadingContext ?
+ aLoadingContext->OwnerDoc()->InnerWindowID() : 0)
{
MOZ_ASSERT(mLoadingPrincipal);
MOZ_ASSERT(mTriggeringPrincipal);
@@ -43,6 +45,21 @@
}
}
+LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
+ nsIPrincipal* aTriggeringPrincipal,
+ nsSecurityFlags aSecurityFlags,
+ nsContentPolicyType aContentPolicyType,
+ uint32_t aInnerWindowID)
+ : mLoadingPrincipal(aLoadingPrincipal)
+ , mTriggeringPrincipal(aTriggeringPrincipal)
+ , mSecurityFlags(aSecurityFlags)
+ , mContentPolicyType(aContentPolicyType)
+ , mInnerWindowID(aInnerWindowID)
+{
+ MOZ_ASSERT(mLoadingPrincipal);
+ MOZ_ASSERT(mTriggeringPrincipal);
+}
+
LoadInfo::~LoadInfo()
{
}
@@ -135,4 +152,11 @@
return mBaseURI;
}
+NS_IMETHODIMP
+LoadInfo::GetInnerWindowID(uint32_t* outInnerWindowID)
+{
+ *outInnerWindowID = mInnerWindowID;
+ return NS_OK;
+}
+
} // namespace mozilla
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/LoadInfo.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/LoadInfo.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/LoadInfo.h 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/LoadInfo.h 2015-01-09 12:36:43.000000000 +0000
@@ -17,6 +17,11 @@
namespace mozilla {
+namespace net {
+class HttpChannelParent;
+class FTPChannelParent;
+}
+
/**
* Class that provides an nsILoadInfo implementation.
*/
@@ -35,6 +40,18 @@
nsIURI* aBaseURI = nullptr);
private:
+ // private constructor that is only allowed to be called from within
+ // HttpChannelParent and FTPChannelParent declared as friends undeneath.
+ // In e10s we can not serialize nsINode, hence we store the innerWindowID.
+ LoadInfo(nsIPrincipal* aLoadingPrincipal,
+ nsIPrincipal* aTriggeringPrincipal,
+ nsSecurityFlags aSecurityFlags,
+ nsContentPolicyType aContentPolicyType,
+ uint32_t aInnerWindowID);
+
+ friend class net::HttpChannelParent;
+ friend class net::FTPChannelParent;
+
~LoadInfo();
nsCOMPtr mLoadingPrincipal;
@@ -43,6 +60,7 @@
nsSecurityFlags mSecurityFlags;
nsContentPolicyType mContentPolicyType;
nsCOMPtr mBaseURI;
+ uint32_t mInnerWindowID;
};
} // namespace mozilla
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/nsILoadInfo.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/nsILoadInfo.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/docshell/base/nsILoadInfo.idl 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/docshell/base/nsILoadInfo.idl 2015-01-09 12:36:43.000000000 +0000
@@ -180,4 +180,24 @@
*/
[noscript, notxpcom, nostdcall, binaryname(BaseURI)]
nsIURI binaryBaseURI();
+
+ /**
+ * The innerWindowId of the loadingDocument, used to identify
+ * the loadingDocument in e10s where the loadingDocument is
+ * not available.
+ *
+ * Warning: If the loadingDocument is null, then the
+ * innerWindowId is 0.
+ */
+ readonly attribute unsigned long innerWindowID;
+
+%{ C++
+ inline uint32_t GetInnerWindowID()
+ {
+ uint32_t result;
+ mozilla::DebugOnly rv = GetInnerWindowID(&result);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+ return result;
+ }
+%}
};
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/alarm/AlarmHalService.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/alarm/AlarmHalService.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/alarm/AlarmHalService.h 2015-01-07 22:15:23.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/alarm/AlarmHalService.h 2015-01-09 12:36:43.000000000 +0000
@@ -34,10 +34,10 @@
static already_AddRefed GetInstance();
// Implementing hal::AlarmObserver
- void Notify(const void_t& aVoid);
+ void Notify(const void_t& aVoid) MOZ_OVERRIDE;
// Implementing hal::SystemTimezoneChangeObserver
- void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
+ void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo) MOZ_OVERRIDE;
private:
virtual ~AlarmHalService();
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsContentList.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsContentList.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsContentList.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsContentList.cpp 2015-01-09 12:36:44.000000000 +0000
@@ -230,9 +230,7 @@
// A PL_DHASH_ADD is equivalent to a PL_DHASH_LOOKUP for cases
// when the entry is already in the hashtable.
entry = static_cast
- (PL_DHashTableOperate(&gContentListHashTable,
- &hashKey,
- PL_DHASH_ADD));
+ (PL_DHashTableAdd(&gContentListHashTable, &hashKey));
if (entry)
list = entry->mContentList;
}
@@ -346,9 +344,8 @@
// A PL_DHASH_ADD is equivalent to a PL_DHASH_LOOKUP for cases
// when the entry is already in the hashtable.
entry = static_cast
- (PL_DHashTableOperate(&gFuncStringContentListHashTable,
- &hashKey,
- PL_DHASH_ADD));
+ (PL_DHashTableAdd(&gFuncStringContentListHashTable,
+ &hashKey));
if (entry) {
list = entry->mContentList;
#ifdef DEBUG
@@ -989,9 +986,7 @@
if (!gContentListHashTable.ops)
return;
- PL_DHashTableOperate(&gContentListHashTable,
- &key,
- PL_DHASH_REMOVE);
+ PL_DHashTableRemove(&gContentListHashTable, &key);
if (gContentListHashTable.EntryCount() == 0) {
PL_DHashTableFinish(&gContentListHashTable);
@@ -1032,9 +1027,7 @@
}
nsFuncStringCacheKey key(mRootNode, mFunc, mString);
- PL_DHashTableOperate(&gFuncStringContentListHashTable,
- &key,
- PL_DHASH_REMOVE);
+ PL_DHashTableRemove(&gFuncStringContentListHashTable, &key);
if (gFuncStringContentListHashTable.EntryCount() == 0) {
PL_DHashTableFinish(&gFuncStringContentListHashTable);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsContentUtils.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsContentUtils.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsContentUtils.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsContentUtils.cpp 2015-01-09 12:36:44.000000000 +0000
@@ -3954,8 +3954,7 @@
EventListenerManagerMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
CycleCollectionNoteChild(cb, entry->mListenerManager.get(),
"[via hash] mListenerManager");
@@ -3974,8 +3973,7 @@
EventListenerManagerMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
- PL_DHASH_ADD));
+ (PL_DHashTableAdd(&sEventListenerManagersHash, aNode));
if (!entry) {
return nullptr;
@@ -4006,8 +4004,7 @@
EventListenerManagerMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
return entry->mListenerManager;
}
@@ -4022,8 +4019,7 @@
if (sEventListenerManagersHash.ops) {
EventListenerManagerMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&sEventListenerManagersHash, aNode,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&sEventListenerManagersHash, aNode));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
nsRefPtr listenerManager;
listenerManager.swap(entry->mListenerManager);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDocument.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDocument.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDocument.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDocument.cpp 2015-01-09 12:36:44.000000000 +0000
@@ -3282,6 +3282,15 @@
return undoManager.forget();
}
+bool
+nsDocument::IsWebAnimationsEnabled(JSContext* /*unused*/, JSObject* /*unused*/)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ return nsContentUtils::IsCallerChrome() ||
+ Preferences::GetBool("dom.animations-api.core.enabled");
+}
+
AnimationTimeline*
nsDocument::Timeline()
{
@@ -3951,8 +3960,7 @@
if (mSubDocuments) {
SubDocMapEntry *entry =
static_cast
- (PL_DHashTableOperate(mSubDocuments, aElement,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(mSubDocuments, aElement));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
PL_DHashTableRawRemove(mSubDocuments, entry);
@@ -3984,8 +3992,7 @@
// Add a mapping to the hash table
SubDocMapEntry *entry =
static_cast
- (PL_DHashTableOperate(mSubDocuments, aElement,
- PL_DHASH_ADD));
+ (PL_DHashTableAdd(mSubDocuments, aElement));
if (!entry) {
return NS_ERROR_OUT_OF_MEMORY;
@@ -4013,8 +4020,7 @@
if (mSubDocuments && aContent->IsElement()) {
SubDocMapEntry *entry =
static_cast
- (PL_DHashTableOperate(mSubDocuments, aContent->AsElement(),
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(mSubDocuments, aContent->AsElement()));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
return entry->mSubDocument;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDocument.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDocument.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDocument.h 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDocument.h 2015-01-09 12:36:44.000000000 +0000
@@ -782,6 +782,7 @@
virtual already_AddRefed GetUndoManager() MOZ_OVERRIDE;
+ static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
virtual mozilla::dom::AnimationTimeline* Timeline() MOZ_OVERRIDE;
virtual nsresult SetSubDocumentFor(Element* aContent,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDOMWindowUtils.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDOMWindowUtils.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsDOMWindowUtils.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsDOMWindowUtils.cpp 2015-01-09 12:36:44.000000000 +0000
@@ -511,6 +511,27 @@
}
NS_IMETHODIMP
+nsDOMWindowUtils::SetResolutionAndScaleTo(float aXResolution, float aYResolution)
+{
+ if (!nsContentUtils::IsCallerChrome()) {
+ return NS_ERROR_DOM_SECURITY_ERR;
+ }
+
+ nsIPresShell* presShell = GetPresShell();
+ if (!presShell) {
+ return NS_ERROR_FAILURE;
+ }
+
+ nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
+ if (sf) {
+ sf->SetResolutionAndScaleTo(gfxSize(aXResolution, aYResolution));
+ presShell->SetResolutionAndScaleTo(aXResolution, aYResolution);
+ }
+
+ return NS_OK;
+}
+
+NS_IMETHODIMP
nsDOMWindowUtils::GetResolution(float* aXResolution, float* aYResolution)
{
MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome());
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsIContentPolicy.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsIContentPolicy.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsIContentPolicy.idl 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsIContentPolicy.idl 2015-01-09 12:36:45.000000000 +0000
@@ -33,7 +33,13 @@
const nsContentPolicyType TYPE_INVALID = 0;
/**
- * Gecko/Firefox developers: Do not use TYPE_OTHER under any circumstances.
+ * Gecko/Firefox developers: Avoid using TYPE_OTHER. Especially for
+ * requests that are coming from webpages. Or requests in general which
+ * you expect that security checks will be done on.
+ * Always use a more specific type if one is available. And do not hesitate
+ * to add more types as appropriate.
+ * But if you are fairly sure that no one would care about your more specific
+ * type, then it's ok to use TYPE_OTHER.
*
* Extension developers: Whenever it is reasonable, use one of the existing
* content types. If none of the existing content types are right for
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsIXMLHttpRequest.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsIXMLHttpRequest.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsIXMLHttpRequest.idl 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsIXMLHttpRequest.idl 2015-01-09 12:36:45.000000000 +0000
@@ -8,6 +8,7 @@
interface nsIChannel;
interface nsIDOMDocument;
interface nsIDOMEventListener;
+interface nsILoadGroup;
interface nsIPrincipal;
interface nsIScriptContext;
interface nsIURI;
@@ -67,7 +68,7 @@
* you're aware of all the security implications. And then think twice about
* it.
*/
-[scriptable, uuid(2e91e088-e9fa-4ba4-9887-2a0b7cf27a3e)]
+[scriptable, uuid(704e91dc-a3f6-4e4d-9f5f-4bb85159aeb7)]
interface nsIXMLHttpRequest : nsISupports
{
/**
@@ -295,11 +296,15 @@
* document.
* @param baseURI The base URI to use when resolving relative URIs. May be
* null.
+ * @param loadGroup An optional load group to use when performing the request.
+ * This will be used even if the global has a window with a
+ * load group.
*/
[noscript] void init(in nsIPrincipal principal,
in nsIScriptContext scriptContext,
in nsIGlobalObject globalObject,
- in nsIURI baseURI);
+ in nsIURI baseURI,
+ [optional] in nsILoadGroup loadGroup);
/**
* Upload process can be tracked by adding event listener to |upload|.
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsJSEnvironment.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsJSEnvironment.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsJSEnvironment.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsJSEnvironment.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -185,7 +185,6 @@
static uint32_t sPreviousSuspectedCount = 0;
static uint32_t sCleanupsSinceLastGC = UINT32_MAX;
static bool sNeedsFullCC = false;
-static bool sNeedsFullGC = false;
static bool sNeedsGCAfterCC = false;
static bool sIncrementalCC = false;
static bool sDidPaintAfterPreviousICCSlice = false;
@@ -1087,177 +1086,6 @@
return NS_OK;
}
-#ifdef NS_TRACE_MALLOC
-
-#include // XXX assume Linux if NS_TRACE_MALLOC
-#include
-#ifdef XP_UNIX
-#include
-#endif
-#ifdef XP_WIN32
-#include
-#endif
-#include "nsTraceMalloc.h"
-
-static bool
-CheckUniversalXPConnectForTraceMalloc(JSContext *cx)
-{
- if (nsContentUtils::IsCallerChrome())
- return true;
- JS_ReportError(cx, "trace-malloc functions require UniversalXPConnect");
- return false;
-}
-
-static bool
-TraceMallocDisable(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- NS_TraceMallocDisable();
- args.rval().setUndefined();
- return true;
-}
-
-static bool
-TraceMallocEnable(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- NS_TraceMallocEnable();
- args.rval().setUndefined();
- return true;
-}
-
-static bool
-TraceMallocOpenLogFile(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- int fd;
- if (argc == 0) {
- fd = -1;
- } else {
- JSString *str = JS::ToString(cx, args[0]);
- if (!str)
- return false;
- JSAutoByteString filename(cx, str);
- if (!filename)
- return false;
- fd = open(filename.ptr(), O_CREAT | O_WRONLY | O_TRUNC, 0644);
- if (fd < 0) {
- JS_ReportError(cx, "can't open %s: %s", filename.ptr(), strerror(errno));
- return false;
- }
- }
- args.rval().setInt32(fd);
- return true;
-}
-
-static bool
-TraceMallocChangeLogFD(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = CallArgsFromVp(argc, vp);
-
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- int32_t fd, oldfd;
- if (args.length() == 0) {
- oldfd = -1;
- } else {
- if (!JS::ToInt32(cx, args[0], &fd))
- return false;
- oldfd = NS_TraceMallocChangeLogFD(fd);
- if (oldfd == -2) {
- JS_ReportOutOfMemory(cx);
- return false;
- }
- }
- args.rval().setInt32(oldfd);
- return true;
-}
-
-static bool
-TraceMallocCloseLogFD(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = CallArgsFromVp(argc, vp);
-
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- int32_t fd;
- if (args.length() == 0) {
- args.rval().setUndefined();
- return true;
- }
- if (!JS::ToInt32(cx, args[0], &fd))
- return false;
- NS_TraceMallocCloseLogFD((int) fd);
- args.rval().setInt32(fd);
- return true;
-}
-
-static bool
-TraceMallocLogTimestamp(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- JSString *str = JS::ToString(cx, args.get(0));
- if (!str)
- return false;
- JSAutoByteString caption(cx, str);
- if (!caption)
- return false;
- NS_TraceMallocLogTimestamp(caption.ptr());
- args.rval().setUndefined();
- return true;
-}
-
-static bool
-TraceMallocDumpAllocations(JSContext *cx, unsigned argc, JS::Value *vp)
-{
- JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
- if (!CheckUniversalXPConnectForTraceMalloc(cx))
- return false;
-
- JSString *str = JS::ToString(cx, args.get(0));
- if (!str)
- return false;
- JSAutoByteString pathname(cx, str);
- if (!pathname)
- return false;
- if (NS_TraceMallocDumpAllocations(pathname.ptr()) < 0) {
- JS_ReportError(cx, "can't dump to %s: %s", pathname.ptr(), strerror(errno));
- return false;
- }
- args.rval().setUndefined();
- return true;
-}
-
-static const JSFunctionSpec TraceMallocFunctions[] = {
- JS_FS("TraceMallocDisable", TraceMallocDisable, 0, 0),
- JS_FS("TraceMallocEnable", TraceMallocEnable, 0, 0),
- JS_FS("TraceMallocOpenLogFile", TraceMallocOpenLogFile, 1, 0),
- JS_FS("TraceMallocChangeLogFD", TraceMallocChangeLogFD, 1, 0),
- JS_FS("TraceMallocCloseLogFD", TraceMallocCloseLogFD, 1, 0),
- JS_FS("TraceMallocLogTimestamp", TraceMallocLogTimestamp, 1, 0),
- JS_FS("TraceMallocDumpAllocations", TraceMallocDumpAllocations, 1, 0),
- JS_FS_END
-};
-
-#endif /* NS_TRACE_MALLOC */
-
#ifdef MOZ_JPROF
#include
@@ -1374,13 +1202,6 @@
// Attempt to initialize profiling functions
::JS_DefineProfilingFunctions(cx, aGlobalObj);
-#ifdef NS_TRACE_MALLOC
- if (nsContentUtils::IsCallerChrome()) {
- // Attempt to initialize TraceMalloc functions
- ::JS_DefineFunctions(cx, aGlobalObj, TraceMallocFunctions);
- }
-#endif
-
#ifdef MOZ_JPROF
// Attempt to initialize JProf functions
::JS_DefineFunctions(cx, aGlobalObj, JProfFunctions);
@@ -1459,24 +1280,17 @@
if (sCCLockedOut && aIncremental == IncrementalGC) {
// We're in the middle of incremental GC. Do another slice.
JS::PrepareForIncrementalGC(sRuntime);
- JS::IncrementalGC(sRuntime, aReason, aSliceMillis);
+ JS::IncrementalGCSlice(sRuntime, aReason, aSliceMillis);
return;
}
- if (sNeedsFullGC || aReason != JS::gcreason::CC_WAITING) {
- sNeedsFullGC = false;
- JS::PrepareForFullGC(sRuntime);
- } else {
- CycleCollectedJSRuntime::Get()->PrepareWaitingZonesForGC();
- }
-
+ JS::PrepareForFullGC(sRuntime);
if (aIncremental == IncrementalGC) {
MOZ_ASSERT(aShrinking == NonShrinkingGC);
- JS::IncrementalGC(sRuntime, aReason, aSliceMillis);
- } else if (aShrinking == ShrinkingGC) {
- JS::ShrinkingGC(sRuntime, aReason);
+ JS::StartIncrementalGC(sRuntime, GC_NORMAL, aReason, aSliceMillis);
} else {
- JS::GCForReason(sRuntime, aReason);
+ JSGCInvocationKind gckind = aShrinking == ShrinkingGC ? GC_SHRINK : GC_NORMAL;
+ JS::GCForReason(sRuntime, gckind, aReason);
}
}
@@ -2156,8 +1970,6 @@
void
nsJSContext::PokeGC(JS::gcreason::Reason aReason, int aDelay)
{
- sNeedsFullGC = sNeedsFullGC || aReason != JS::gcreason::CC_WAITING;
-
if (sGCTimer || sInterSliceGCTimer || sShuttingDown) {
// There's already a timer for GC'ing, just return
return;
@@ -2479,7 +2291,6 @@
sLikelyShortLivingObjectsNeedingGC = 0;
sPostGCEventsToConsole = false;
sNeedsFullCC = false;
- sNeedsFullGC = false;
sNeedsGCAfterCC = false;
gNameSpaceManager = nullptr;
sRuntimeService = nullptr;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsPropertyTable.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsPropertyTable.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsPropertyTable.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsPropertyTable.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -95,8 +95,7 @@
for (PropertyList* prop = mPropertyList; prop; prop = prop->mNext) {
if (prop->mTransfer) {
PropertyListMapEntry *entry = static_cast
- (PL_DHashTableOperate(&prop->mObjectValueMap, aObject,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&prop->mObjectValueMap, aObject));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
rv = aOtherTable->SetProperty(aObject, prop->mName,
entry->value, prop->mDtorFunc,
@@ -126,7 +125,7 @@
PropertyList* prop;
for (prop = mPropertyList; prop; prop = prop->mNext) {
PropertyListMapEntry *entry = static_cast
- (PL_DHashTableOperate(&prop->mObjectValueMap, aObject, PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&prop->mObjectValueMap, aObject));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
aCallback(const_cast(aObject.get()), prop->mName, entry->value,
aData);
@@ -174,8 +173,7 @@
PropertyList* propertyList = GetPropertyListFor(aPropertyName);
if (propertyList) {
PropertyListMapEntry *entry = static_cast
- (PL_DHashTableOperate(&propertyList->mObjectValueMap, aObject,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&propertyList->mObjectValueMap, aObject));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
propValue = entry->value;
if (aRemove) {
@@ -230,7 +228,7 @@
// value is destroyed
nsresult result = NS_OK;
PropertyListMapEntry *entry = static_cast
- (PL_DHashTableOperate(&propertyList->mObjectValueMap, aObject, PL_DHASH_ADD));
+ (PL_DHashTableAdd(&propertyList->mObjectValueMap, aObject));
if (!entry)
return NS_ERROR_OUT_OF_MEMORY;
// A nullptr entry->key is the sign that the entry has just been allocated
@@ -329,7 +327,7 @@
nsPropertyTable::PropertyList::DeletePropertyFor(nsPropertyOwner aObject)
{
PropertyListMapEntry *entry = static_cast
- (PL_DHashTableOperate(&mObjectValueMap, aObject, PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&mObjectValueMap, aObject));
if (!PL_DHASH_ENTRY_IS_BUSY(entry))
return false;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsScriptNameSpaceManager.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsScriptNameSpaceManager.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsScriptNameSpaceManager.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsScriptNameSpaceManager.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -144,7 +144,7 @@
{
GlobalNameMapEntry *entry =
static_cast
- (PL_DHashTableOperate(aTable, aKey, PL_DHASH_ADD));
+ (PL_DHashTableAdd(aTable, aKey));
if (!entry) {
return nullptr;
@@ -161,7 +161,7 @@
nsScriptNameSpaceManager::RemoveFromHash(PLDHashTable *aTable,
const nsAString *aKey)
{
- PL_DHashTableOperate(aTable, aKey, PL_DHASH_REMOVE);
+ PL_DHashTableRemove(aTable, aKey);
}
nsGlobalNameStruct*
@@ -172,9 +172,8 @@
if (!aStruct->mAlias->mProto) {
GlobalNameMapEntry *proto =
static_cast
- (PL_DHashTableOperate(&mGlobalNames,
- &aStruct->mAlias->mProtoName,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&mGlobalNames,
+ &aStruct->mAlias->mProtoName));
if (PL_DHASH_ENTRY_IS_BUSY(proto)) {
aStruct->mAlias->mProto = &proto->mGlobalName;
@@ -389,8 +388,7 @@
{
GlobalNameMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&mGlobalNames, &aName,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&mGlobalNames, &aName));
if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
if (aClassName) {
@@ -410,8 +408,7 @@
{
GlobalNameMapEntry *entry =
static_cast
- (PL_DHashTableOperate(&mNavigatorNames, &aName,
- PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&mNavigatorNames, &aName));
if (!PL_DHASH_ENTRY_IS_BUSY(entry)) {
return nullptr;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsXMLHttpRequest.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsXMLHttpRequest.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsXMLHttpRequest.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsXMLHttpRequest.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -361,10 +361,11 @@
nsXMLHttpRequest::Init(nsIPrincipal* aPrincipal,
nsIScriptContext* aScriptContext,
nsIGlobalObject* aGlobalObject,
- nsIURI* aBaseURI)
+ nsIURI* aBaseURI,
+ nsILoadGroup* aLoadGroup)
{
NS_ENSURE_ARG_POINTER(aPrincipal);
-
+
if (nsCOMPtr win = do_QueryInterface(aGlobalObject)) {
if (win->IsOuterWindow()) {
// Must be bound to inner window, innerize if necessary.
@@ -374,7 +375,7 @@
}
}
- Construct(aPrincipal, aGlobalObject, aBaseURI);
+ Construct(aPrincipal, aGlobalObject, aBaseURI, aLoadGroup);
return NS_OK;
}
@@ -1436,6 +1437,11 @@
return nullptr;
}
+ if (mLoadGroup) {
+ nsCOMPtr ref = mLoadGroup;
+ return ref.forget();
+ }
+
nsresult rv = NS_ERROR_FAILURE;
nsIScriptContext* sc =
const_cast(this)->GetContextForEventHandlers(&rv);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsXMLHttpRequest.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsXMLHttpRequest.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/nsXMLHttpRequest.h 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/nsXMLHttpRequest.h 2015-01-09 12:36:45.000000000 +0000
@@ -244,7 +244,8 @@
void Construct(nsIPrincipal* aPrincipal,
nsIGlobalObject* aGlobalObject,
- nsIURI* aBaseURI = nullptr)
+ nsIURI* aBaseURI = nullptr,
+ nsILoadGroup* aLoadGroup = nullptr)
{
MOZ_ASSERT(aPrincipal);
MOZ_ASSERT_IF(nsCOMPtr win = do_QueryInterface(
@@ -252,6 +253,7 @@
mPrincipal = aPrincipal;
BindToOwner(aGlobalObject);
mBaseURI = aBaseURI;
+ mLoadGroup = aLoadGroup;
}
void InitParameters(bool aAnon, bool aSystem);
@@ -717,6 +719,7 @@
nsIRequestObserver* mRequestObserver;
nsCOMPtr mBaseURI;
+ nsCOMPtr mLoadGroup;
uint32_t mState;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/test/TestGetURL.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/test/TestGetURL.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/test/TestGetURL.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/test/TestGetURL.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -42,7 +42,7 @@
rv = secman->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
TEST_ENSURE_SUCCESS(rv, "Couldn't get system principal!");
- rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr);
+ rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr, nullptr);
TEST_ENSURE_SUCCESS(rv, "Couldn't initialize the XHR!");
rv = xhr->Open(getString, aURL, false, empty, empty);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/test/TestNativeXMLHttpRequest.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/test/TestNativeXMLHttpRequest.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/base/test/TestNativeXMLHttpRequest.cpp 2015-01-07 22:15:24.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/base/test/TestNativeXMLHttpRequest.cpp 2015-01-09 12:36:45.000000000 +0000
@@ -52,7 +52,7 @@
rv = secman->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
TEST_ENSURE_SUCCESS(rv, "Couldn't get system principal!");
- rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr);
+ rv = xhr->Init(systemPrincipal, nullptr, nullptr, nullptr, nullptr);
TEST_ENSURE_SUCCESS(rv, "Couldn't initialize the XHR!");
rv = xhr->Open(getString, testURL, false, empty, empty);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/battery/BatteryManager.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/battery/BatteryManager.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/battery/BatteryManager.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/battery/BatteryManager.h 2015-01-09 12:36:46.000000000 +0000
@@ -33,7 +33,7 @@
void Shutdown();
// For IObserver.
- void Notify(const hal::BatteryInformation& aBatteryInfo);
+ void Notify(const hal::BatteryInformation& aBatteryInfo) MOZ_OVERRIDE;
/**
* WebIDL Interface
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/BindingUtils.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/BindingUtils.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/BindingUtils.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/BindingUtils.cpp 2015-01-09 12:36:46.000000000 +0000
@@ -2068,8 +2068,8 @@
}
bool
-GetWindowForJSImplementedObject(JSContext* cx, JS::Handle obj,
- nsPIDOMWindow** window)
+GetContentGlobalForJSImplementedObject(JSContext* cx, JS::Handle obj,
+ nsIGlobalObject** globalObj)
{
// Be very careful to not get tricked here.
MOZ_ASSERT(NS_IsMainThread());
@@ -2095,37 +2095,36 @@
return false;
}
- // It's OK if we have null here: that just means the content-side
- // object really wasn't associated with any window.
- nsCOMPtr win(do_QueryInterface(global.GetAsSupports()));
- win.forget(window);
+ DebugOnly rv = CallQueryInterface(global.GetAsSupports(), globalObj);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+ MOZ_ASSERT(*globalObj);
return true;
}
-already_AddRefed
+already_AddRefed
ConstructJSImplementation(JSContext* aCx, const char* aContractId,
const GlobalObject& aGlobal,
JS::MutableHandle aObject,
ErrorResult& aRv)
{
- // Get the window to use as a parent and for initialization.
- nsCOMPtr window = do_QueryInterface(aGlobal.GetAsSupports());
- if (!window) {
+ // Get the global object to use as a parent and for initialization.
+ nsCOMPtr global = do_QueryInterface(aGlobal.GetAsSupports());
+ if (!global) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
- ConstructJSImplementation(aCx, aContractId, window, aObject, aRv);
+ ConstructJSImplementation(aCx, aContractId, global, aObject, aRv);
if (aRv.Failed()) {
return nullptr;
}
- return window.forget();
+ return global.forget();
}
void
ConstructJSImplementation(JSContext* aCx, const char* aContractId,
- nsPIDOMWindow* aWindow,
+ nsIGlobalObject* aGlobal,
JS::MutableHandle aObject,
ErrorResult& aRv)
{
@@ -2145,12 +2144,14 @@
aRv.Throw(rv);
return;
}
- // Initialize the object, if it implements nsIDOMGlobalPropertyInitializer.
+ // Initialize the object, if it implements nsIDOMGlobalPropertyInitializer
+ // and our global is a window.
nsCOMPtr gpi =
do_QueryInterface(implISupports);
+ nsCOMPtr window = do_QueryInterface(aGlobal);
if (gpi) {
JS::Rooted initReturn(aCx);
- rv = gpi->Init(aWindow, &initReturn);
+ rv = gpi->Init(window, &initReturn);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/BindingUtils.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/BindingUtils.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/BindingUtils.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/BindingUtils.h 2015-01-09 12:36:46.000000000 +0000
@@ -2651,19 +2651,19 @@
}
// Given a JSObject* that represents the chrome side of a JS-implemented WebIDL
-// interface, get the nsPIDOMWindow corresponding to the content side, if any.
+// interface, get the nsIGlobalObject corresponding to the content side, if any.
// A false return means an exception was thrown.
bool
-GetWindowForJSImplementedObject(JSContext* cx, JS::Handle obj,
- nsPIDOMWindow** window);
+GetContentGlobalForJSImplementedObject(JSContext* cx, JS::Handle obj,
+ nsIGlobalObject** global);
void
ConstructJSImplementation(JSContext* aCx, const char* aContractId,
- nsPIDOMWindow* aWindow,
+ nsIGlobalObject* aGlobal,
JS::MutableHandle aObject,
ErrorResult& aRv);
-already_AddRefed
+already_AddRefed
ConstructJSImplementation(JSContext* aCx, const char* aContractId,
const GlobalObject& aGlobal,
JS::MutableHandle aObject,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/Codegen.py thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/Codegen.py
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/Codegen.py 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/Codegen.py 2015-01-09 12:36:47.000000000 +0000
@@ -3710,12 +3710,12 @@
// XXXbz Wish we could check for a JS-implemented object
// that already has a content reflection...
if (!IsDOMObject(js::UncheckedUnwrap(${source}))) {
- nsCOMPtr ourWindow;
- if (!GetWindowForJSImplementedObject(cx, Callback(), getter_AddRefs(ourWindow))) {
+ nsCOMPtr contentGlobal;
+ if (!GetContentGlobalForJSImplementedObject(cx, Callback(), getter_AddRefs(contentGlobal))) {
$*{exceptionCode}
}
JS::Rooted jsImplSourceObj(cx, ${source});
- ${target} = new ${type}(jsImplSourceObj, ourWindow);
+ ${target} = new ${type}(jsImplSourceObj, contentGlobal);
} else {
$*{codeOnFailure}
}
@@ -12291,7 +12291,7 @@
jsImplemented = config.getDescriptors(webIDLFile=webIDLFile,
isJSImplemented=True)
bindingDeclareHeaders["nsWeakReference.h"] = jsImplemented
- bindingHeaders["nsPIDOMWindow.h"] = jsImplemented
+ bindingHeaders["nsIGlobalObject.h"] = jsImplemented
bindingHeaders["AtomList.h"] = hasNonEmptyDictionaries or jsImplemented or callbackDescriptors
def addHeaderBasedOnTypes(header, typeChecker):
@@ -13300,7 +13300,6 @@
initCall = fill(
"""
// Wrap the object before calling __Init so that __DOM_IMPL__ is available.
- nsCOMPtr globalHolder = do_QueryInterface(window);
JS::Rooted scopeObj(cx, globalHolder->GetGlobalJSObject());
MOZ_ASSERT(js::IsObjectInContextCompartment(scopeObj, cx));
JS::Rooted wrappedVal(cx);
@@ -13326,13 +13325,13 @@
return fill(
"""
JS::Rooted jsImplObj(cx);
- nsCOMPtr window =
+ nsCOMPtr globalHolder =
ConstructJSImplementation(cx, "${contractId}", global, &jsImplObj, aRv);
if (aRv.Failed()) {
return nullptr;
}
// Build the C++ implementation.
- nsRefPtr<${implClass}> impl = new ${implClass}(jsImplObj, window);
+ nsRefPtr<${implClass}> impl = new ${implClass}(jsImplObj, globalHolder);
$*{initCall}
return impl.forget();
""",
@@ -13516,7 +13515,7 @@
constructor = ClassConstructor(
[Argument("JS::Handle", "aJSImplObject"),
- Argument("nsPIDOMWindow*", "aParent")],
+ Argument("nsIGlobalObject*", "aParent")],
visibility="public",
baseConstructors=baseConstructors)
@@ -13587,12 +13586,10 @@
if (global.Failed()) {
return false;
}
- nsCOMPtr window = do_QueryInterface(global.GetAsSupports());
- if (!window) {
- return ThrowErrorMessage(cx, MSG_DOES_NOT_IMPLEMENT_INTERFACE, "Argument 1 of ${ifaceName}._create", "Window");
- }
+ nsCOMPtr globalHolder = do_QueryInterface(global.GetAsSupports());
+ MOZ_ASSERT(globalHolder);
JS::Rooted arg(cx, &args[1].toObject());
- nsRefPtr<${implName}> impl = new ${implName}(arg, window);
+ nsRefPtr<${implName}> impl = new ${implName}(arg, globalHolder);
MOZ_ASSERT(js::IsObjectInContextCompartment(arg, cx));
return GetOrCreateDOMReflector(cx, impl, args.rval());
""",
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/test/TestCImplementedInterface.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/test/TestCImplementedInterface.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bindings/test/TestCImplementedInterface.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bindings/test/TestCImplementedInterface.h 2015-01-09 12:36:47.000000000 +0000
@@ -18,7 +18,7 @@
{
public:
TestCImplementedInterface(JS::Handle aJSImpl,
- nsPIDOMWindow* aParent)
+ nsIGlobalObject* aParent)
: TestJSImplInterface(aJSImpl, aParent)
{}
};
@@ -27,7 +27,7 @@
public nsWrapperCache
{
public:
- explicit TestCImplementedInterface2(nsPIDOMWindow* aParent)
+ explicit TestCImplementedInterface2(nsIGlobalObject* aParent)
{}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestCImplementedInterface2)
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp 2015-01-09 12:36:47.000000000 +0000
@@ -0,0 +1,1056 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "BluetoothDaemonAvrcpInterface.h"
+#include "BluetoothDaemonSetupInterface.h"
+#include "mozilla/unused.h"
+
+BEGIN_BLUETOOTH_NAMESPACE
+
+//
+// AVRCP module
+//
+
+BluetoothAvrcpNotificationHandler*
+ BluetoothDaemonAvrcpModule::sNotificationHandler;
+
+void
+BluetoothDaemonAvrcpModule::SetNotificationHandler(
+ BluetoothAvrcpNotificationHandler* aNotificationHandler)
+{
+ sNotificationHandler = aNotificationHandler;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::Send(BluetoothDaemonPDU* aPDU,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ if (aRes) {
+ aRes->AddRef(); // Keep reference for response
+ }
+ return Send(aPDU, static_cast(aRes));
+}
+
+void
+BluetoothDaemonAvrcpModule::HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, void* aUserData)
+{
+ static void (BluetoothDaemonAvrcpModule::* const HandleOp[])(
+ const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&, void*) = {
+ INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::HandleRsp),
+ INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::HandleNtf),
+ };
+
+ MOZ_ASSERT(!NS_IsMainThread());
+
+ unsigned int isNtf = !!(aHeader.mOpcode & 0x80);
+
+ (this->*(HandleOp[isNtf]))(aHeader, aPDU, aUserData);
+}
+
+// Commands
+//
+
+nsresult
+BluetoothDaemonAvrcpModule::GetPlayStatusRspCmd(
+ ControlPlayStatus aPlayStatus, uint32_t aSongLen, uint32_t aSongPos,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAY_STATUS_RSP,
+ 1 + // Play status
+ 4 + // Duration
+ 4)); // Position
+
+ nsresult rv = PackPDU(aPlayStatus, aSongLen, aSongPos, *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspCmd(
+ int aNumAttr, const BluetoothAvrcpPlayerAttribute* aPAttrs,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_ATTR_RSP,
+ 1 + // # Attributes
+ aNumAttr)); // Player attributes
+
+ nsresult rv = PackPDU(
+ PackConversion(aNumAttr),
+ PackArray(aPAttrs, aNumAttr), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::ListPlayerAppValueRspCmd(
+ int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_LIST_PLAYER_APP_VALUE_RSP,
+ 1 + // # Values
+ aNumVal)); // Player values
+
+ nsresult rv = PackPDU(PackConversion(aNumVal),
+ PackArray(aPVals, aNumVal), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::GetPlayerAppValueRspCmd(
+ uint8_t aNumAttrs, const uint8_t* aIds, const uint8_t* aValues,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_RSP,
+ 1 + // # Pairs
+ 2 * aNumAttrs)); // Attribute-value pairs
+ nsresult rv = PackPDU(
+ aNumAttrs,
+ BluetoothAvrcpAttributeValuePairs(aIds, aValues, aNumAttrs), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspCmd(
+ int aNumAttr, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP,
+ 0)); // Dynamically allocated
+ nsresult rv = PackPDU(
+ PackConversion(aNumAttr),
+ BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumAttr), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspCmd(
+ int aNumVal, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP,
+ 0)); // Dynamically allocated
+ nsresult rv = PackPDU(
+ PackConversion(aNumVal),
+ BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumVal), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::GetElementAttrRspCmd(
+ uint8_t aNumAttr, const BluetoothAvrcpElementAttribute* aAttr,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_GET_ELEMENT_ATTR_RSP,
+ 0)); // Dynamically allocated
+ nsresult rv = PackPDU(
+ aNumAttr,
+ PackArray(aAttr, aNumAttr), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::SetPlayerAppValueRspCmd(
+ BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_SET_PLAYER_APP_VALUE_RSP,
+ 1)); // Status code
+
+ nsresult rv = PackPDU(aRspStatus, *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::RegisterNotificationRspCmd(
+ BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
+ const BluetoothAvrcpNotificationParam& aParam,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_REGISTER_NOTIFICATION_RSP,
+ 1 + // Event
+ 1 + // Type
+ 1 + // Data length
+ 256)); // Maximum data length
+
+ nsresult rv = PackPDU(aEvent, aType,
+ BluetoothAvrcpEventParamPair(aEvent, aParam), *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+nsresult
+BluetoothDaemonAvrcpModule::SetVolumeCmd(uint8_t aVolume,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ nsAutoPtr pdu(
+ new BluetoothDaemonPDU(SERVICE_ID, OPCODE_SET_VOLUME,
+ 1)); // Volume
+
+ nsresult rv = PackPDU(aVolume, *pdu);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = Send(pdu, aRes);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ unused << pdu.forget();
+ return NS_OK;
+}
+
+// Responses
+//
+
+void
+BluetoothDaemonAvrcpModule::ErrorRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ErrorRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::OnError, UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::GetPlayStatusRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::ListPlayerAppAttrRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::ListPlayerAppValueRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::ListPlayerAppValueRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppValueRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::GetPlayerAppAttrTextRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::GetPlayerAppValueTextRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetElementAttrRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::GetElementAttrRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::SetPlayerAppValueRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::SetPlayerAppValueRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::RegisterNotificationRspRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::RegisterNotificationRsp,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::SetVolumeRsp(
+ const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, BluetoothAvrcpResultHandler* aRes)
+{
+ ResultRunnable::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::SetVolume,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::HandleRsp(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+ void* aUserData)
+{
+ static void (BluetoothDaemonAvrcpModule::* const HandleRsp[])(
+ const BluetoothDaemonPDUHeader&,
+ BluetoothDaemonPDU&,
+ BluetoothAvrcpResultHandler*) = {
+ INIT_ARRAY_AT(OPCODE_ERROR,
+ &BluetoothDaemonAvrcpModule::ErrorRsp),
+ INIT_ARRAY_AT(OPCODE_GET_PLAY_STATUS_RSP,
+ &BluetoothDaemonAvrcpModule::GetPlayStatusRspRsp),
+ INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_ATTR_RSP,
+ &BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspRsp),
+ INIT_ARRAY_AT(OPCODE_LIST_PLAYER_APP_VALUE_RSP,
+ &BluetoothDaemonAvrcpModule::ListPlayerAppValueRspRsp),
+ INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_VALUE_RSP,
+ &BluetoothDaemonAvrcpModule::GetPlayerAppValueRspRsp),
+ INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP,
+ &BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspRsp),
+ INIT_ARRAY_AT(OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP,
+ &BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspRsp),
+ INIT_ARRAY_AT(OPCODE_GET_ELEMENT_ATTR_RSP,
+ &BluetoothDaemonAvrcpModule::GetElementAttrRspRsp),
+ INIT_ARRAY_AT(OPCODE_SET_PLAYER_APP_VALUE_RSP,
+ &BluetoothDaemonAvrcpModule::SetPlayerAppValueRspRsp),
+ INIT_ARRAY_AT(OPCODE_REGISTER_NOTIFICATION_RSP,
+ &BluetoothDaemonAvrcpModule::RegisterNotificationRspRsp),
+ INIT_ARRAY_AT(OPCODE_SET_VOLUME,
+ &BluetoothDaemonAvrcpModule::SetVolumeRsp)
+ };
+
+ MOZ_ASSERT(!NS_IsMainThread()); // I/O thread
+
+ if (NS_WARN_IF(!(aHeader.mOpcode < MOZ_ARRAY_LENGTH(HandleRsp))) ||
+ NS_WARN_IF(!HandleRsp[aHeader.mOpcode])) {
+ return;
+ }
+
+ nsRefPtr res =
+ already_AddRefed(
+ static_cast(aUserData));
+
+ if (!res) {
+ return; // Return early if no result handler has been set for response
+ }
+
+ (this->*(HandleRsp[aHeader.mOpcode]))(aHeader, aPDU, res);
+}
+
+// Notifications
+//
+
+// Returns the current notification handler to a notification runnable
+class BluetoothDaemonAvrcpModule::NotificationHandlerWrapper MOZ_FINAL
+{
+public:
+ typedef BluetoothAvrcpNotificationHandler ObjectType;
+
+ static ObjectType* GetInstance()
+ {
+ MOZ_ASSERT(NS_IsMainThread());
+
+ return sNotificationHandler;
+ }
+};
+
+// Init operator class for RemoteFeatureNotification
+class BluetoothDaemonAvrcpModule::RemoteFeatureInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ RemoteFeatureInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (nsString& aArg1, unsigned long& aArg2) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ /* Read address */
+ nsresult rv = UnpackPDU(
+ pdu, UnpackConversion(aArg1));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read feature */
+ rv = UnpackPDU(
+ pdu,
+ UnpackConversion(aArg2));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::RemoteFeatureNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ RemoteFeatureNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::RemoteFeatureNotification,
+ RemoteFeatureInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::GetPlayStatusNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ GetPlayStatusNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::GetPlayStatusNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ ListPlayerAppAttrNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::ListPlayerAppAttrNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ ListPlayerAppValuesNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::ListPlayerAppValuesNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+// Init operator class for GetPlayerAppValueNotification
+class BluetoothDaemonAvrcpModule::GetPlayerAppValueInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ GetPlayerAppValueInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (uint8_t& aArg1,
+ nsAutoArrayPtr& aArg2) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ /* Read number of attributes */
+ nsresult rv = UnpackPDU(pdu, aArg1);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read attributes */
+ rv = UnpackPDU(
+ pdu, UnpackArray(aArg2, aArg1));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ GetPlayerAppValueNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::GetPlayerAppValueNotification,
+ GetPlayerAppValueInitOp(aPDU));
+}
+
+// Init operator class for GetPlayerAppAttrsTextNotification
+class BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ GetPlayerAppAttrsTextInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (uint8_t& aArg1,
+ nsAutoArrayPtr& aArg2) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ /* Read number of attributes */
+ nsresult rv = UnpackPDU(pdu, aArg1);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read attributes */
+ rv = UnpackPDU(
+ pdu, UnpackArray(aArg2, aArg1));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ GetPlayerAppAttrsTextNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::GetPlayerAppAttrsTextNotification,
+ GetPlayerAppAttrsTextInitOp(aPDU));
+}
+
+// Init operator class for GetPlayerAppValuesTextNotification
+class BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ GetPlayerAppValuesTextInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (uint8_t& aArg1, uint8_t& aArg2,
+ nsAutoArrayPtr& aArg3) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ /* Read attribute */
+ nsresult rv = UnpackPDU(pdu, aArg1);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read number of values */
+ rv = UnpackPDU(pdu, aArg2);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read values */
+ rv = UnpackPDU(pdu, UnpackArray(aArg3, aArg2));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ GetPlayerAppValuesTextNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::GetPlayerAppValuesTextNotification,
+ GetPlayerAppValuesTextInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ SetPlayerAppValueNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::SetPlayerAppValueNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+// Init operator class for GetElementAttrNotification
+class BluetoothDaemonAvrcpModule::GetElementAttrInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ GetElementAttrInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (uint8_t& aArg1,
+ nsAutoArrayPtr& aArg2) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ /* Read number of attributes */
+ nsresult rv = UnpackPDU(pdu, aArg1);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ /* Read attributes */
+ rv = UnpackPDU(
+ pdu, UnpackArray(aArg2, aArg1));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::GetElementAttrNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ GetElementAttrNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::GetElementAttrNotification,
+ GetElementAttrInitOp(aPDU));
+}
+
+void
+BluetoothDaemonAvrcpModule::RegisterNotificationNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ RegisterNotificationNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::RegisterNotificationNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+#if ANDROID_VERSION >= 19
+void
+BluetoothDaemonAvrcpModule::VolumeChangeNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ VolumeChangeNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::VolumeChangeNotification,
+ UnpackPDUInitOp(aPDU));
+}
+
+// Init operator class for PassthroughCmdNotification
+class BluetoothDaemonAvrcpModule::PassthroughCmdInitOp MOZ_FINAL
+ : private PDUInitOp
+{
+public:
+ PassthroughCmdInitOp(BluetoothDaemonPDU& aPDU)
+ : PDUInitOp(aPDU)
+ { }
+
+ nsresult
+ operator () (int& aArg1, int& aArg2) const
+ {
+ BluetoothDaemonPDU& pdu = GetPDU();
+
+ nsresult rv = UnpackPDU(pdu, UnpackConversion(aArg1));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = UnpackPDU(pdu, UnpackConversion(aArg2));
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ WarnAboutTrailingData();
+ return NS_OK;
+ }
+};
+
+void
+BluetoothDaemonAvrcpModule::PassthroughCmdNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU)
+{
+ PassthroughCmdNotification::Dispatch(
+ &BluetoothAvrcpNotificationHandler::PassthroughCmdNotification,
+ PassthroughCmdInitOp(aPDU));
+}
+#endif
+
+void
+BluetoothDaemonAvrcpModule::HandleNtf(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+ void* aUserData)
+{
+ static void (BluetoothDaemonAvrcpModule::* const HandleNtf[])(
+ const BluetoothDaemonPDUHeader&, BluetoothDaemonPDU&) = {
+#if ANDROID_VERSION >= 19
+ INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::RemoteFeatureNtf),
+ INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::GetPlayStatusNtf),
+ INIT_ARRAY_AT(2, &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf),
+ INIT_ARRAY_AT(3, &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf),
+ INIT_ARRAY_AT(4, &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf),
+ INIT_ARRAY_AT(5, &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf),
+ INIT_ARRAY_AT(6, &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf),
+ INIT_ARRAY_AT(7, &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf),
+ INIT_ARRAY_AT(8, &BluetoothDaemonAvrcpModule::GetElementAttrNtf),
+ INIT_ARRAY_AT(9, &BluetoothDaemonAvrcpModule::RegisterNotificationNtf),
+ INIT_ARRAY_AT(10, &BluetoothDaemonAvrcpModule::VolumeChangeNtf),
+ INIT_ARRAY_AT(11, &BluetoothDaemonAvrcpModule::PassthroughCmdNtf)
+#else
+ INIT_ARRAY_AT(0, &BluetoothDaemonAvrcpModule::GetPlayStatusNtf),
+ INIT_ARRAY_AT(1, &BluetoothDaemonAvrcpModule::ListPlayerAppAttrNtf),
+ INIT_ARRAY_AT(2, &BluetoothDaemonAvrcpModule::ListPlayerAppValuesNtf),
+ INIT_ARRAY_AT(3, &BluetoothDaemonAvrcpModule::GetPlayerAppValueNtf),
+ INIT_ARRAY_AT(4, &BluetoothDaemonAvrcpModule::GetPlayerAppAttrsTextNtf),
+ INIT_ARRAY_AT(5, &BluetoothDaemonAvrcpModule::GetPlayerAppValuesTextNtf),
+ INIT_ARRAY_AT(6, &BluetoothDaemonAvrcpModule::SetPlayerAppValueNtf),
+ INIT_ARRAY_AT(7, &BluetoothDaemonAvrcpModule::GetElementAttrNtf),
+ INIT_ARRAY_AT(8, &BluetoothDaemonAvrcpModule::RegisterNotificationNtf)
+#endif
+ };
+
+ MOZ_ASSERT(!NS_IsMainThread());
+
+ uint8_t index = aHeader.mOpcode - 0x81;
+
+ if (NS_WARN_IF(!(index < MOZ_ARRAY_LENGTH(HandleNtf))) ||
+ NS_WARN_IF(!HandleNtf[index])) {
+ return;
+ }
+
+ (this->*(HandleNtf[index]))(aHeader, aPDU);
+}
+
+//
+// AVRCP interface
+//
+
+BluetoothDaemonAvrcpInterface::BluetoothDaemonAvrcpInterface(
+ BluetoothDaemonAvrcpModule* aModule)
+ : mModule(aModule)
+{ }
+
+BluetoothDaemonAvrcpInterface::~BluetoothDaemonAvrcpInterface()
+{ }
+
+class BluetoothDaemonAvrcpInterface::InitResultHandler MOZ_FINAL
+ : public BluetoothSetupResultHandler
+{
+public:
+ InitResultHandler(BluetoothAvrcpResultHandler* aRes)
+ : mRes(aRes)
+ {
+ MOZ_ASSERT(mRes);
+ }
+
+ void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(NS_IsMainThread());
+
+ mRes->OnError(aStatus);
+ }
+
+ void RegisterModule() MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(NS_IsMainThread());
+
+ mRes->Init();
+ }
+
+private:
+ nsRefPtr mRes;
+};
+
+void
+BluetoothDaemonAvrcpInterface::Init(
+ BluetoothAvrcpNotificationHandler* aNotificationHandler,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ // Set notification handler _before_ registering the module. It could
+ // happen that we receive notifications, before the result handler runs.
+ mModule->SetNotificationHandler(aNotificationHandler);
+
+ InitResultHandler* res;
+
+ if (aRes) {
+ res = new InitResultHandler(aRes);
+ } else {
+ // We don't need a result handler if the caller is not interested.
+ res = nullptr;
+ }
+
+ nsresult rv = mModule->RegisterModule(
+ BluetoothDaemonAvrcpModule::SERVICE_ID, 0x00, res);
+
+ if (NS_FAILED(rv) && aRes) {
+ DispatchError(aRes, STATUS_FAIL);
+ }
+}
+
+class BluetoothDaemonAvrcpInterface::CleanupResultHandler MOZ_FINAL
+ : public BluetoothSetupResultHandler
+{
+public:
+ CleanupResultHandler(BluetoothDaemonAvrcpModule* aModule,
+ BluetoothAvrcpResultHandler* aRes)
+ : mModule(aModule)
+ , mRes(aRes)
+ {
+ MOZ_ASSERT(mModule);
+ }
+
+ void OnError(BluetoothStatus aStatus) MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(NS_IsMainThread());
+
+ if (mRes) {
+ mRes->OnError(aStatus);
+ }
+ }
+
+ void UnregisterModule() MOZ_OVERRIDE
+ {
+ MOZ_ASSERT(NS_IsMainThread());
+
+ // Clear notification handler _after_ module has been
+ // unregistered. While unregistering the module, we might
+ // still receive notifications.
+ mModule->SetNotificationHandler(nullptr);
+
+ if (mRes) {
+ mRes->Cleanup();
+ }
+ }
+
+private:
+ BluetoothDaemonAvrcpModule* mModule;
+ nsRefPtr mRes;
+};
+
+void
+BluetoothDaemonAvrcpInterface::Cleanup(
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->UnregisterModule(BluetoothDaemonAvrcpModule::SERVICE_ID,
+ new CleanupResultHandler(mModule, aRes));
+}
+
+void
+BluetoothDaemonAvrcpInterface::GetPlayStatusRsp(
+ ControlPlayStatus aPlayStatus, uint32_t aSongLen, uint32_t aSongPos,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->GetPlayStatusRspCmd(aPlayStatus, aSongLen, aSongPos, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::ListPlayerAppAttrRsp(
+ int aNumAttr, const BluetoothAvrcpPlayerAttribute* aPAttrs,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->ListPlayerAppAttrRspCmd(aNumAttr, aPAttrs, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::ListPlayerAppValueRsp(
+ int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->ListPlayerAppValueRspCmd(aNumVal, aPVals, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::GetPlayerAppValueRsp(
+ uint8_t aNumAttrs, const uint8_t* aIds, const uint8_t* aValues,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->GetPlayerAppValueRspCmd(aNumAttrs, aIds, aValues, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::GetPlayerAppAttrTextRsp(
+ int aNumAttr, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->GetPlayerAppAttrTextRspCmd(aNumAttr, aIds, aTexts, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::GetPlayerAppValueTextRsp(
+ int aNumVal, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->GetPlayerAppValueTextRspCmd(aNumVal, aIds, aTexts, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::GetElementAttrRsp(
+ uint8_t aNumAttr, const BluetoothAvrcpElementAttribute* aAttr,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->GetElementAttrRspCmd(aNumAttr, aAttr, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::SetPlayerAppValueRsp(
+ BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->SetPlayerAppValueRspCmd(aRspStatus, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::RegisterNotificationRsp(
+ BluetoothAvrcpEvent aEvent,
+ BluetoothAvrcpNotification aType,
+ const BluetoothAvrcpNotificationParam& aParam,
+ BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->RegisterNotificationRspCmd(aEvent, aType, aParam, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::SetVolume(
+ uint8_t aVolume, BluetoothAvrcpResultHandler* aRes)
+{
+ MOZ_ASSERT(mModule);
+
+ mModule->SetVolumeCmd(aVolume, aRes);
+}
+
+void
+BluetoothDaemonAvrcpInterface::DispatchError(
+ BluetoothAvrcpResultHandler* aRes, BluetoothStatus aStatus)
+{
+ BluetoothResultRunnable1::Dispatch(
+ aRes, &BluetoothAvrcpResultHandler::OnError,
+ ConstantInitOp1(aStatus));
+}
+
+END_BLUETOOTH_NAMESPACE
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.h 2015-01-09 12:36:47.000000000 +0000
@@ -0,0 +1,352 @@
+/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
+/* vim: set ts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_dom_bluetooth_bluetoothdaemonavrcpinterface_h
+#define mozilla_dom_bluetooth_bluetoothdaemonavrcpinterface_h
+
+#include "BluetoothDaemonHelpers.h"
+#include "BluetoothInterface.h"
+#include "BluetoothInterfaceHelpers.h"
+
+BEGIN_BLUETOOTH_NAMESPACE
+
+class BluetoothSetupResultHandler;
+
+class BluetoothDaemonAvrcpModule
+{
+public:
+ enum {
+ SERVICE_ID = 0x08
+ };
+
+ enum {
+ OPCODE_ERROR = 0x00,
+ OPCODE_GET_PLAY_STATUS_RSP = 0x01,
+ OPCODE_LIST_PLAYER_APP_ATTR_RSP = 0x02,
+ OPCODE_LIST_PLAYER_APP_VALUE_RSP = 0x03,
+ OPCODE_GET_PLAYER_APP_VALUE_RSP = 0x04,
+ OPCODE_GET_PLAYER_APP_ATTR_TEXT_RSP = 0x05,
+ OPCODE_GET_PLAYER_APP_VALUE_TEXT_RSP = 0x06,
+ OPCODE_GET_ELEMENT_ATTR_RSP = 0x07,
+ OPCODE_SET_PLAYER_APP_VALUE_RSP = 0x08,
+ OPCODE_REGISTER_NOTIFICATION_RSP = 0x09,
+ OPCODE_SET_VOLUME = 0x0a,
+#if ANDROID_VERSION >= 19
+ OPCODE_REMOTE_FEATURES_NTF = 0x81,
+ OPCODE_GET_PLAY_STATUS_NTF = 0x82,
+ OPCODE_LIST_PLAYER_APP_ATTR_NTF = 0x83,
+ OPCODE_LIST_PLAYER_APP_VALUES_NTF = 0x84,
+ OPCODE_GET_PLAYER_APP_VALUE_NTF = 0x85,
+ OPCODE_GET_PLAYER_APP_ATTRS_TEXT_NTF = 0x86,
+ OPCODE_GET_PLAYER_APP_VALUES_TEXT_NTF = 0x87,
+ OPCODE_SET_PLAYER_APP_VALUE_NTF = 0x88,
+ OPCODE_GET_ELEMENT_ATTR_NTF = 0x89,
+ OPCODE_REGISTER_NOTIFICATION_NTF = 0x8a,
+ OPCODE_VOLUME_CHANGE_NTF = 0x8b,
+ OPCODE_PASSTHROUGH_CMD_NTF = 0x8c
+#else /* defined by BlueZ 5.14 */
+ OPCODE_GET_PLAY_STATUS_NTF = 0x81,
+ OPCODE_LIST_PLAYER_APP_ATTR_NTF = 0x82,
+ OPCODE_LIST_PLAYER_APP_VALUES_NTF = 0x83,
+ OPCODE_GET_PLAYER_APP_VALUE_NTF = 0x84,
+ OPCODE_GET_PLAYER_APP_ATTRS_TEXT_NTF = 0x85,
+ OPCODE_GET_PLAYER_APP_VALUES_TEXT_NTF = 0x86,
+ OPCODE_SET_PLAYER_APP_VALUE_NTF = 0x87,
+ OPCODE_GET_ELEMENT_ATTR_NTF = 0x88,
+ OPCODE_REGISTER_NOTIFICATION_NTF = 0x89
+#endif
+ };
+
+ virtual nsresult Send(BluetoothDaemonPDU* aPDU, void* aUserData) = 0;
+
+ virtual nsresult RegisterModule(uint8_t aId, uint8_t aMode,
+ BluetoothSetupResultHandler* aRes) = 0;
+
+ virtual nsresult UnregisterModule(uint8_t aId,
+ BluetoothSetupResultHandler* aRes) = 0;
+
+ void SetNotificationHandler(
+ BluetoothAvrcpNotificationHandler* aNotificationHandler);
+
+ //
+ // Commands
+ //
+
+ nsresult GetPlayStatusRspCmd(
+ ControlPlayStatus aPlayStatus, uint32_t aSongLen, uint32_t aSongPos,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult ListPlayerAppAttrRspCmd(
+ int aNumAttr, const BluetoothAvrcpPlayerAttribute* aPAttrs,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult ListPlayerAppValueRspCmd(
+ int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes);
+
+ nsresult GetPlayerAppValueRspCmd(
+ uint8_t aNumAttrs, const uint8_t* aIds, const uint8_t* aValues,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult GetPlayerAppAttrTextRspCmd(
+ int aNumAttr, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult GetPlayerAppValueTextRspCmd(
+ int aNumVal, const uint8_t* aIds, const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult GetElementAttrRspCmd(
+ uint8_t aNumAttr, const BluetoothAvrcpElementAttribute* aAttr,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult SetPlayerAppValueRspCmd(
+ BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes);
+
+ nsresult RegisterNotificationRspCmd(
+ BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
+ const BluetoothAvrcpNotificationParam& aParam,
+ BluetoothAvrcpResultHandler* aRes);
+
+ nsresult SetVolumeCmd(uint8_t aVolume, BluetoothAvrcpResultHandler* aRes);
+
+protected:
+ nsresult Send(BluetoothDaemonPDU* aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void HandleSvc(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, void* aUserData);
+
+ //
+ // Responses
+ //
+
+ typedef BluetoothResultRunnable0
+ ResultRunnable;
+
+ typedef BluetoothResultRunnable1
+ ErrorRunnable;
+
+ void ErrorRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void GetPlayStatusRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void ListPlayerAppAttrRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void ListPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void GetPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void GetPlayerAppAttrTextRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void GetPlayerAppValueTextRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void GetElementAttrRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void SetPlayerAppValueRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void RegisterNotificationRspRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void SetVolumeRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ BluetoothAvrcpResultHandler* aRes);
+
+ void HandleRsp(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ void* aUserData);
+
+ //
+ // Notifications
+ //
+
+ class NotificationHandlerWrapper;
+
+ typedef BluetoothNotificationRunnable2
+ RemoteFeatureNotification;
+
+ typedef BluetoothNotificationRunnable0
+ GetPlayStatusNotification;
+
+ typedef BluetoothNotificationRunnable0
+ ListPlayerAppAttrNotification;
+
+ typedef BluetoothNotificationRunnable1
+ ListPlayerAppValuesNotification;
+
+ typedef BluetoothNotificationRunnable2,
+ uint8_t, const BluetoothAvrcpPlayerAttribute*>
+ GetPlayerAppValueNotification;
+
+ typedef BluetoothNotificationRunnable2,
+ uint8_t, const BluetoothAvrcpPlayerAttribute*>
+ GetPlayerAppAttrsTextNotification;
+
+ typedef BluetoothNotificationRunnable3, uint8_t,
+ uint8_t, const uint8_t*>
+ GetPlayerAppValuesTextNotification;
+
+ typedef BluetoothNotificationRunnable1
+ SetPlayerAppValueNotification;
+
+ typedef BluetoothNotificationRunnable2,
+ uint8_t, const BluetoothAvrcpMediaAttribute*>
+ GetElementAttrNotification;
+
+ typedef BluetoothNotificationRunnable2
+ RegisterNotificationNotification;
+
+ typedef BluetoothNotificationRunnable2
+ VolumeChangeNotification;
+
+ typedef BluetoothNotificationRunnable2
+ PassthroughCmdNotification;
+
+ class GetElementAttrInitOp;
+ class GetPlayerAppAttrsTextInitOp;
+ class GetPlayerAppValueInitOp;
+ class GetPlayerAppValuesTextInitOp;
+ class PassthroughCmdInitOp;
+ class RemoteFeatureInitOp;
+
+ void RemoteFeatureNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void GetPlayStatusNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void ListPlayerAppAttrNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void ListPlayerAppValuesNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void GetPlayerAppValueNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void GetPlayerAppAttrsTextNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void GetPlayerAppValuesTextNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void SetPlayerAppValueNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void GetElementAttrNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void RegisterNotificationNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void VolumeChangeNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void PassthroughCmdNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU);
+
+ void HandleNtf(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU,
+ void* aUserData);
+
+ static BluetoothAvrcpNotificationHandler* sNotificationHandler;
+};
+
+class BluetoothDaemonAvrcpInterface MOZ_FINAL
+ : public BluetoothAvrcpInterface
+{
+ class CleanupResultHandler;
+ class InitResultHandler;
+
+public:
+ BluetoothDaemonAvrcpInterface(BluetoothDaemonAvrcpModule* aModule);
+ ~BluetoothDaemonAvrcpInterface();
+
+ void Init(BluetoothAvrcpNotificationHandler* aNotificationHandler,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void Cleanup(BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void GetPlayStatusRsp(ControlPlayStatus aPlayStatus,
+ uint32_t aSongLen, uint32_t aSongPos,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void ListPlayerAppAttrRsp(int aNumAttr,
+ const BluetoothAvrcpPlayerAttribute* aPAttrs,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void ListPlayerAppValueRsp(int aNumVal, uint8_t* aPVals,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void GetPlayerAppValueRsp(uint8_t aNumAttrs, const uint8_t* aIds,
+ const uint8_t* aValues,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void GetPlayerAppAttrTextRsp(int aNumAttr, const uint8_t* aIds,
+ const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void GetPlayerAppValueTextRsp(int aNumVal, const uint8_t* aIds,
+ const char** aTexts,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void GetElementAttrRsp(uint8_t aNumAttr,
+ const BluetoothAvrcpElementAttribute* aAttr,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void SetPlayerAppValueRsp(BluetoothAvrcpStatus aRspStatus,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void RegisterNotificationRsp(BluetoothAvrcpEvent aEvent,
+ BluetoothAvrcpNotification aType,
+ const BluetoothAvrcpNotificationParam& aParam,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+ void SetVolume(uint8_t aVolume,
+ BluetoothAvrcpResultHandler* aRes) MOZ_OVERRIDE;
+
+private:
+ void DispatchError(BluetoothAvrcpResultHandler* aRes,
+ BluetoothStatus aStatus);
+
+ BluetoothDaemonAvrcpModule* mModule;
+};
+
+END_BLUETOOTH_NAMESPACE
+
+#endif
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp 2015-01-09 12:36:47.000000000 +0000
@@ -70,6 +70,39 @@
}
nsresult
+Convert(int32_t aIn, BluetoothDeviceType& aOut)
+{
+ static const BluetoothDeviceType sDeviceType[] = {
+ CONVERT(0x00, static_cast(0)), // invalid, required by gcc
+ CONVERT(0x01, DEVICE_TYPE_BREDR),
+ CONVERT(0x02, DEVICE_TYPE_BLE),
+ CONVERT(0x03, DEVICE_TYPE_DUAL)
+ };
+ if (NS_WARN_IF(!aIn) ||
+ NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sDeviceType))) {
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sDeviceType[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(int32_t aIn, BluetoothScanMode& aOut)
+{
+ static const BluetoothScanMode sScanMode[] = {
+ CONVERT(0x00, SCAN_MODE_NONE),
+ CONVERT(0x01, SCAN_MODE_CONNECTABLE),
+ CONVERT(0x02, SCAN_MODE_CONNECTABLE_DISCOVERABLE)
+ };
+ if (NS_WARN_IF(aIn < 0) ||
+ NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sScanMode))) {
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sScanMode[aIn];
+ return NS_OK;
+}
+
+nsresult
Convert(uint8_t aIn, bool& aOut)
{
static const bool sBool[] = {
@@ -98,6 +131,13 @@
}
nsresult
+Convert(uint8_t aIn, unsigned long& aOut)
+{
+ aOut = static_cast(aIn);
+ return NS_OK;
+}
+
+nsresult
Convert(uint8_t aIn, BluetoothA2dpAudioState& aOut)
{
static const BluetoothA2dpAudioState sAudioState[] = {
@@ -143,6 +183,93 @@
}
nsresult
+Convert(uint8_t aIn, BluetoothAvrcpEvent& aOut)
+{
+ static const BluetoothAvrcpEvent sAvrcpEvent[] = {
+ CONVERT(0x00, static_cast(0)),
+ CONVERT(0x01, AVRCP_EVENT_PLAY_STATUS_CHANGED),
+ CONVERT(0x02, AVRCP_EVENT_TRACK_CHANGE),
+ CONVERT(0x03, AVRCP_EVENT_TRACK_REACHED_END),
+ CONVERT(0x04, AVRCP_EVENT_TRACK_REACHED_START),
+ CONVERT(0x05, AVRCP_EVENT_PLAY_POS_CHANGED),
+ CONVERT(0x06, static_cast(0)),
+ CONVERT(0x07, static_cast(0)),
+ CONVERT(0x08, AVRCP_EVENT_APP_SETTINGS_CHANGED)
+ };
+ if (NS_WARN_IF(!aIn) ||
+ NS_WARN_IF(aIn == 0x06) ||
+ NS_WARN_IF(aIn == 0x07) ||
+ NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpEvent))) {
+ aOut = static_cast(0); // silences compiler warning
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sAvrcpEvent[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpMediaAttribute& aOut)
+{
+ static const BluetoothAvrcpMediaAttribute sAvrcpMediaAttribute[] = {
+ CONVERT(0x00, static_cast(0)),
+ CONVERT(0x01, AVRCP_MEDIA_ATTRIBUTE_TITLE),
+ CONVERT(0x02, AVRCP_MEDIA_ATTRIBUTE_ARTIST),
+ CONVERT(0x03, AVRCP_MEDIA_ATTRIBUTE_ALBUM),
+ CONVERT(0x04, AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM),
+ CONVERT(0x05, AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS),
+ CONVERT(0x06, AVRCP_MEDIA_ATTRIBUTE_GENRE),
+ CONVERT(0x07, AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME)
+ };
+ if (NS_WARN_IF(!aIn) ||
+ NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpMediaAttribute))) {
+ // silences compiler warning
+ aOut = static_cast(0);
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sAvrcpMediaAttribute[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpPlayerAttribute& aOut)
+{
+ static const BluetoothAvrcpPlayerAttribute sAvrcpPlayerAttribute[] = {
+ CONVERT(0x00, static_cast(0)),
+ CONVERT(0x01, AVRCP_PLAYER_ATTRIBUTE_EQUALIZER),
+ CONVERT(0x02, AVRCP_PLAYER_ATTRIBUTE_REPEAT),
+ CONVERT(0x03, AVRCP_PLAYER_ATTRIBUTE_SHUFFLE),
+ CONVERT(0x04, AVRCP_PLAYER_ATTRIBUTE_SCAN)
+ };
+ if (NS_WARN_IF(!aIn) ||
+ NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpPlayerAttribute))) {
+ // silences compiler warning
+ aOut = static_cast(0);
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sAvrcpPlayerAttribute[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpRemoteFeature& aOut)
+{
+ static const BluetoothAvrcpRemoteFeature sAvrcpRemoteFeature[] = {
+ CONVERT(0x00, AVRCP_REMOTE_FEATURE_NONE),
+ CONVERT(0x01, AVRCP_REMOTE_FEATURE_METADATA),
+ CONVERT(0x02, AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME),
+ CONVERT(0x03, AVRCP_REMOTE_FEATURE_BROWSE)
+ };
+ if (NS_WARN_IF(!aIn) ||
+ NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpRemoteFeature))) {
+ // silences compiler warning
+ aOut = static_cast(0);
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sAvrcpRemoteFeature[aIn];
+ return NS_OK;
+}
+
+nsresult
Convert(uint8_t aIn, BluetoothBondState& aOut)
{
static const BluetoothBondState sBondState[] = {
@@ -249,23 +376,6 @@
}
nsresult
-Convert(int32_t aIn, BluetoothDeviceType& aOut)
-{
- static const BluetoothDeviceType sDeviceType[] = {
- CONVERT(0x00, static_cast(0)), // invalid, required by gcc
- CONVERT(0x01, DEVICE_TYPE_BREDR),
- CONVERT(0x02, DEVICE_TYPE_BLE),
- CONVERT(0x03, DEVICE_TYPE_DUAL)
- };
- if (NS_WARN_IF(!aIn) ||
- NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sDeviceType))) {
- return NS_ERROR_ILLEGAL_VALUE;
- }
- aOut = sDeviceType[aIn];
- return NS_OK;
-}
-
-nsresult
Convert(uint8_t aIn, BluetoothPropertyType& aOut)
{
static const BluetoothPropertyType sPropertyType[] = {
@@ -318,22 +428,6 @@
}
nsresult
-Convert(int32_t aIn, BluetoothScanMode& aOut)
-{
- static const BluetoothScanMode sScanMode[] = {
- CONVERT(0x00, SCAN_MODE_NONE),
- CONVERT(0x01, SCAN_MODE_CONNECTABLE),
- CONVERT(0x02, SCAN_MODE_CONNECTABLE_DISCOVERABLE)
- };
- if (NS_WARN_IF(aIn < 0) ||
- NS_WARN_IF(static_cast(aIn) >= MOZ_ARRAY_LENGTH(sScanMode))) {
- return NS_ERROR_ILLEGAL_VALUE;
- }
- aOut = sScanMode[aIn];
- return NS_OK;
-}
-
-nsresult
Convert(uint8_t aIn, BluetoothSspPairingVariant& aOut)
{
static const BluetoothSspPairingVariant sSspPairingVariant[] = {
@@ -380,6 +474,18 @@
}
nsresult
+Convert(uint32_t aIn, uint8_t& aOut)
+{
+ if (NS_WARN_IF(aIn < std::numeric_limits::min()) ||
+ NS_WARN_IF(aIn > std::numeric_limits::max())) {
+ aOut = 0; // silences compiler warning
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = static_cast(aIn);
+ return NS_OK;
+}
+
+nsresult
Convert(size_t aIn, uint16_t& aOut)
{
if (NS_WARN_IF(aIn >= (1ul << 16))) {
@@ -522,6 +628,50 @@
}
nsresult
+Convert(BluetoothAvrcpEvent aIn, uint8_t& aOut)
+{
+ static const uint8_t sValue[] = {
+ CONVERT(AVRCP_EVENT_PLAY_STATUS_CHANGED, 0x01),
+ CONVERT(AVRCP_EVENT_TRACK_CHANGE, 0x02),
+ CONVERT(AVRCP_EVENT_TRACK_REACHED_END, 0x03),
+ CONVERT(AVRCP_EVENT_TRACK_REACHED_START, 0x04),
+ CONVERT(AVRCP_EVENT_PLAY_POS_CHANGED, 0x05),
+ CONVERT(AVRCP_EVENT_APP_SETTINGS_CHANGED, 0x08)
+ };
+ if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sValue[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(BluetoothAvrcpNotification aIn, uint8_t& aOut)
+{
+ static const bool sValue[] = {
+ CONVERT(AVRCP_NTF_INTERIM, 0x00),
+ CONVERT(AVRCP_NTF_CHANGED, 0x01)
+ };
+ if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sValue[aIn];
+ return NS_OK;
+}
+
+nsresult
+Convert(BluetoothAvrcpRemoteFeature aIn, unsigned long& aOut)
+{
+ if (NS_WARN_IF(aIn < std::numeric_limits::min()) ||
+ NS_WARN_IF(aIn > std::numeric_limits::max())) {
+ aOut = 0; // silences compiler warning
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = static_cast(aIn);
+ return NS_OK;
+}
+
+nsresult
Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut)
{
static const uint8_t sAtResponse[] = {
@@ -748,6 +898,30 @@
return NS_OK;
}
+nsresult
+Convert(ControlPlayStatus aIn, uint8_t& aOut)
+{
+ static const uint8_t sValue[] = {
+ CONVERT(PLAYSTATUS_STOPPED, 0x00),
+ CONVERT(PLAYSTATUS_PLAYING, 0x01),
+ CONVERT(PLAYSTATUS_PAUSED, 0x02),
+ CONVERT(PLAYSTATUS_FWD_SEEK, 0x03),
+ CONVERT(PLAYSTATUS_REV_SEEK, 0x04)
+ };
+ if (aIn == PLAYSTATUS_ERROR) {
+ /* This case is handled separately to not populate
+ * |sValue| with empty entries. */
+ aOut = 0xff;
+ return NS_OK;
+ }
+ if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+ aOut = 0; // silences compiler warning
+ return NS_ERROR_ILLEGAL_VALUE;
+ }
+ aOut = sValue[aIn];
+ return NS_OK;
+}
+
/* |ConvertArray| is a helper for converting arrays. Pass an
* instance of this structure as the first argument to |Convert|
* to convert an array. The output type has to support the array
@@ -799,6 +973,142 @@
}
nsresult
+PackPDU(const BluetoothAvrcpAttributeTextPairs& aIn,
+ BluetoothDaemonPDU& aPDU)
+{
+ size_t i;
+
+ for (i = 0; i < aIn.mLength; ++i) {
+ nsresult rv = PackPDU(aIn.mAttr[i], aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ uint8_t len;
+ const uint8_t* str;
+
+ if (aIn.mText[i]) {
+ str = reinterpret_cast(aIn.mText[i]);
+ len = strlen(aIn.mText[i]) + 1;
+ } else {
+ /* write \0 character for NULL strings */
+ str = reinterpret_cast("\0");
+ len = 1;
+ }
+
+ rv = PackPDU(len, aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = PackPDU(PackArray(str, len), aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ }
+ return NS_OK;
+}
+
+nsresult
+PackPDU(const BluetoothAvrcpAttributeValuePairs& aIn,
+ BluetoothDaemonPDU& aPDU)
+{
+ size_t i;
+
+ for (i = 0; i < aIn.mLength; ++i) {
+ nsresult rv = PackPDU(aIn.mAttr[i], aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = PackPDU(aIn.mValue[i], aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ }
+ return NS_OK;
+}
+
+nsresult
+PackPDU(const BluetoothAvrcpElementAttribute& aIn, BluetoothDaemonPDU& aPDU)
+{
+ nsresult rv = PackPDU(PackConversion(aIn.mId), aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ const NS_ConvertUTF16toUTF8 cstr(aIn.mValue);
+
+ if (NS_WARN_IF(cstr.Length() == PR_UINT32_MAX)) {
+ return NS_ERROR_ILLEGAL_VALUE; /* integer overflow detected */
+ }
+
+ PRUint32 clen = cstr.Length() + 1; /* include \0 character */
+
+ rv = PackPDU(PackConversion(clen), aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ return PackPDU(
+ PackArray(reinterpret_cast(cstr.get()), clen),
+ aPDU);
+}
+
+nsresult
+PackPDU(BluetoothAvrcpEvent aIn, BluetoothDaemonPDU& aPDU)
+{
+ return PackPDU(PackConversion(aIn), aPDU);
+}
+
+nsresult
+PackPDU(const BluetoothAvrcpEventParamPair& aIn, BluetoothDaemonPDU& aPDU)
+{
+ nsresult rv;
+
+ switch (aIn.mEvent) {
+ case AVRCP_EVENT_PLAY_STATUS_CHANGED:
+ rv = PackPDU(aIn.mParam.mPlayStatus, aPDU);
+ break;
+ case AVRCP_EVENT_TRACK_CHANGE:
+ rv = PackPDU(PackArray(aIn.mParam.mTrack,
+ MOZ_ARRAY_LENGTH(aIn.mParam.mTrack)),
+ aPDU);
+ break;
+ case AVRCP_EVENT_TRACK_REACHED_END:
+ /* fall through */
+ case AVRCP_EVENT_TRACK_REACHED_START:
+ /* no data to pack */
+ rv = NS_OK;
+ break;
+ case AVRCP_EVENT_PLAY_POS_CHANGED:
+ rv = PackPDU(aIn.mParam.mSongPos, aPDU);
+ break;
+ case AVRCP_EVENT_APP_SETTINGS_CHANGED:
+ /* pack number of attribute-value pairs */
+ rv = PackPDU(aIn.mParam.mNumAttr, aPDU);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ /* pack attribute-value pairs */
+ rv = PackPDU(BluetoothAvrcpAttributeValuePairs(aIn.mParam.mIds,
+ aIn.mParam.mValues,
+ aIn.mParam.mNumAttr),
+ aPDU);
+ break;
+ default:
+ rv = NS_ERROR_ILLEGAL_VALUE;
+ break;
+ }
+ return rv;
+}
+
+nsresult
+PackPDU(BluetoothAvrcpNotification aIn, BluetoothDaemonPDU& aPDU)
+{
+ return PackPDU(
+ PackConversion(aIn), aPDU);
+}
+
+nsresult
PackPDU(const BluetoothConfigurationParameter& aIn, BluetoothDaemonPDU& aPDU)
{
return PackPDU(aIn.mType, aIn.mLength,
@@ -949,6 +1259,12 @@
return PackPDU(PackConversion(aIn), aPDU);
}
+nsresult
+PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU)
+{
+ return PackPDU(PackConversion(aIn), aPDU);
+}
+
//
// Unpacking
//
@@ -986,6 +1302,56 @@
}
nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpEvent& aOut)
+{
+ return UnpackPDU(
+ aPDU, UnpackConversion(aOut));
+}
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut)
+{
+ return UnpackPDU(
+ aPDU, UnpackConversion(aOut));
+}
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut)
+{
+ return UnpackPDU(
+ aPDU, UnpackConversion(aOut));
+}
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut)
+{
+ /* Read number of attribute-value pairs */
+ nsresult rv = UnpackPDU(aPDU, aOut.mNumAttr);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ /* Read attribute-value pairs */
+ for (uint8_t i = 0; i < aOut.mNumAttr; ++i) {
+ nsresult rv = UnpackPDU(aPDU, aOut.mIds[i]);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ rv = UnpackPDU(aPDU, aOut.mValues[i]);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ }
+ return NS_OK;
+}
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut)
+{
+ return UnpackPDU(
+ aPDU, UnpackConversion(aOut));
+}
+
+nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothBondState& aOut)
{
return UnpackPDU(aPDU, UnpackConversion(aOut));
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.h 2015-01-09 12:36:47.000000000 +0000
@@ -50,6 +50,45 @@
uint8_t mAddr[6];
};
+struct BluetoothAvrcpAttributeTextPairs {
+ BluetoothAvrcpAttributeTextPairs(const uint8_t* aAttr,
+ const char** aText,
+ size_t aLength)
+ : mAttr(aAttr)
+ , mText(aText)
+ , mLength(aLength)
+ { }
+
+ const uint8_t* mAttr;
+ const char** mText;
+ size_t mLength;
+};
+
+struct BluetoothAvrcpAttributeValuePairs {
+ BluetoothAvrcpAttributeValuePairs(const uint8_t* aAttr,
+ const uint8_t* aValue,
+ size_t aLength)
+ : mAttr(aAttr)
+ , mValue(aValue)
+ , mLength(aLength)
+ { }
+
+ const uint8_t* mAttr;
+ const uint8_t* mValue;
+ size_t mLength;
+};
+
+struct BluetoothAvrcpEventParamPair {
+ BluetoothAvrcpEventParamPair(BluetoothAvrcpEvent aEvent,
+ const BluetoothAvrcpNotificationParam& aParam)
+ : mEvent(aEvent)
+ , mParam(aParam)
+ { }
+
+ BluetoothAvrcpEvent mEvent;
+ const BluetoothAvrcpNotificationParam& mParam;
+};
+
struct BluetoothConfigurationParameter {
uint8_t mType;
uint16_t mLength;
@@ -110,6 +149,12 @@
Convert(int aIn, int16_t& aOut);
nsresult
+Convert(int32_t aIn, BluetoothDeviceType& aOut);
+
+nsresult
+Convert(int32_t aIn, BluetoothScanMode& aOut);
+
+nsresult
Convert(uint8_t aIn, bool& aOut);
nsresult
@@ -119,6 +164,9 @@
Convert(uint8_t aIn, int& aOut);
nsresult
+Convert(uint8_t aIn, unsigned long& aOut);
+
+nsresult
Convert(uint8_t aIn, BluetoothA2dpAudioState& aOut);
nsresult
@@ -128,6 +176,18 @@
Convert(uint8_t aIn, BluetoothAclState& aOut);
nsresult
+Convert(uint8_t aIn, BluetoothAvrcpEvent& aOut);
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpMediaAttribute& aOut);
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpPlayerAttribute& aOut);
+
+nsresult
+Convert(uint8_t aIn, BluetoothAvrcpRemoteFeature& aOut);
+
+nsresult
Convert(uint8_t aIn, BluetoothHandsfreeAudioState& aOut);
nsresult
@@ -167,6 +227,9 @@
Convert(uint32_t aIn, int& aOut);
nsresult
+Convert(uint32_t aIn, uint8_t& aOut);
+
+nsresult
Convert(size_t aIn, uint16_t& aOut);
nsresult
@@ -191,6 +254,15 @@
Convert(const BluetoothAddress& aIn, nsAString& aOut);
nsresult
+Convert(BluetoothAvrcpEvent aIn, uint8_t& aOut);
+
+nsresult
+Convert(BluetoothAvrcpNotification aIn, uint8_t& aOut);
+
+nsresult
+Convert(BluetoothAvrcpRemoteFeature aIn, unsigned long& aOut);
+
+nsresult
Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut);
nsresult
@@ -235,6 +307,9 @@
nsresult
Convert(BluetoothSspPairingVariant aIn, nsAString& aOut);
+nsresult
+Convert(ControlPlayStatus aIn, uint8_t& aOut);
+
//
// Packing
//
@@ -270,6 +345,26 @@
PackPDU(const BluetoothAddress& aIn, BluetoothDaemonPDU& aPDU);
nsresult
+PackPDU(const BluetoothAvrcpAttributeTextPairs& aIn,
+ BluetoothDaemonPDU& aPDU);
+
+nsresult
+PackPDU(const BluetoothAvrcpAttributeValuePairs& aIn,
+ BluetoothDaemonPDU& aPDU);
+
+nsresult
+PackPDU(const BluetoothAvrcpElementAttribute& aIn, BluetoothDaemonPDU& aPDU);
+
+nsresult
+PackPDU(BluetoothAvrcpEvent aIn, BluetoothDaemonPDU& aPDU);
+
+nsresult
+PackPDU(const BluetoothAvrcpEventParamPair& aIn, BluetoothDaemonPDU& aPDU);
+
+nsresult
+PackPDU(BluetoothAvrcpNotification aIn, BluetoothDaemonPDU& aPDU);
+
+nsresult
PackPDU(const BluetoothConfigurationParameter& aIn, BluetoothDaemonPDU& aPDU);
nsresult
@@ -323,6 +418,9 @@
nsresult
PackPDU(BluetoothScanMode aIn, BluetoothDaemonPDU& aPDU);
+nsresult
+PackPDU(ControlPlayStatus aIn, BluetoothDaemonPDU& aPDU);
+
/* |PackConversion| is a helper for packing converted values. Pass
* an instance of this structure to |PackPDU| to convert a value from
* the input type to the output type and and write it to the PDU.
@@ -576,6 +674,21 @@
}
nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpEvent& aOut);
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpMediaAttribute& aOut);
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerAttribute& aOut);
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpPlayerSettings& aOut);
+
+nsresult
+UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothAvrcpRemoteFeature& aOut);
+
+nsresult
UnpackPDU(BluetoothDaemonPDU& aPDU, BluetoothBondState& aOut);
inline nsresult
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp 2015-01-09 12:36:47.000000000 +0000
@@ -6,6 +6,7 @@
#include "BluetoothDaemonInterface.h"
#include "BluetoothDaemonA2dpInterface.h"
+#include "BluetoothDaemonAvrcpInterface.h"
#include "BluetoothDaemonHandsfreeInterface.h"
#include "BluetoothDaemonHelpers.h"
#include "BluetoothDaemonSetupInterface.h"
@@ -1356,6 +1357,54 @@
// Protocol handling
//
+// |BluetoothDaemonProtocol| is the central class for communicating
+// with the Bluetooth daemon. It maintains both socket connections
+// to the external daemon and implements the complete HAL protocol
+// by inheriting from base-class modules.
+//
+// Each |BluetoothDaemon*Module| class implements an individual
+// module of the HAL protocol. Each class contains the abstract
+// methods
+//
+// - |Send|,
+// - |RegisterModule|, and
+// - |UnregisterModule|.
+//
+// Module classes use |Send| to send out command PDUs. The socket
+// in |BluetoothDaemonProtocol| is required for sending. The abstract
+// method hides all these internal details from the modules.
+//
+// |RegisterModule| is required during module initialization, when
+// modules must register themselves at the daemon. The register command
+// is not part of the module itself, but contained in the Setup module
+// (id of 0x00). The abstract method |RegisterModule| allows modules to
+// call into the Setup module for generating the register command.
+//
+// |UnregisterModule| works like |RegisterModule|, but for cleanups.
+//
+// |BluetoothDaemonProtocol| also handles PDU receiving. It implements
+// the method |Handle| from |BluetoothDaemonPDUConsumer|. The socket
+// connections of type |BluetoothDaemonConnection| invoke this method
+// to forward received PDUs for processing by higher layers. The
+// implementation of |Handle| checks the service id of the PDU and
+// forwards it to the correct module class using the module's method
+// |HandleSvc|. Further PDU processing is module-dependent.
+//
+// To summarize the interface between |BluetoothDaemonProtocol| and
+// modules; the former implements the abstract methods
+//
+// - |Send|,
+// - |RegisterModule|, and
+// - |UnregisterModule|,
+//
+// which allow modules to send out data. Each module implements the
+// method
+//
+// - |HandleSvc|,
+//
+// which is called by |BluetoothDaemonProtcol| to hand over received
+// PDUs into a module.
+//
class BluetoothDaemonProtocol MOZ_FINAL
: public BluetoothDaemonPDUConsumer
, public BluetoothDaemonSetupModule
@@ -1363,6 +1412,7 @@
, public BluetoothDaemonSocketModule
, public BluetoothDaemonHandsfreeModule
, public BluetoothDaemonA2dpModule
+ , public BluetoothDaemonAvrcpModule
{
public:
BluetoothDaemonProtocol(BluetoothDaemonConnection* aConnection);
@@ -1398,6 +1448,8 @@
BluetoothDaemonPDU& aPDU, void* aUserData);
void HandleA2dpSvc(const BluetoothDaemonPDUHeader& aHeader,
BluetoothDaemonPDU& aPDU, void* aUserData);
+ void HandleAvrcpSvc(const BluetoothDaemonPDUHeader& aHeader,
+ BluetoothDaemonPDU& aPDU, void* aUserData);
BluetoothDaemonConnection* mConnection;
nsTArray mUserDataQ;
@@ -1475,6 +1527,14 @@
}
void
+BluetoothDaemonProtocol::HandleAvrcpSvc(
+ const BluetoothDaemonPDUHeader& aHeader, BluetoothDaemonPDU& aPDU,
+ void* aUserData)
+{
+ BluetoothDaemonAvrcpModule::HandleSvc(aHeader, aPDU, aUserData);
+}
+
+void
BluetoothDaemonProtocol::Handle(BluetoothDaemonPDU& aPDU)
{
static void (BluetoothDaemonProtocol::* const HandleSvc[])(
@@ -1487,7 +1547,10 @@
INIT_ARRAY_AT(BluetoothDaemonHandsfreeModule::SERVICE_ID,
&BluetoothDaemonProtocol::HandleHandsfreeSvc),
INIT_ARRAY_AT(BluetoothDaemonA2dpModule::SERVICE_ID,
- &BluetoothDaemonProtocol::HandleA2dpSvc)
+ &BluetoothDaemonProtocol::HandleA2dpSvc),
+ INIT_ARRAY_AT(0x07, nullptr), // Health
+ INIT_ARRAY_AT(BluetoothDaemonAvrcpModule::SERVICE_ID,
+ &BluetoothDaemonProtocol::HandleAvrcpSvc)
};
BluetoothDaemonPDUHeader header;
@@ -2079,7 +2142,13 @@
BluetoothAvrcpInterface*
BluetoothDaemonInterface::GetBluetoothAvrcpInterface()
{
- return nullptr;
+ if (mAvrcpInterface) {
+ return mAvrcpInterface;
+ }
+
+ mAvrcpInterface = new BluetoothDaemonAvrcpInterface(mProtocol);
+
+ return mAvrcpInterface;
}
END_BLUETOOTH_NAMESPACE
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/bluedroid/BluetoothDaemonInterface.h 2015-01-09 12:36:47.000000000 +0000
@@ -13,6 +13,7 @@
class BluetoothDaemonChannel;
class BluetoothDaemonA2dpInterface;
+class BluetoothDaemonAvrcpInterface;
class BluetoothDaemonHandsfreeInterface;
class BluetoothDaemonProtocol;
class BluetoothDaemonSocketInterface;
@@ -129,6 +130,7 @@
nsAutoPtr mSocketInterface;
nsAutoPtr mHandsfreeInterface;
nsAutoPtr mA2dpInterface;
+ nsAutoPtr mAvrcpInterface;
};
END_BLUETOOTH_NAMESPACE
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/BluetoothRilListener.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/BluetoothRilListener.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/BluetoothRilListener.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/BluetoothRilListener.cpp 2015-01-09 12:36:47.000000000 +0000
@@ -10,6 +10,7 @@
#include "nsIIccProvider.h"
#include "nsIMobileConnectionInfo.h"
#include "nsIMobileConnectionService.h"
+#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"
#include "nsRadioInterfaceLayer.h" // For NS_RILCONTENTHELPER_CONTRACTID.
#include "nsServiceManagerUtils.h"
@@ -186,48 +187,42 @@
*/
NS_IMPL_ISUPPORTS(TelephonyListener, nsITelephonyListener)
-NS_IMETHODIMP
-TelephonyListener::CallStateChanged(uint32_t aServiceId,
- uint32_t aCallIndex,
- uint16_t aCallState,
- const nsAString& aNumber,
- uint16_t aNumberPresentation,
- const nsAString& aName,
- uint16_t aNamePresentation,
- bool aIsOutgoing,
- bool aIsEmergency,
- bool aIsConference,
- bool aIsSwitchable,
- bool aIsMergeable)
+/**
+ * @param aSend A boolean indicates whether we need to notify headset or not
+ */
+nsresult
+TelephonyListener::HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend)
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
- hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
- aIsOutgoing, aIsConference, true);
+ uint32_t callIndex;
+ uint16_t callState;
+ nsAutoString number;
+ bool isOutgoing;
+ bool isConference;
+
+ aInfo->GetCallIndex(&callIndex);
+ aInfo->GetCallState(&callState);
+ aInfo->GetNumber(number);
+ aInfo->GetIsOutgoing(&isOutgoing);
+ aInfo->GetIsConference(&isConference);
+
+ hfp->HandleCallStateChanged(callIndex, callState, EmptyString(), number,
+ isOutgoing, isConference, aSend);
return NS_OK;
}
NS_IMETHODIMP
-TelephonyListener::EnumerateCallState(uint32_t aServiceId,
- uint32_t aCallIndex,
- uint16_t aCallState,
- const nsAString_internal& aNumber,
- uint16_t aNumberPresentation,
- const nsAString& aName,
- uint16_t aNamePresentation,
- bool aIsOutgoing,
- bool aIsEmergency,
- bool aIsConference,
- bool aIsSwitchable,
- bool aIsMergeable)
+TelephonyListener::CallStateChanged(nsITelephonyCallInfo* aInfo)
{
- BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
- NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
+ return HandleCallInfo(aInfo, true);
+}
- hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
- aIsOutgoing, aIsConference, false);
- return NS_OK;
+NS_IMETHODIMP
+TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo)
+{
+ return HandleCallInfo(aInfo, false);
}
NS_IMETHODIMP
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/BluetoothRilListener.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/BluetoothRilListener.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/BluetoothRilListener.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/BluetoothRilListener.h 2015-01-09 12:36:47.000000000 +0000
@@ -13,6 +13,7 @@
#include "nsIIccProvider.h"
#include "nsIMobileConnectionService.h"
+#include "nsITelephonyCallInfo.h"
#include "nsITelephonyService.h"
BEGIN_BLUETOOTH_NAMESPACE
@@ -61,6 +62,9 @@
virtual ~TelephonyListener() { }
bool Listen(bool aStart);
+
+private:
+ nsresult HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend);
};
class BluetoothRilListener
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/ipc/BluetoothMessageUtils.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/ipc/BluetoothMessageUtils.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/ipc/BluetoothMessageUtils.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/ipc/BluetoothMessageUtils.h 2015-01-09 12:36:47.000000000 +0000
@@ -22,4 +22,4 @@
} // namespace IPC
-#endif // mozilla_dom_bluetooth_ipc_bluetoothchild_h__
+#endif // mozilla_dom_bluetooth_ipc_bluetoothmessageutils_h__
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth/moz.build 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth/moz.build 2015-01-09 12:36:47.000000000 +0000
@@ -49,6 +49,7 @@
'bluedroid/BluetoothA2dpManager.cpp',
'bluedroid/BluetoothAvrcpHALInterface.cpp',
'bluedroid/BluetoothDaemonA2dpInterface.cpp',
+ 'bluedroid/BluetoothDaemonAvrcpInterface.cpp',
'bluedroid/BluetoothDaemonHandsfreeInterface.cpp',
'bluedroid/BluetoothDaemonHelpers.cpp',
'bluedroid/BluetoothDaemonInterface.cpp',
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/BluetoothRilListener.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/BluetoothRilListener.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/BluetoothRilListener.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/BluetoothRilListener.cpp 2015-01-09 12:36:47.000000000 +0000
@@ -186,48 +186,42 @@
*/
NS_IMPL_ISUPPORTS(TelephonyListener, nsITelephonyListener)
-NS_IMETHODIMP
-TelephonyListener::CallStateChanged(uint32_t aServiceId,
- uint32_t aCallIndex,
- uint16_t aCallState,
- const nsAString& aNumber,
- uint16_t aNumberPresentation,
- const nsAString& aName,
- uint16_t aNamePresentation,
- bool aIsOutgoing,
- bool aIsEmergency,
- bool aIsConference,
- bool aIsSwitchable,
- bool aIsMergeable)
+/**
+ * @param aSend A boolean indicates whether we need to notify headset or not
+ */
+nsresult
+TelephonyListener::HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend)
{
BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
- hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
- aIsOutgoing, aIsConference, true);
+ uint32_t callIndex;
+ uint16_t callState;
+ nsAutoString number;
+ bool isOutgoing;
+ bool isConference;
+
+ aInfo->GetCallIndex(&callIndex);
+ aInfo->GetCallState(&callState);
+ aInfo->GetNumber(number);
+ aInfo->GetIsOutgoing(&isOutgoing);
+ aInfo->GetIsConference(&isConference);
+
+ hfp->HandleCallStateChanged(callIndex, callState, EmptyString(), number,
+ isOutgoing, isConference, aSend);
return NS_OK;
}
NS_IMETHODIMP
-TelephonyListener::EnumerateCallState(uint32_t aServiceId,
- uint32_t aCallIndex,
- uint16_t aCallState,
- const nsAString_internal& aNumber,
- uint16_t aNumberPresentation,
- const nsAString& aName,
- uint16_t aNamePresentation,
- bool aIsOutgoing,
- bool aIsEmergency,
- bool aIsConference,
- bool aIsSwitchable,
- bool aIsMergeable)
+TelephonyListener::CallStateChanged(nsITelephonyCallInfo* aInfo)
{
- BluetoothHfpManager* hfp = BluetoothHfpManager::Get();
- NS_ENSURE_TRUE(hfp, NS_ERROR_FAILURE);
+ return HandleCallInfo(aInfo, true);
+}
- hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber,
- aIsOutgoing, aIsConference, false);
- return NS_OK;
+NS_IMETHODIMP
+TelephonyListener::EnumerateCallState(nsITelephonyCallInfo* aInfo)
+{
+ return HandleCallInfo(aInfo, false);
}
NS_IMETHODIMP
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/BluetoothRilListener.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/BluetoothRilListener.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/BluetoothRilListener.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/BluetoothRilListener.h 2015-01-09 12:36:47.000000000 +0000
@@ -61,6 +61,9 @@
virtual ~TelephonyListener() { }
bool Listen(bool aStart);
+
+private:
+ nsresult HandleCallInfo(nsITelephonyCallInfo* aInfo, bool aSend);
};
class BluetoothRilListener
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/ipc/BluetoothMessageUtils.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/ipc/BluetoothMessageUtils.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/bluetooth2/ipc/BluetoothMessageUtils.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/bluetooth2/ipc/BluetoothMessageUtils.h 2015-01-09 12:36:47.000000000 +0000
@@ -30,4 +30,4 @@
} // namespace IPC
-#endif // mozilla_dom_bluetooth_ipc_bluetoothchild_h__
+#endif // mozilla_dom_bluetooth_ipc_bluetoothmessageutils_h__
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/BrowserElementChildPreload.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/BrowserElementChildPreload.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/BrowserElementChildPreload.js 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/BrowserElementChildPreload.js 2015-01-09 12:36:47.000000000 +0000
@@ -94,7 +94,7 @@
this._isContentWindowCreated = false;
this._pendingSetInputMethodActive = [];
- this._forceDispatchSelectionStateChanged = false;
+ this._selectionStateChangedTarget = null;
this._init();
};
@@ -594,13 +594,18 @@
_selectionStateChangedHandler: function(e) {
e.stopPropagation();
+
+ if (!this._isContentWindowCreated) {
+ return;
+ }
+
let boundingClientRect = e.boundingClientRect;
let isCollapsed = (e.selectedText.length == 0);
let isMouseUp = (e.states.indexOf('mouseup') == 0);
let canPaste = this._isCommandEnabled("paste");
- if (!this._forceDispatchSelectionStateChanged) {
+ if (this._selectionStateChangedTarget != e.target) {
// SelectionStateChanged events with the following states are not
// necessary to trigger the text dialog, bypass these events
// by default.
@@ -613,25 +618,28 @@
}
// The collapsed SelectionStateChanged event is unnecessary to dispatch,
- // bypass this event by default. But there is one exception to support
- // the shortcut mode which can paste previous copied content easily
+ // bypass this event by default, but here comes some exceptional cases
if (isCollapsed) {
if (isMouseUp && canPaste) {
- //Dispatch this selection change event to support shortcut mode
+ // Always dispatch to support shortcut mode which can paste previous
+ // copied content easily
+ } else if (e.states.indexOf('blur') == 0) {
+ // Always dispatch to notify the blur for the focus content
} else {
return;
}
}
}
- // If we select something and selection range is visible, we set the
- // forceDispatchSelectionStateChanged flag as true to dispatch the
- // next SelectionStateChange event so that the parent side can
- // hide the text dialog.
+ // If we select something and selection range is visible, we cache current
+ // event's target to selectionStateChangedTarget.
+ // And dispatch the next SelectionStateChagne event if target is matched, so
+ // that the parent side can hide the text dialog.
+ // We clear selectionStateChangedTarget if selection carets are invisible.
if (e.visible && !isCollapsed) {
- this._forceDispatchSelectionStateChanged = true;
+ this._selectionStateChangedTarget = e.target;
} else {
- this._forceDispatchSelectionStateChanged = false;
+ this._selectionStateChangedTarget = null;
}
let zoomFactor = content.screen.width / content.innerWidth;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/browserElement_CopyPaste.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/browserElement_CopyPaste.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/browserElement_CopyPaste.js 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/browserElement_CopyPaste.js 2015-01-09 12:36:47.000000000 +0000
@@ -181,12 +181,15 @@
// Skip mozbrowser test if we're at child process.
if (!isChildProcess()) {
iframeOuter.addEventListener("mozbrowserselectionstatechanged", function selectchangeforselectall(e) {
- iframeOuter.removeEventListener("mozbrowserselectionstatechanged", selectchangeforselectall, true);
- ok(true, "got mozbrowserselectionstatechanged event." + stateMeaning);
- ok(e.detail, "event.detail is not null." + stateMeaning);
- ok(e.detail.width != 0, "event.detail.width is not zero" + stateMeaning);
- ok(e.detail.height != 0, "event.detail.height is not zero" + stateMeaning);
- SimpleTest.executeSoon(function() { testCopy1(e); });
+ if (e.detail.states.indexOf('selectall') == 0) {
+ iframeOuter.removeEventListener("mozbrowserselectionstatechanged", selectchangeforselectall, true);
+ ok(true, "got mozbrowserselectionstatechanged event." + stateMeaning);
+ ok(e.detail, "event.detail is not null." + stateMeaning);
+ ok(e.detail.width != 0, "event.detail.width is not zero" + stateMeaning);
+ ok(e.detail.height != 0, "event.detail.height is not zero" + stateMeaning);
+ ok(e.detail.states, "event.detail.state " + e.detail.states);
+ SimpleTest.executeSoon(function() { testCopy1(e); });
+ }
}, true);
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/browserElement_SelectionStateBlur.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/browserElement_SelectionStateBlur.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/browserElement_SelectionStateBlur.js 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/browserElement_SelectionStateBlur.js 2015-01-09 12:36:47.000000000 +0000
@@ -0,0 +1,57 @@
+/* Any copyright is dedicated to the public domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Bug 1111433: Send out the SelectionStateChanged event with Blur state
+
+"use strict";
+
+SimpleTest.waitForExplicitFinish();
+browserElementTestHelpers.setEnabledPref(true);
+browserElementTestHelpers.setSelectionChangeEnabledPref(true);
+browserElementTestHelpers.addPermission();
+
+var mm;
+var iframe;
+
+var changefocus = function () {
+ var elt = content.document.getElementById("text");
+ if (elt) {
+ elt.focus();
+ elt.select();
+ elt.blur();
+ }
+}
+
+function runTest() {
+ iframe = document.createElement('iframe');
+ iframe.setAttribute('mozbrowser', 'true');
+ document.body.appendChild(iframe);
+
+ mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
+
+ iframe.src = "data:text/html," +
+ ""+
+ "";
+
+ var loadtime = 0;
+ iframe.addEventListener("mozbrowserloadend", function onloadend(e) {
+ loadtime++;
+ if (loadtime === 2) {
+ iframe.removeEventListener("mozbrowserloadend", onloadend);
+ SimpleTest.executeSoon(function() { testBlur(e); });
+ }
+ });
+}
+
+function testBlur(e) {
+ iframe.addEventListener("mozbrowserselectionstatechanged", function selectionstatechanged(e) {
+ iframe.removeEventListener("mozbrowserselectionstatechanged", selectionstatechanged, true);
+ ok(e.detail.states.indexOf('blur') == 0, "received state " + e.detail.states);
+ SimpleTest.finish();
+ }, true);
+
+ iframe.focus();
+ mm.loadFrameScript('data:,(' + changefocus.toString() + ')();', false);
+}
+
+addEventListener('testready', runTest);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/mochitest.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/mochitest.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/mochitest.ini 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/mochitest.ini 2015-01-09 12:36:47.000000000 +0000
@@ -53,6 +53,7 @@
browserElement_ScrollEvent.js
browserElement_SecurityChange.js
browserElement_SendEvent.js
+ browserElement_SelectionStateBlur.js
browserElement_SetInputMethodActive.js
browserElement_SetVisible.js
browserElement_SetVisibleFrames.js
@@ -184,6 +185,8 @@
[test_browserElement_inproc_ScrollEvent.html]
[test_browserElement_inproc_SecurityChange.html]
skip-if = toolkit == 'android' || (toolkit == 'gonk' && !debug) # android(TIMED_OUT, bug 766586) androidx86(TIMED_OUT, bug 766586)
+[test_browserElement_inproc_SelectionStateBlur.html]
+skip-if = (toolkit == 'gonk') # Disabled on b2g due to bug 1097419
[test_browserElement_inproc_SendEvent.html]
# The setInputMethodActive() tests will timed out on Android
[test_browserElement_inproc_SetInputMethodActive.html]
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/mochitest-oop.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/mochitest-oop.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/mochitest-oop.ini 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/mochitest-oop.ini 2015-01-09 12:36:47.000000000 +0000
@@ -70,6 +70,8 @@
[test_browserElement_oop_ScrollEvent.html]
[test_browserElement_oop_SecurityChange.html]
skip-if = toolkit == 'android' || (toolkit == 'gonk' && !debug) #TIMED_OUT, bug 766586
+[test_browserElement_oop_SelectionStateBlur.html]
+skip-if = (toolkit == 'gonk') # Disabled on b2g due to bug 1097419
[test_browserElement_oop_SendEvent.html]
[test_browserElement_oop_SetInputMethodActive.html]
skip-if = (os == "android")
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/test_browserElement_inproc_SelectionStateBlur.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/test_browserElement_inproc_SelectionStateBlur.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/test_browserElement_inproc_SelectionStateBlur.html 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/test_browserElement_inproc_SelectionStateBlur.html 2015-01-09 12:36:47.000000000 +0000
@@ -0,0 +1,18 @@
+
+
+
+
+ Test for Bug 1111433
+
+
+
+
+
+Mozilla Bug 1111433
+
+
+
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/test_browserElement_oop_SelectionStateBlur.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/test_browserElement_oop_SelectionStateBlur.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/browser-element/mochitest/test_browserElement_oop_SelectionStateBlur.html 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/browser-element/mochitest/test_browserElement_oop_SelectionStateBlur.html 2015-01-09 12:36:47.000000000 +0000
@@ -0,0 +1,18 @@
+
+
+
+
+ Test for Bug 1111433
+
+
+
+
+
+Mozilla Bug 1111433
+
+
+
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/camera/FallbackCameraControl.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/camera/FallbackCameraControl.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/camera/FallbackCameraControl.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/camera/FallbackCameraControl.cpp 2015-01-09 12:36:48.000000000 +0000
@@ -54,18 +54,18 @@
protected:
~FallbackCameraControl();
- virtual nsresult StartPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult StopPreviewImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult AutoFocusImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult StartFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult StopFaceDetectionImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult TakePictureImpl() { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult StartPreviewImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult StopPreviewImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult AutoFocusImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult StartFaceDetectionImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult StopFaceDetectionImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult TakePictureImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
virtual nsresult StartRecordingImpl(DeviceStorageFileDescriptor* aFileDescriptor,
const StartRecordingOptions* aOptions = nullptr) MOZ_OVERRIDE
{ return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult StopRecordingImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult PushParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
- virtual nsresult PullParametersImpl() { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult StopRecordingImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult PushParametersImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
+ virtual nsresult PullParametersImpl() MOZ_OVERRIDE { return NS_ERROR_NOT_INITIALIZED; }
private:
FallbackCameraControl(const FallbackCameraControl&) MOZ_DELETE;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasImageCache.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasImageCache.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasImageCache.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasImageCache.cpp 2015-01-09 12:36:48.000000000 +0000
@@ -162,7 +162,7 @@
NS_IMETHODIMP Observe(nsISupports* aSubject,
const char* aTopic,
- const char16_t* aSomeData)
+ const char16_t* aSomeData) MOZ_OVERRIDE
{
if (!mImageCache || strcmp(aTopic, "memory-pressure")) {
return NS_OK;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasRenderingContext2D.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasRenderingContext2D.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasRenderingContext2D.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasRenderingContext2D.cpp 2015-01-09 12:36:48.000000000 +0000
@@ -164,7 +164,7 @@
NS_DECL_ISUPPORTS
NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
- nsISupports* aData, bool aAnonymize)
+ nsISupports* aData, bool aAnonymize) MOZ_OVERRIDE
{
return MOZ_COLLECT_REPORT(
"canvas-2d-pixels", KIND_OTHER, UNITS_BYTES,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasRenderingContext2D.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasRenderingContext2D.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/CanvasRenderingContext2D.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/CanvasRenderingContext2D.h 2015-01-09 12:36:48.000000000 +0000
@@ -584,15 +584,15 @@
friend class CanvasRenderingContext2DUserData;
- virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat);
+ virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat) MOZ_OVERRIDE;
// Given a point, return hit region ID if it exists
- nsString GetHitRegion(const mozilla::gfx::Point& aPoint);
+ nsString GetHitRegion(const mozilla::gfx::Point& aPoint) MOZ_OVERRIDE;
// return true and fills in the bound rect if element has a hit region.
- bool GetHitRegionRect(Element* aElement, nsRect& aRect);
+ bool GetHitRegionRect(Element* aElement, nsRect& aRect) MOZ_OVERRIDE;
protected:
nsresult GetImageDataArray(JSContext* aCx, int32_t aX, int32_t aY,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/webgl-conformance/generate-wrappers-and-manifest.py thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/webgl-conformance/generate-wrappers-and-manifest.py
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/webgl-conformance/generate-wrappers-and-manifest.py 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/webgl-conformance/generate-wrappers-and-manifest.py 2015-01-09 12:36:49.000000000 +0000
@@ -31,6 +31,7 @@
ACCEPTABLE_ERRATA_KEYS = set([
'skip-if',
+ 'fail-if',
])
GENERATED_HEADER = '''
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/webgl-conformance/mochitest-errata.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/webgl-conformance/mochitest-errata.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/webgl-conformance/mochitest-errata.ini 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/webgl-conformance/mochitest-errata.ini 2015-01-09 12:36:49.000000000 +0000
@@ -78,6 +78,12 @@
skip-if = (os == 'b2g')
########################################################################
+# Linux
+[_wrappers/test_conformance__extensions__oes-texture-float.html]
+# Failures after enabling color_buffer_[half_]float.
+fail-if = (os == 'linux')
+
+########################################################################
# Mac
[_wrappers/test_conformance__canvas__drawingbuffer-static-canvas-test.html]
# Intermittent crash on OSX.
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/_webgl-conformance.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/_webgl-conformance.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/test/_webgl-conformance.ini 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/test/_webgl-conformance.ini 2015-01-09 12:36:48.000000000 +0000
@@ -499,7 +499,6 @@
[webgl-conformance/_wrappers/test_conformance__buffers__index-validation-with-resized-buffer.html]
[webgl-conformance/_wrappers/test_conformance__buffers__index-validation.html]
[webgl-conformance/_wrappers/test_conformance__canvas__buffer-offscreen-test.html]
-skip-if = os == 'android' # Bug 1102402 - It fails intermittently and causes a lot of retried jobs
[webgl-conformance/_wrappers/test_conformance__canvas__buffer-preserve-test.html]
[webgl-conformance/_wrappers/test_conformance__canvas__canvas-test.html]
[webgl-conformance/_wrappers/test_conformance__canvas__canvas-zero-size.html]
@@ -520,6 +519,7 @@
[webgl-conformance/_wrappers/test_conformance__extensions__oes-standard-derivatives.html]
[webgl-conformance/_wrappers/test_conformance__extensions__ext-texture-filter-anisotropic.html]
[webgl-conformance/_wrappers/test_conformance__extensions__oes-texture-float.html]
+fail-if = (os == 'linux')
[webgl-conformance/_wrappers/test_conformance__extensions__oes-vertex-array-object.html]
[webgl-conformance/_wrappers/test_conformance__extensions__webgl-debug-renderer-info.html]
[webgl-conformance/_wrappers/test_conformance__extensions__webgl-debug-shaders.html]
@@ -768,7 +768,7 @@
[webgl-conformance/_wrappers/test_conformance__textures__texture-formats-test.html]
[webgl-conformance/_wrappers/test_conformance__textures__texture-mips.html]
[webgl-conformance/_wrappers/test_conformance__textures__texture-npot-video.html]
-skip-if = os == 'win' || buildapp == 'mulet' # Mulet - bug 1089453 (crashes in libLLVM-3.0.so)
+skip-if = os == 'win'
[webgl-conformance/_wrappers/test_conformance__textures__texture-npot.html]
[webgl-conformance/_wrappers/test_conformance__textures__texture-size.html]
skip-if = os == 'android'
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/WebGLContextExtensions.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/WebGLContextExtensions.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/WebGLContextExtensions.cpp 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/WebGLContextExtensions.cpp 2015-01-09 12:36:48.000000000 +0000
@@ -33,8 +33,8 @@
WEBGL_EXTENSION_IDENTIFIER(EXT_blend_minmax)
WEBGL_EXTENSION_IDENTIFIER(EXT_color_buffer_half_float)
WEBGL_EXTENSION_IDENTIFIER(EXT_frag_depth)
- WEBGL_EXTENSION_IDENTIFIER(EXT_sRGB)
WEBGL_EXTENSION_IDENTIFIER(EXT_shader_texture_lod)
+ WEBGL_EXTENSION_IDENTIFIER(EXT_sRGB)
WEBGL_EXTENSION_IDENTIFIER(EXT_texture_filter_anisotropic)
WEBGL_EXTENSION_IDENTIFIER(OES_element_index_uint)
WEBGL_EXTENSION_IDENTIFIER(OES_standard_derivatives)
@@ -95,24 +95,37 @@
return IsExtensionSupported(ext);
}
-bool WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
+bool
+WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
{
if (mDisableExtensions)
return false;
+ // In alphabetical order
switch (ext) {
- case WebGLExtensionID::OES_vertex_array_object:
- case WebGLExtensionID::WEBGL_lose_context:
- // Always supported.
- return true;
+ // ANGLE_
+ case WebGLExtensionID::ANGLE_instanced_arrays:
+ return WebGLExtensionInstancedArrays::IsSupported(this);
+ // EXT_
case WebGLExtensionID::EXT_blend_minmax:
return WebGLExtensionBlendMinMax::IsSupported(this);
+ case WebGLExtensionID::EXT_color_buffer_half_float:
+ return WebGLExtensionColorBufferHalfFloat::IsSupported(this);
+ case WebGLExtensionID::EXT_frag_depth:
+ return WebGLExtensionFragDepth::IsSupported(this);
+ case WebGLExtensionID::EXT_shader_texture_lod:
+ return gl->IsExtensionSupported(gl::GLContext::EXT_shader_texture_lod);
+ case WebGLExtensionID::EXT_sRGB:
+ return WebGLExtensionSRGB::IsSupported(this);
+ case WebGLExtensionID::EXT_texture_filter_anisotropic:
+ return gl->IsExtensionSupported(gl::GLContext::EXT_texture_filter_anisotropic);
+
+ // OES_
case WebGLExtensionID::OES_element_index_uint:
return gl->IsSupported(gl::GLFeature::element_index_uint);
case WebGLExtensionID::OES_standard_derivatives:
return gl->IsSupported(gl::GLFeature::standard_derivatives);
-
case WebGLExtensionID::OES_texture_float:
return gl->IsSupported(gl::GLFeature::texture_float);
case WebGLExtensionID::OES_texture_float_linear:
@@ -126,22 +139,25 @@
case WebGLExtensionID::OES_texture_half_float_linear:
return gl->IsSupported(gl::GLFeature::texture_half_float_linear);
- case WebGLExtensionID::EXT_texture_filter_anisotropic:
- return gl->IsExtensionSupported(gl::GLContext::EXT_texture_filter_anisotropic);
- case WebGLExtensionID::WEBGL_compressed_texture_s3tc:
- if (gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_s3tc))
- return true;
-
- return gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_dxt1) &&
- gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt3) &&
- gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt5);
+ case WebGLExtensionID::OES_vertex_array_object:
+ return true;
+ // WEBGL_
+ case WebGLExtensionID::WEBGL_color_buffer_float:
+ return WebGLExtensionColorBufferFloat::IsSupported(this);
case WebGLExtensionID::WEBGL_compressed_texture_atc:
return gl->IsExtensionSupported(gl::GLContext::AMD_compressed_ATC_texture);
case WebGLExtensionID::WEBGL_compressed_texture_etc1:
return gl->IsExtensionSupported(gl::GLContext::OES_compressed_ETC1_RGB8_texture);
case WebGLExtensionID::WEBGL_compressed_texture_pvrtc:
return gl->IsExtensionSupported(gl::GLContext::IMG_texture_compression_pvrtc);
+ case WebGLExtensionID::WEBGL_compressed_texture_s3tc:
+ if (gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_s3tc))
+ return true;
+
+ return gl->IsExtensionSupported(gl::GLContext::EXT_texture_compression_dxt1) &&
+ gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt3) &&
+ gl->IsExtensionSupported(gl::GLContext::ANGLE_texture_compression_dxt5);
case WebGLExtensionID::WEBGL_depth_texture:
// WEBGL_depth_texture supports DEPTH_STENCIL textures
if (!gl->IsSupported(gl::GLFeature::packed_depth_stencil))
@@ -149,17 +165,11 @@
return gl->IsSupported(gl::GLFeature::depth_texture) ||
gl->IsExtensionSupported(gl::GLContext::ANGLE_depth_texture);
-
- case WebGLExtensionID::ANGLE_instanced_arrays:
- return WebGLExtensionInstancedArrays::IsSupported(this);
- case WebGLExtensionID::EXT_sRGB:
- return WebGLExtensionSRGB::IsSupported(this);
case WebGLExtensionID::WEBGL_draw_buffers:
return WebGLExtensionDrawBuffers::IsSupported(this);
- case WebGLExtensionID::EXT_frag_depth:
- return WebGLExtensionFragDepth::IsSupported(this);
- case WebGLExtensionID::EXT_shader_texture_lod:
- return gl->IsExtensionSupported(gl::GLContext::EXT_shader_texture_lod);
+ case WebGLExtensionID::WEBGL_lose_context:
+ // We always support this extension.
+ return true;
default:
// For warnings-as-errors.
@@ -169,15 +179,13 @@
if (Preferences::GetBool("webgl.enable-draft-extensions", false) ||
IsWebGL2())
{
+ /* None for now.
switch (ext) {
- case WebGLExtensionID::EXT_color_buffer_half_float:
- return WebGLExtensionColorBufferHalfFloat::IsSupported(this);
- case WebGLExtensionID::WEBGL_color_buffer_float:
- return WebGLExtensionColorBufferFloat::IsSupported(this);
default:
// For warnings-as-errors.
break;
}
+ */
}
return false;
@@ -292,38 +300,37 @@
WebGLExtensionBase* obj = nullptr;
switch (ext) {
- case WebGLExtensionID::OES_element_index_uint:
- obj = new WebGLExtensionElementIndexUint(this);
- break;
- case WebGLExtensionID::OES_standard_derivatives:
- obj = new WebGLExtensionStandardDerivatives(this);
- break;
- case WebGLExtensionID::EXT_texture_filter_anisotropic:
- obj = new WebGLExtensionTextureFilterAnisotropic(this);
+ // ANGLE_
+ case WebGLExtensionID::ANGLE_instanced_arrays:
+ obj = new WebGLExtensionInstancedArrays(this);
break;
- case WebGLExtensionID::WEBGL_lose_context:
- obj = new WebGLExtensionLoseContext(this);
+
+ // EXT_
+ case WebGLExtensionID::EXT_blend_minmax:
+ obj = new WebGLExtensionBlendMinMax(this);
break;
- case WebGLExtensionID::WEBGL_compressed_texture_s3tc:
- obj = new WebGLExtensionCompressedTextureS3TC(this);
+ case WebGLExtensionID::EXT_color_buffer_half_float:
+ obj = new WebGLExtensionColorBufferHalfFloat(this);
break;
- case WebGLExtensionID::WEBGL_compressed_texture_atc:
- obj = new WebGLExtensionCompressedTextureATC(this);
+ case WebGLExtensionID::EXT_frag_depth:
+ obj = new WebGLExtensionFragDepth(this);
break;
- case WebGLExtensionID::WEBGL_compressed_texture_etc1:
- obj = new WebGLExtensionCompressedTextureETC1(this);
+ case WebGLExtensionID::EXT_shader_texture_lod:
+ obj = new WebGLExtensionShaderTextureLod(this);
break;
- case WebGLExtensionID::WEBGL_compressed_texture_pvrtc:
- obj = new WebGLExtensionCompressedTexturePVRTC(this);
+ case WebGLExtensionID::EXT_sRGB:
+ obj = new WebGLExtensionSRGB(this);
break;
- case WebGLExtensionID::WEBGL_debug_renderer_info:
- obj = new WebGLExtensionDebugRendererInfo(this);
+ case WebGLExtensionID::EXT_texture_filter_anisotropic:
+ obj = new WebGLExtensionTextureFilterAnisotropic(this);
break;
- case WebGLExtensionID::WEBGL_debug_shaders:
- obj = new WebGLExtensionDebugShaders(this);
+
+ // OES_
+ case WebGLExtensionID::OES_element_index_uint:
+ obj = new WebGLExtensionElementIndexUint(this);
break;
- case WebGLExtensionID::WEBGL_depth_texture:
- obj = new WebGLExtensionDepthTexture(this);
+ case WebGLExtensionID::OES_standard_derivatives:
+ obj = new WebGLExtensionStandardDerivatives(this);
break;
case WebGLExtensionID::OES_texture_float:
obj = new WebGLExtensionTextureFloat(this);
@@ -337,36 +344,44 @@
case WebGLExtensionID::OES_texture_half_float_linear:
obj = new WebGLExtensionTextureHalfFloatLinear(this);
break;
+ case WebGLExtensionID::OES_vertex_array_object:
+ obj = new WebGLExtensionVertexArray(this);
+ break;
+
+ // WEBGL_
case WebGLExtensionID::WEBGL_color_buffer_float:
obj = new WebGLExtensionColorBufferFloat(this);
break;
- case WebGLExtensionID::EXT_color_buffer_half_float:
- obj = new WebGLExtensionColorBufferHalfFloat(this);
+ case WebGLExtensionID::WEBGL_compressed_texture_atc:
+ obj = new WebGLExtensionCompressedTextureATC(this);
break;
- case WebGLExtensionID::WEBGL_draw_buffers:
- obj = new WebGLExtensionDrawBuffers(this);
+ case WebGLExtensionID::WEBGL_compressed_texture_etc1:
+ obj = new WebGLExtensionCompressedTextureETC1(this);
break;
- case WebGLExtensionID::OES_vertex_array_object:
- obj = new WebGLExtensionVertexArray(this);
+ case WebGLExtensionID::WEBGL_compressed_texture_pvrtc:
+ obj = new WebGLExtensionCompressedTexturePVRTC(this);
break;
- case WebGLExtensionID::ANGLE_instanced_arrays:
- obj = new WebGLExtensionInstancedArrays(this);
+ case WebGLExtensionID::WEBGL_compressed_texture_s3tc:
+ obj = new WebGLExtensionCompressedTextureS3TC(this);
break;
- case WebGLExtensionID::EXT_sRGB:
- obj = new WebGLExtensionSRGB(this);
+ case WebGLExtensionID::WEBGL_debug_renderer_info:
+ obj = new WebGLExtensionDebugRendererInfo(this);
break;
- case WebGLExtensionID::EXT_frag_depth:
- obj = new WebGLExtensionFragDepth(this);
+ case WebGLExtensionID::WEBGL_debug_shaders:
+ obj = new WebGLExtensionDebugShaders(this);
break;
- case WebGLExtensionID::EXT_blend_minmax:
- obj = new WebGLExtensionBlendMinMax(this);
+ case WebGLExtensionID::WEBGL_depth_texture:
+ obj = new WebGLExtensionDepthTexture(this);
break;
- case WebGLExtensionID::EXT_shader_texture_lod:
- obj = new WebGLExtensionShaderTextureLod(this);
+ case WebGLExtensionID::WEBGL_draw_buffers:
+ obj = new WebGLExtensionDrawBuffers(this);
+ break;
+ case WebGLExtensionID::WEBGL_lose_context:
+ obj = new WebGLExtensionLoseContext(this);
break;
+
default:
MOZ_ASSERT(false, "should not get there.");
- break;
}
mExtensions[ext] = obj;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/WebGLContext.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/WebGLContext.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/canvas/WebGLContext.h 2015-01-07 22:15:25.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/canvas/WebGLContext.h 2015-01-09 12:36:48.000000000 +0000
@@ -192,7 +192,7 @@
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WebGLContext,
nsIDOMWebGLRenderingContext)
- virtual JSObject* WrapObject(JSContext* cx) = 0;
+ virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE = 0;
NS_DECL_NSIDOMWEBGLRENDERINGCONTEXT
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/cellbroadcast/ipc/CellBroadcastParent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/cellbroadcast/ipc/CellBroadcastParent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/cellbroadcast/ipc/CellBroadcastParent.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/cellbroadcast/ipc/CellBroadcastParent.h 2015-01-09 12:36:49.000000000 +0000
@@ -28,11 +28,11 @@
// MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
~CellBroadcastParent() {};
- virtual void ActorDestroy(ActorDestroyReason aWhy);
+ virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
};
} // namespace cellbroadcast
} // namespace dom
} // namespace mozilla
-#endif // mozilla_dom_cellbroadcast_CellBroadcastParent_h
\ No newline at end of file
+#endif // mozilla_dom_cellbroadcast_CellBroadcastParent_h
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/crypto/CryptoKey.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/crypto/CryptoKey.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/crypto/CryptoKey.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/crypto/CryptoKey.h 2015-01-09 12:36:50.000000000 +0000
@@ -139,7 +139,7 @@
SECKEYPublicKey* GetPublicKey() const;
// For nsNSSShutDownObject
- virtual void virtualDestroyNSSReference();
+ virtual void virtualDestroyNSSReference() MOZ_OVERRIDE;
void destructorSafeDestroyNSSReference();
// Serialization and deserialization convenience methods
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/crypto/WebCryptoTask.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/crypto/WebCryptoTask.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/crypto/WebCryptoTask.cpp 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/crypto/WebCryptoTask.cpp 2015-01-09 12:36:50.000000000 +0000
@@ -2104,12 +2104,14 @@
return NS_OK;
}
- virtual void Resolve() {
+ virtual void Resolve() MOZ_OVERRIDE
+ {
mKey->SetSymKey(mKeyData);
mResultPromise->MaybeResolve(mKey);
}
- virtual void Cleanup() {
+ virtual void Cleanup() MOZ_OVERRIDE
+ {
mKey = nullptr;
}
};
@@ -2744,7 +2746,8 @@
return NS_OK;
}
- virtual void Resolve() MOZ_OVERRIDE {
+ virtual void Resolve() MOZ_OVERRIDE
+ {
mTask->SetData(mResult);
mTask->DispatchWithPromise(mResultPromise);
mResolved = true;
@@ -2777,7 +2780,8 @@
nsRefPtr mTask;
bool mResolved;
- virtual void Resolve() MOZ_OVERRIDE {
+ virtual void Resolve() MOZ_OVERRIDE
+ {
mTask->SetKeyData(KeyEncryptTask::mResult);
mTask->DispatchWithPromise(KeyEncryptTask::mResultPromise);
mResolved = true;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/datastore/DataStoreService.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/datastore/DataStoreService.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/datastore/DataStoreService.cpp 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/datastore/DataStoreService.cpp 2015-01-09 12:36:50.000000000 +0000
@@ -1005,9 +1005,12 @@
return;
}
+ nsCOMPtr global = do_QueryInterface(aWindow);
+ MOZ_ASSERT(global);
+
JSAutoCompartment ac(cx, dataStoreJS);
nsRefPtr dataStoreObj = new DataStoreImpl(dataStoreJS,
- aWindow);
+ global);
nsRefPtr exposedStore = new DataStore(aWindow);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/devicestorage/nsDeviceStorage.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/devicestorage/nsDeviceStorage.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/devicestorage/nsDeviceStorage.cpp 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/devicestorage/nsDeviceStorage.cpp 2015-01-09 12:36:50.000000000 +0000
@@ -2202,21 +2202,21 @@
}
NS_IMETHODIMP
-nsDOMDeviceStorageCursor::GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
+nsDOMDeviceStorageCursor::GetPrincipal(nsIPrincipal** aRequestingPrincipal)
{
NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
return NS_OK;
}
NS_IMETHODIMP
-nsDOMDeviceStorageCursor::GetWindow(nsIDOMWindow * *aRequestingWindow)
+nsDOMDeviceStorageCursor::GetWindow(nsIDOMWindow** aRequestingWindow)
{
NS_IF_ADDREF(*aRequestingWindow = GetOwner());
return NS_OK;
}
NS_IMETHODIMP
-nsDOMDeviceStorageCursor::GetElement(nsIDOMElement * *aRequestingElement)
+nsDOMDeviceStorageCursor::GetElement(nsIDOMElement** aRequestingElement)
{
*aRequestingElement = nullptr;
return NS_OK;
@@ -2900,7 +2900,7 @@
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(DeviceStorageRequest,
nsIContentPermissionRequest)
- NS_IMETHOD Run()
+ NS_IMETHOD Run() MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@@ -2912,7 +2912,7 @@
return nsContentPermissionUtils::AskPermission(this, mWindow);
}
- NS_IMETHODIMP GetTypes(nsIArray** aTypes)
+ NS_IMETHODIMP GetTypes(nsIArray** aTypes) MOZ_OVERRIDE
{
nsCString type;
nsresult rv =
@@ -2932,25 +2932,25 @@
return nsContentPermissionUtils::CreatePermissionArray(type, access, emptyOptions, aTypes);
}
- NS_IMETHOD GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
+ NS_IMETHOD GetPrincipal(nsIPrincipal * *aRequestingPrincipal) MOZ_OVERRIDE
{
NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
return NS_OK;
}
- NS_IMETHOD GetWindow(nsIDOMWindow * *aRequestingWindow)
+ NS_IMETHOD GetWindow(nsIDOMWindow * *aRequestingWindow) MOZ_OVERRIDE
{
NS_IF_ADDREF(*aRequestingWindow = mWindow);
return NS_OK;
}
- NS_IMETHOD GetElement(nsIDOMElement * *aRequestingElement)
+ NS_IMETHOD GetElement(nsIDOMElement * *aRequestingElement) MOZ_OVERRIDE
{
*aRequestingElement = nullptr;
return NS_OK;
}
- NS_IMETHOD Cancel()
+ NS_IMETHOD Cancel() MOZ_OVERRIDE
{
nsCOMPtr event
= new PostErrorEvent(mRequest.forget(),
@@ -2958,7 +2958,7 @@
return NS_DispatchToMainThread(event);
}
- NS_IMETHOD Allow(JS::HandleValue aChoices)
+ NS_IMETHOD Allow(JS::HandleValue aChoices) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aChoices.isUndefined());
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/DataTransfer.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/DataTransfer.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/DataTransfer.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/DataTransfer.h 2015-01-09 12:36:50.000000000 +0000
@@ -104,7 +104,7 @@
DataTransfer(nsISupports* aParent, uint32_t aEventType, bool aIsExternal,
int32_t aClipboardType);
- virtual JSObject* WrapObject(JSContext* aCx);
+ virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
nsISupports* GetParentObject()
{
return mParent;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/DOMEventTargetHelper.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/DOMEventTargetHelper.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/DOMEventTargetHelper.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/DOMEventTargetHelper.h 2015-01-09 12:36:50.000000000 +0000
@@ -271,11 +271,11 @@
using _class::RemoveEventListener; \
NS_FORWARD_NSIDOMEVENTTARGET(_class::) \
virtual mozilla::EventListenerManager* \
- GetOrCreateListenerManager() { \
+ GetOrCreateListenerManager() MOZ_OVERRIDE { \
return _class::GetOrCreateListenerManager(); \
} \
virtual mozilla::EventListenerManager* \
- GetExistingListenerManager() const { \
+ GetExistingListenerManager() const MOZ_OVERRIDE { \
return _class::GetExistingListenerManager(); \
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/Event.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/Event.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/Event.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/Event.h 2015-01-09 12:36:50.000000000 +0000
@@ -292,28 +292,28 @@
NS_FORWARD_NSIDOMEVENT(Event::)
#define NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(_to) \
- NS_IMETHOD GetType(nsAString& aType){ return _to GetType(aType); } \
- NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return _to GetTarget(aTarget); } \
- NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return _to GetCurrentTarget(aCurrentTarget); } \
- NS_IMETHOD GetEventPhase(uint16_t *aEventPhase) { return _to GetEventPhase(aEventPhase); } \
- NS_IMETHOD GetBubbles(bool *aBubbles) { return _to GetBubbles(aBubbles); } \
- NS_IMETHOD GetCancelable(bool *aCancelable) { return _to GetCancelable(aCancelable); } \
- NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return _to GetTimeStamp(aTimeStamp); } \
- NS_IMETHOD StopPropagation(void) { return _to StopPropagation(); } \
- NS_IMETHOD PreventDefault(void) { return _to PreventDefault(); } \
- NS_IMETHOD InitEvent(const nsAString & eventTypeArg, bool canBubbleArg, bool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
- NS_IMETHOD GetDefaultPrevented(bool *aDefaultPrevented) { return _to GetDefaultPrevented(aDefaultPrevented); } \
- NS_IMETHOD StopImmediatePropagation(void) { return _to StopImmediatePropagation(); } \
- NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) { return _to GetOriginalTarget(aOriginalTarget); } \
- NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
- NS_IMETHOD GetPreventDefault(bool* aRetval) { return _to GetPreventDefault(aRetval); } \
- NS_IMETHOD GetIsTrusted(bool* aIsTrusted) { return _to GetIsTrusted(aIsTrusted); } \
- NS_IMETHOD SetTarget(nsIDOMEventTarget *aTarget) { return _to SetTarget(aTarget); } \
- NS_IMETHOD_(bool) IsDispatchStopped(void) { return _to IsDispatchStopped(); } \
- NS_IMETHOD_(WidgetEvent*) GetInternalNSEvent(void) { return _to GetInternalNSEvent(); } \
- NS_IMETHOD_(void) SetTrusted(bool aTrusted) { _to SetTrusted(aTrusted); } \
- NS_IMETHOD_(void) SetOwner(EventTarget* aOwner) { _to SetOwner(aOwner); } \
- NS_IMETHOD_(Event*) InternalDOMEvent() { return _to InternalDOMEvent(); }
+ NS_IMETHOD GetType(nsAString& aType) MOZ_OVERRIDE { return _to GetType(aType); } \
+ NS_IMETHOD GetTarget(nsIDOMEventTarget** aTarget) MOZ_OVERRIDE { return _to GetTarget(aTarget); } \
+ NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget** aCurrentTarget) MOZ_OVERRIDE { return _to GetCurrentTarget(aCurrentTarget); } \
+ NS_IMETHOD GetEventPhase(uint16_t* aEventPhase) MOZ_OVERRIDE { return _to GetEventPhase(aEventPhase); } \
+ NS_IMETHOD GetBubbles(bool* aBubbles) MOZ_OVERRIDE { return _to GetBubbles(aBubbles); } \
+ NS_IMETHOD GetCancelable(bool* aCancelable) MOZ_OVERRIDE { return _to GetCancelable(aCancelable); } \
+ NS_IMETHOD GetTimeStamp(DOMTimeStamp* aTimeStamp) MOZ_OVERRIDE { return _to GetTimeStamp(aTimeStamp); } \
+ NS_IMETHOD StopPropagation(void) MOZ_OVERRIDE { return _to StopPropagation(); } \
+ NS_IMETHOD PreventDefault(void) MOZ_OVERRIDE { return _to PreventDefault(); } \
+ NS_IMETHOD InitEvent(const nsAString& eventTypeArg, bool canBubbleArg, bool cancelableArg) MOZ_OVERRIDE { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
+ NS_IMETHOD GetDefaultPrevented(bool* aDefaultPrevented) MOZ_OVERRIDE { return _to GetDefaultPrevented(aDefaultPrevented); } \
+ NS_IMETHOD StopImmediatePropagation(void) MOZ_OVERRIDE { return _to StopImmediatePropagation(); } \
+ NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) MOZ_OVERRIDE { return _to GetOriginalTarget(aOriginalTarget); } \
+ NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) MOZ_OVERRIDE { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
+ NS_IMETHOD GetPreventDefault(bool* aRetval) MOZ_OVERRIDE { return _to GetPreventDefault(aRetval); } \
+ NS_IMETHOD GetIsTrusted(bool* aIsTrusted) MOZ_OVERRIDE { return _to GetIsTrusted(aIsTrusted); } \
+ NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) MOZ_OVERRIDE { return _to SetTarget(aTarget); } \
+ NS_IMETHOD_(bool) IsDispatchStopped(void) MOZ_OVERRIDE { return _to IsDispatchStopped(); } \
+ NS_IMETHOD_(WidgetEvent*) GetInternalNSEvent(void) MOZ_OVERRIDE { return _to GetInternalNSEvent(); } \
+ NS_IMETHOD_(void) SetTrusted(bool aTrusted) MOZ_OVERRIDE { _to SetTrusted(aTrusted); } \
+ NS_IMETHOD_(void) SetOwner(EventTarget* aOwner) MOZ_OVERRIDE { _to SetOwner(aOwner); } \
+ NS_IMETHOD_(Event*) InternalDOMEvent() MOZ_OVERRIDE { return _to InternalDOMEvent(); }
#define NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION \
NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(Event::)
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/ScrollAreaEvent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/ScrollAreaEvent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/ScrollAreaEvent.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/ScrollAreaEvent.h 2015-01-09 12:36:51.000000000 +0000
@@ -31,7 +31,7 @@
NS_FORWARD_NSIDOMUIEVENT(UIEvent::)
NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
- NS_IMETHOD DuplicatePrivateData()
+ NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE
{
return Event::DuplicatePrivateData();
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/UIEvent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/UIEvent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/events/UIEvent.h 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/events/UIEvent.h 2015-01-09 12:36:51.000000000 +0000
@@ -177,17 +177,18 @@
#define NS_FORWARD_TO_UIEVENT \
NS_FORWARD_NSIDOMUIEVENT(UIEvent::) \
NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION \
- NS_IMETHOD DuplicatePrivateData() \
+ NS_IMETHOD DuplicatePrivateData() MOZ_OVERRIDE \
{ \
return UIEvent::DuplicatePrivateData(); \
} \
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, \
bool aSerializeInterfaceType) \
+ MOZ_OVERRIDE \
{ \
UIEvent::Serialize(aMsg, aSerializeInterfaceType); \
} \
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, \
- void** aIter) \
+ void** aIter) MOZ_OVERRIDE \
{ \
return UIEvent::Deserialize(aMsg, aIter); \
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/fmradio/FMRadioService.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/fmradio/FMRadioService.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/fmradio/FMRadioService.cpp 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/fmradio/FMRadioService.cpp 2015-01-09 12:36:51.000000000 +0000
@@ -20,6 +20,7 @@
#include "nsJSUtils.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/SettingChangeNotificationBinding.h"
+#include "mozilla/DebugOnly.h"
#define TUNE_THREAD_TIMEOUT_MS 5000
@@ -780,7 +781,7 @@
{
mRDSGroupMask = aRDSGroupMask;
if (IsFMRadioOn() && mRDSEnabled) {
- bool enabled = hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS);
+ DebugOnly enabled = hal::EnableRDS(mRDSGroupMask | DOM_PARSED_RDS_GROUPS);
MOZ_ASSERT(enabled);
}
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/geolocation/nsGeolocation.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/geolocation/nsGeolocation.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/geolocation/nsGeolocation.cpp 2015-01-07 22:15:26.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/geolocation/nsGeolocation.cpp 2015-01-09 12:36:51.000000000 +0000
@@ -133,7 +133,7 @@
MOZ_COUNT_CTOR(GeolocationSettingsCallback);
}
- NS_IMETHOD Handle(const nsAString& aName, JS::Handle aResult)
+ NS_IMETHOD Handle(const nsAString& aName, JS::Handle aResult) MOZ_OVERRIDE
{
MOZ_ASSERT(NS_IsMainThread());
@@ -159,7 +159,7 @@
return NS_OK;
}
- NS_IMETHOD HandleError(const nsAString& aName)
+ NS_IMETHOD HandleError(const nsAString& aName) MOZ_OVERRIDE
{
if (aName.EqualsASCII(GEO_SETTINGS_ENABLED)) {
GPSLOG("Unable to get value for '" GEO_SETTINGS_ENABLED "'");
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Assertions.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Assertions.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Assertions.cpp 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Assertions.cpp 2015-01-09 12:36:53.000000000 +0000
@@ -63,19 +63,23 @@
ASSERT_ICC_LOCK_TYPE_EQUALITY(Puk, CARD_LOCK_TYPE_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Puk2, CARD_LOCK_TYPE_PUK2);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Nck, CARD_LOCK_TYPE_NCK);
+ASSERT_ICC_LOCK_TYPE_EQUALITY(Nsck, CARD_LOCK_TYPE_NSCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Nck1, CARD_LOCK_TYPE_NCK1);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Nck2, CARD_LOCK_TYPE_NCK2);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Hnck, CARD_LOCK_TYPE_HNCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Cck, CARD_LOCK_TYPE_CCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Spck, CARD_LOCK_TYPE_SPCK);
+ASSERT_ICC_LOCK_TYPE_EQUALITY(Pck, CARD_LOCK_TYPE_PCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Rcck, CARD_LOCK_TYPE_RCCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Rspck, CARD_LOCK_TYPE_RSPCK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(NckPuk, CARD_LOCK_TYPE_NCK_PUK);
+ASSERT_ICC_LOCK_TYPE_EQUALITY(NsckPuk, CARD_LOCK_TYPE_NSCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Nck1Puk, CARD_LOCK_TYPE_NCK1_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Nck2Puk, CARD_LOCK_TYPE_NCK2_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(HnckPuk, CARD_LOCK_TYPE_HNCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(CckPuk, CARD_LOCK_TYPE_CCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(SpckPuk, CARD_LOCK_TYPE_SPCK_PUK);
+ASSERT_ICC_LOCK_TYPE_EQUALITY(PckPuk, CARD_LOCK_TYPE_PCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(RcckPuk, CARD_LOCK_TYPE_RCCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(RspckPuk, CARD_LOCK_TYPE_RSPCK_PUK);
ASSERT_ICC_LOCK_TYPE_EQUALITY(Fdn, CARD_LOCK_TYPE_FDN);
@@ -106,6 +110,16 @@
#undef ASSERT_ICC_MVNO_TYPE_EQUALITY
+/**
+ * Enum IccService
+ */
+#define ASSERT_ICC_SERVICE_EQUALITY(webidlState, xpidlState) \
+ ASSERT_EQUALITY(IccService, webidlState, xpidlState)
+
+ASSERT_ICC_SERVICE_EQUALITY(Fdn, CARD_SERVICE_FDN);
+
+#undef ASSERT_ICC_SERVICE_EQUALITY
+
#undef ASSERT_EQUALITY
} // namespace icc
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Icc.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Icc.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Icc.cpp 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Icc.cpp 2015-01-09 12:36:53.000000000 +0000
@@ -7,6 +7,7 @@
#include "mozilla/dom/DOMRequest.h"
#include "mozilla/dom/IccInfo.h"
#include "mozilla/dom/MozStkCommandEvent.h"
+#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ScriptSettings.h"
#include "nsIIccInfo.h"
#include "nsIIccProvider.h"
@@ -34,9 +35,9 @@
case IccLockType::RcckPuk:
case IccLockType::RspckPuk:
return true;
+ default:
+ return false;
}
-
- return false;
}
} // anonymous namespace
@@ -404,5 +405,26 @@
return request.forget().downcast();
}
+already_AddRefed
+Icc::GetServiceState(IccService aService, ErrorResult& aRv)
+{
+ if (!mProvider) {
+ aRv.Throw(NS_ERROR_FAILURE);
+ return nullptr;
+ }
+
+ nsCOMPtr supports;
+ nsresult rv = mProvider->GetServiceState(mClientId, GetOwner(),
+ static_cast(aService),
+ getter_AddRefs(supports));
+ if (NS_FAILED(rv)) {
+ aRv.Throw(rv);
+ return nullptr;
+ }
+
+ nsCOMPtr promise = do_QueryInterface(supports);
+ return promise.forget();
+}
+
} // namespace dom
} // namespace mozilla
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Icc.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Icc.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/Icc.h 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/Icc.h 2015-01-09 12:36:53.000000000 +0000
@@ -16,6 +16,7 @@
class DOMRequest;
class OwningMozIccInfoOrMozGsmIccInfoOrMozCdmaIccInfo;
+class Promise;
class Icc MOZ_FINAL : public DOMEventTargetHelper
{
@@ -101,6 +102,9 @@
MatchMvno(IccMvnoType aMvnoType, const nsAString& aMatchData,
ErrorResult& aRv);
+ already_AddRefed
+ GetServiceState(IccService aService, ErrorResult& aRv);
+
IMPL_EVENT_HANDLER(iccinfochange)
IMPL_EVENT_HANDLER(cardstatechange)
IMPL_EVENT_HANDLER(stkcommand)
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/interfaces/nsIIccProvider.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/interfaces/nsIIccProvider.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/interfaces/nsIIccProvider.idl 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/interfaces/nsIIccProvider.idl 2015-01-09 12:36:53.000000000 +0000
@@ -58,7 +58,7 @@
/**
* XPCOM component (in the content process) that provides the ICC information.
*/
-[scriptable, uuid(bf985ee1-14c9-43c6-a471-8ab52fb24b0d)]
+[scriptable, uuid(a203cd2e-2280-4d8e-a687-42b745d322c1)]
interface nsIIccProvider : nsISupports
{
// MUST match enum IccCardState in MozIcc.webidl!
@@ -101,22 +101,26 @@
const unsigned long CARD_LOCK_TYPE_PUK = 2;
const unsigned long CARD_LOCK_TYPE_PUK2 = 3;
const unsigned long CARD_LOCK_TYPE_NCK = 4;
- const unsigned long CARD_LOCK_TYPE_NCK1 = 5;
- const unsigned long CARD_LOCK_TYPE_NCK2 = 6;
- const unsigned long CARD_LOCK_TYPE_HNCK = 7;
- const unsigned long CARD_LOCK_TYPE_CCK = 8;
- const unsigned long CARD_LOCK_TYPE_SPCK = 9;
- const unsigned long CARD_LOCK_TYPE_RCCK = 10;
- const unsigned long CARD_LOCK_TYPE_RSPCK = 11;
- const unsigned long CARD_LOCK_TYPE_NCK_PUK = 12;
- const unsigned long CARD_LOCK_TYPE_NCK1_PUK = 13;
- const unsigned long CARD_LOCK_TYPE_NCK2_PUK = 14;
- const unsigned long CARD_LOCK_TYPE_HNCK_PUK = 15;
- const unsigned long CARD_LOCK_TYPE_CCK_PUK = 16;
- const unsigned long CARD_LOCK_TYPE_SPCK_PUK = 17;
- const unsigned long CARD_LOCK_TYPE_RCCK_PUK = 18;
- const unsigned long CARD_LOCK_TYPE_RSPCK_PUK = 19;
- const unsigned long CARD_LOCK_TYPE_FDN = 20;
+ const unsigned long CARD_LOCK_TYPE_NSCK = 5;
+ const unsigned long CARD_LOCK_TYPE_NCK1 = 6;
+ const unsigned long CARD_LOCK_TYPE_NCK2 = 7;
+ const unsigned long CARD_LOCK_TYPE_HNCK = 8;
+ const unsigned long CARD_LOCK_TYPE_CCK = 9;
+ const unsigned long CARD_LOCK_TYPE_SPCK = 10;
+ const unsigned long CARD_LOCK_TYPE_PCK = 11;
+ const unsigned long CARD_LOCK_TYPE_RCCK = 12;
+ const unsigned long CARD_LOCK_TYPE_RSPCK = 13;
+ const unsigned long CARD_LOCK_TYPE_NCK_PUK = 14;
+ const unsigned long CARD_LOCK_TYPE_NSCK_PUK = 15;
+ const unsigned long CARD_LOCK_TYPE_NCK1_PUK = 16;
+ const unsigned long CARD_LOCK_TYPE_NCK2_PUK = 17;
+ const unsigned long CARD_LOCK_TYPE_HNCK_PUK = 18;
+ const unsigned long CARD_LOCK_TYPE_CCK_PUK = 19;
+ const unsigned long CARD_LOCK_TYPE_SPCK_PUK = 20;
+ const unsigned long CARD_LOCK_TYPE_PCK_PUK = 21;
+ const unsigned long CARD_LOCK_TYPE_RCCK_PUK = 22;
+ const unsigned long CARD_LOCK_TYPE_RSPCK_PUK = 23;
+ const unsigned long CARD_LOCK_TYPE_FDN = 24;
// MUST match with enum IccContactType in MozIcc.webidl
const unsigned long CARD_CONTACT_TYPE_ADN = 0;
@@ -128,6 +132,9 @@
const unsigned long CARD_MVNO_TYPE_SPN = 1;
const unsigned long CARD_MVNO_TYPE_GID = 2;
+ // MUST match with enum IccService in MozIcc.webidl
+ const unsigned long CARD_SERVICE_FDN = 0;
+
/**
* Called when a content process registers receiving unsolicited messages from
* RadioInterfaceLayer in the chrome process. Only a content process that has
@@ -239,4 +246,8 @@
in nsIDOMWindow window,
in unsigned long mvnoType,
in DOMString mvnoData);
+
+ nsISupports getServiceState(in unsigned long clientId,
+ in nsIDOMWindow window,
+ in unsigned long service);
};
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/tests/marionette/manifest.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/tests/marionette/manifest.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/tests/marionette/manifest.ini 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/tests/marionette/manifest.ini 2015-01-09 12:36:53.000000000 +0000
@@ -31,3 +31,4 @@
[test_icc_access_invalid_object.js]
[test_icc_detected_undetected_event.js]
[test_icc_match_mvno.js]
+[test_icc_service_state.js]
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/tests/marionette/test_icc_service_state.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/tests/marionette/test_icc_service_state.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/icc/tests/marionette/test_icc_service_state.js 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/icc/tests/marionette/test_icc_service_state.js 2015-01-09 12:36:53.000000000 +0000
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = "head.js";
+
+function testUnsupportedService() {
+ try {
+ icc.getServiceState("unsupported-service");
+ ok(false, "should get exception");
+ } catch (aException) {
+ ok(true, "got exception: " + aException);
+ }
+}
+
+// Start tests
+startTestCommon(function() {
+ let icc = getMozIcc();
+
+ // Check fdn service state
+ return icc.getServiceState("fdn")
+ .then((aResult) => {
+ is(aResult, true, "check fdn service state");
+ })
+
+ // Test unsupported service
+ .then(() => testUnsupportedService());
+});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/indexedDB/ActorsParent.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/indexedDB/ActorsParent.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/indexedDB/ActorsParent.cpp 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/indexedDB/ActorsParent.cpp 2015-01-09 12:36:53.000000000 +0000
@@ -5210,7 +5210,7 @@
void
NoteBackgroundThread(nsIEventTarget* aBackgroundThread);
- NS_INLINE_DECL_REFCOUNTING(QuotaClient)
+ NS_INLINE_DECL_REFCOUNTING(QuotaClient, MOZ_OVERRIDE)
virtual mozilla::dom::quota::Client::Type
GetType() MOZ_OVERRIDE;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/interfaces/base/nsIDOMWindowUtils.idl thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/interfaces/base/nsIDOMWindowUtils.idl
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/interfaces/base/nsIDOMWindowUtils.idl 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/interfaces/base/nsIDOMWindowUtils.idl 2015-01-09 12:36:54.000000000 +0000
@@ -51,7 +51,7 @@
interface nsIJSRAIIHelper;
interface nsIContentPermissionRequest;
-[scriptable, uuid(9621eb05-b498-4e87-a012-95d817987624)]
+[scriptable, uuid(4922a706-a17e-48e0-ab6f-9fe1bbe4e5f7)]
interface nsIDOMWindowUtils : nsISupports {
/**
@@ -199,24 +199,16 @@
/**
* Get/set the resolution at which rescalable web content is drawn.
- * Currently this is only (some) thebes content.
*
* Setting a new resolution does *not* trigger reflow. This API is
* entirely separate from textZoom and fullZoom; a resolution scale
* can be applied together with both textZoom and fullZoom.
*
- * The effect of is API for gfx code to allocate more or fewer
+ * The effect of this API is for gfx code to allocate more or fewer
* pixels for rescalable content by a factor of |resolution| in
- * either or both dimensions. setResolution() together with
- * setDisplayport() can be used to implement a non-reflowing
- * scale-zoom in concert with another entity that can draw with a
- * scale. For example, to scale a content |window| inside a
- * by a factor of 2.0
- *
- * window.setDisplayport(x, y, oldW / 2.0, oldH / 2.0);
- * window.setResolution(2.0, 2.0);
- * // elsewhere
- * browser.setViewportScale(2.0, 2.0);
+ * either or both dimensions. The scale at which the content is
+ * displayed does not change; if that is desired, use
+ * setResolutionAndScaleTo() instead.
*
* The caller of this method must have chrome privileges.
*/
@@ -225,6 +217,19 @@
void getResolution(out float aXResolution, out float aYResolution);
/**
+ * Similar to setResolution(), but also scales the content by the
+ * amount of the resolution, so that it is displayed at a
+ * correspondingly larger or smaller size, without the need for
+ * the caller to set an additional transform.
+ *
+ * This can be used to implement a non-reflowing scale-zoom, e.g.
+ * for pinch-zoom on mobile platforms.
+ *
+ * The caller of this method must have chrome privileges.
+ */
+ void setResolutionAndScaleTo(in float aXResolution, in float aYResolution);
+
+ /**
* Whether the resolution has been set by the user.
* This gives a way to check whether the provided resolution is the default
* value or restored from a previous session.
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/ipc/TabChild.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/ipc/TabChild.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/ipc/TabChild.cpp 2015-01-07 22:15:27.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/ipc/TabChild.cpp 2015-01-09 12:36:55.000000000 +0000
@@ -435,7 +435,7 @@
// This is the root layer, so the cumulative resolution is the same
// as the resolution.
metrics.mPresShellResolution = metrics.GetCumulativeResolution().scale;
- utils->SetResolution(metrics.mPresShellResolution, metrics.mPresShellResolution);
+ utils->SetResolutionAndScaleTo(metrics.mPresShellResolution, metrics.mPresShellResolution);
CSSSize scrollPort = metrics.CalculateCompositedSizeInCssPixels();
utils->SetScrollPositionClampingScrollPortSize(scrollPort.width, scrollPort.height);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/AbstractMediaDecoder.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/AbstractMediaDecoder.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/AbstractMediaDecoder.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/AbstractMediaDecoder.h 2015-01-09 12:36:55.000000000 +0000
@@ -65,6 +65,9 @@
// Can be called on any thread.
virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded) = 0;
+ // For decoders with a notion of timestamp offset, returns the value in microseconds.
+ virtual int64_t GetTimestampOffset() const { return 0; }
+
// Return the duration of the media in microseconds.
virtual int64_t GetMediaDuration() = 0;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/encoder/OmxTrackEncoder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/encoder/OmxTrackEncoder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/encoder/OmxTrackEncoder.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/encoder/OmxTrackEncoder.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -26,6 +26,13 @@
#define ENCODER_CONFIG_FRAME_RATE 30 // fps
#define GET_ENCODED_VIDEO_FRAME_TIMEOUT 100000 // microseconds
+OmxVideoTrackEncoder::OmxVideoTrackEncoder()
+ : VideoTrackEncoder()
+{}
+
+OmxVideoTrackEncoder::~OmxVideoTrackEncoder()
+{}
+
nsresult
OmxVideoTrackEncoder::Init(int aWidth, int aHeight, int aDisplayWidth,
int aDisplayHeight, TrackRate aTrackRate)
@@ -162,6 +169,13 @@
return NS_OK;
}
+OmxAudioTrackEncoder::OmxAudioTrackEncoder()
+ : AudioTrackEncoder()
+{}
+
+OmxAudioTrackEncoder::~OmxAudioTrackEncoder()
+{}
+
nsresult
OmxAudioTrackEncoder::AppendEncodedFrames(EncodedFrameContainer& aContainer)
{
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/encoder/OmxTrackEncoder.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/encoder/OmxTrackEncoder.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/encoder/OmxTrackEncoder.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/encoder/OmxTrackEncoder.h 2015-01-09 12:36:56.000000000 +0000
@@ -26,9 +26,8 @@
class OmxVideoTrackEncoder: public VideoTrackEncoder
{
public:
- OmxVideoTrackEncoder()
- : VideoTrackEncoder()
- {}
+ OmxVideoTrackEncoder();
+ ~OmxVideoTrackEncoder();
already_AddRefed GetMetadata() MOZ_OVERRIDE;
@@ -46,9 +45,8 @@
class OmxAudioTrackEncoder : public AudioTrackEncoder
{
public:
- OmxAudioTrackEncoder()
- : AudioTrackEncoder()
- {}
+ OmxAudioTrackEncoder();
+ ~OmxAudioTrackEncoder();
already_AddRefed GetMetadata() = 0;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/android/AndroidDecoderModule.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/android/AndroidDecoderModule.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/android/AndroidDecoderModule.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/android/AndroidDecoderModule.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -138,7 +138,7 @@
data.mSync = eglSync;
data.mOwns = true;
data.mSize = gfx::IntSize(mConfig.display_width, mConfig.display_height);
- data.mOriginPos = gl::OriginPos::TopLeft;
+ data.mOriginPos = gl::OriginPos::BottomLeft;
layers::EGLImageImage* typedImg = static_cast(img.get());
typedImg->SetData(data);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/gonk/GonkMediaDataDecoder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/gonk/GonkMediaDataDecoder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/gonk/GonkMediaDataDecoder.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/gonk/GonkMediaDataDecoder.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -11,7 +11,7 @@
#include "prlog.h"
#include
-#define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder(blake)", __VA_ARGS__)
+#define GMDD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "GonkMediaDataDecoder", __VA_ARGS__)
#ifdef PR_LOGGING
PRLogModuleInfo* GetDemuxerLog();
@@ -89,8 +89,9 @@
GonkMediaDataDecoder::ProcessOutput()
{
nsRefPtr output;
- nsresult rv;
- while (true && !mDrainComplete) {
+ nsresult rv = NS_ERROR_ABORT;
+
+ while (!mDrainComplete) {
rv = mManager->Output(mLastStreamOffset, output);
if (rv == NS_OK) {
mCallback->Output(output);
@@ -121,6 +122,7 @@
mDrainComplete = true;
return;
}
+ GMDD_LOG("Callback error!");
mCallback->Error();
}
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/MP4Reader.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/MP4Reader.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/fmp4/MP4Reader.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/fmp4/MP4Reader.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -157,7 +157,7 @@
{
MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
PlatformDecoderModule::Init();
- mDemuxer = new MP4Demuxer(new MP4Stream(mDecoder->GetResource(), &mDemuxerMonitor), &mDemuxerMonitor);
+ mDemuxer = new MP4Demuxer(new MP4Stream(mDecoder->GetResource(), &mDemuxerMonitor), GetDecoder()->GetTimestampOffset(), &mDemuxerMonitor);
InitLayersBackendType();
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/gtest/MockMediaResource.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/gtest/MockMediaResource.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/gtest/MockMediaResource.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/gtest/MockMediaResource.h 2015-01-09 12:36:56.000000000 +0000
@@ -38,7 +38,7 @@
return NS_OK;
}
virtual nsresult ReadAt(int64_t aOffset, char* aBuffer, uint32_t aCount,
- uint32_t* aBytes);
+ uint32_t* aBytes) MOZ_OVERRIDE;
virtual nsresult Seek(int32_t aWhence, int64_t aOffset) MOZ_OVERRIDE
{
return NS_OK;
@@ -57,7 +57,7 @@
virtual bool IsSuspendedByCache() MOZ_OVERRIDE { return false; }
virtual bool IsSuspended() MOZ_OVERRIDE { return false; }
virtual nsresult ReadFromCache(char* aBuffer, int64_t aOffset,
- uint32_t aCount)
+ uint32_t aCount) MOZ_OVERRIDE
{
return NS_OK;
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/gtest/TestMP4Demuxer.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/gtest/TestMP4Demuxer.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/gtest/TestMP4Demuxer.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/gtest/TestMP4Demuxer.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -24,7 +24,7 @@
explicit MP4DemuxerBinding(const char* aFileName = "dash_dashinit.mp4")
: resource(new MockMediaResource(aFileName))
, mMonitor("TestMP4Demuxer monitor")
- , demuxer(new MP4Demuxer(new MP4Stream(resource, &mMonitor), &mMonitor))
+ , demuxer(new MP4Demuxer(new MP4Stream(resource, &mMonitor), 0, &mMonitor))
{
EXPECT_EQ(NS_OK, resource->Open(nullptr));
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/ContainerParser.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/ContainerParser.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/ContainerParser.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/ContainerParser.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -237,8 +237,8 @@
return false;
}
- return aData[4] == 'm' && aData[5] == 'o' && aData[6] == 'o' &&
- aData[7] == 'f';
+ return (aData[4] == 'm' && aData[5] == 'o' && aData[6] == 'o' && aData[7] == 'f') ||
+ (aData[4] == 's' && aData[5] == 't' && aData[6] == 'y' && aData[7] == 'p');
}
bool ParseStartAndEndTimestamps(const uint8_t* aData, uint32_t aLength,
@@ -249,7 +249,11 @@
bool initSegment = IsInitSegmentPresent(aData, aLength);
if (initSegment) {
mStream = new mp4_demuxer::BufferStream();
- mParser = new mp4_demuxer::MoofParser(mStream, 0, &mMonitor);
+ // We use a timestampOffset of 0 for ContainerParser, and require
+ // consumers of ParseStartAndEndTimestamps to add their timestamp offset
+ // manually. This allows the ContainerParser to be shared across different
+ // timestampOffsets.
+ mParser = new mp4_demuxer::MoofParser(mStream, 0, 0, &mMonitor);
} else if (!mStream || !mParser) {
return false;
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSource.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSource.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSource.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSource.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -19,10 +19,14 @@
#include "mozilla/dom/TimeRanges.h"
#include "mozilla/mozalloc.h"
#include "nsContentTypeParser.h"
+#include "nsContentUtils.h"
#include "nsDebug.h"
#include "nsError.h"
+#include "nsIEffectiveTLDService.h"
#include "nsIRunnable.h"
#include "nsIScriptObjectPrincipal.h"
+#include "nsIURI.h"
+#include "nsNetCID.h"
#include "nsPIDOMWindow.h"
#include "nsString.h"
#include "nsThreadUtils.h"
@@ -306,6 +310,49 @@
return NS_SUCCEEDED(rv);
}
+/* static */ bool
+MediaSource::Enabled(JSContext* cx, JSObject* aGlobal)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+
+ // Don't use aGlobal across Preferences stuff, which the static
+ // analysis thinks can GC.
+ JS::Rooted global(cx, aGlobal);
+
+ bool enabled = Preferences::GetBool("media.mediasource.enabled");
+ if (!enabled) {
+ return false;
+ }
+
+ // Check whether it's enabled everywhere or just YouTube.
+ bool restrict = Preferences::GetBool("media.mediasource.youtubeonly", false);
+ if (!restrict) {
+ return true;
+ }
+
+ // We want to restrict to YouTube only. We define that as the
+ // origin being https://*.youtube.com.
+ nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(global);
+ nsCOMPtr uri;
+ if (NS_FAILED(principal->GetURI(getter_AddRefs(uri))) || !uri) {
+ return false;
+ }
+
+ bool isHttps = false;
+ if (NS_FAILED(uri->SchemeIs("https", &isHttps)) || !isHttps) {
+ return false;
+ }
+
+ nsCOMPtr tldServ =
+ do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
+ NS_ENSURE_TRUE(tldServ, false);
+
+ nsAutoCString eTLDplusOne;
+ return
+ NS_SUCCEEDED(tldServ->GetBaseDomain(uri, 0, eTLDplusOne)) &&
+ eTLDplusOne.EqualsLiteral("youtube.com");
+}
+
bool
MediaSource::Attach(MediaSourceDecoder* aDecoder)
{
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceDecoder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceDecoder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceDecoder.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceDecoder.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -129,10 +129,10 @@
}
already_AddRefed
-MediaSourceDecoder::CreateSubDecoder(const nsACString& aType)
+MediaSourceDecoder::CreateSubDecoder(const nsACString& aType, int64_t aTimestampOffset)
{
MOZ_ASSERT(mReader);
- return mReader->CreateSubDecoder(aType);
+ return mReader->CreateSubDecoder(aType, aTimestampOffset);
}
void
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceDecoder.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceDecoder.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceDecoder.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceDecoder.h 2015-01-09 12:36:56.000000000 +0000
@@ -46,7 +46,8 @@
void AttachMediaSource(dom::MediaSource* aMediaSource);
void DetachMediaSource();
- already_AddRefed CreateSubDecoder(const nsACString& aType);
+ already_AddRefed CreateSubDecoder(const nsACString& aType,
+ int64_t aTimestampOffset /* microseconds */);
void AddTrackBuffer(TrackBuffer* aTrackBuffer);
void RemoveTrackBuffer(TrackBuffer* aTrackBuffer);
void OnTrackBufferConfigured(TrackBuffer* aTrackBuffer, const MediaInfo& aInfo);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSource.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSource.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSource.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSource.h 2015-01-09 12:36:56.000000000 +0000
@@ -60,6 +60,8 @@
void EndOfStream(const Optional& aError, ErrorResult& aRv);
static bool IsTypeSupported(const GlobalObject&, const nsAString& aType);
+
+ static bool Enabled(JSContext* cx, JSObject* aGlobal);
/** End WebIDL Methods. */
NS_DECL_ISUPPORTS_INHERITED
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceReader.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceReader.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceReader.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceReader.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -457,14 +457,14 @@
}
already_AddRefed
-MediaSourceReader::CreateSubDecoder(const nsACString& aType)
+MediaSourceReader::CreateSubDecoder(const nsACString& aType, int64_t aTimestampOffset)
{
if (IsShutdown()) {
return nullptr;
}
MOZ_ASSERT(GetTaskQueue());
nsRefPtr decoder =
- new SourceBufferDecoder(new SourceBufferResource(aType), mDecoder);
+ new SourceBufferDecoder(new SourceBufferResource(aType), mDecoder, aTimestampOffset);
nsRefPtr reader(CreateReaderForType(aType, decoder));
if (!reader) {
return nullptr;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceReader.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceReader.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/MediaSourceReader.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/MediaSourceReader.h 2015-01-09 12:36:56.000000000 +0000
@@ -99,7 +99,8 @@
// Acquires the decoder monitor, and is thus callable on any thread.
nsresult GetBuffered(dom::TimeRanges* aBuffered) MOZ_OVERRIDE;
- already_AddRefed CreateSubDecoder(const nsACString& aType);
+ already_AddRefed CreateSubDecoder(const nsACString& aType,
+ int64_t aTimestampOffset /* microseconds */);
void AddTrackBuffer(TrackBuffer* aTrackBuffer);
void RemoveTrackBuffer(TrackBuffer* aTrackBuffer);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBuffer.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBuffer.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBuffer.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBuffer.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -335,7 +335,9 @@
}
StartUpdating();
- if (!mTrackBuffer->AppendData(aData, aLength)) {
+ MOZ_ASSERT(mAppendMode == SourceBufferAppendMode::Segments,
+ "We don't handle timestampOffset for sequence mode yet");
+ if (!mTrackBuffer->AppendData(aData, aLength, mTimestampOffset * USECS_PER_S)) {
Optional decodeError(MediaSourceEndOfStreamError::Decode);
ErrorResult dummy;
mMediaSource->EndOfStream(decodeError, dummy);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBufferDecoder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBufferDecoder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBufferDecoder.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBufferDecoder.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -33,10 +33,12 @@
NS_IMPL_ISUPPORTS0(SourceBufferDecoder)
SourceBufferDecoder::SourceBufferDecoder(MediaResource* aResource,
- AbstractMediaDecoder* aParentDecoder)
+ AbstractMediaDecoder* aParentDecoder,
+ int64_t aTimestampOffset)
: mResource(aResource)
, mParentDecoder(aParentDecoder)
, mReader(nullptr)
+ , mTimestampOffset(aTimestampOffset)
, mMediaDuration(-1)
{
MOZ_ASSERT(NS_IsMainThread());
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBufferDecoder.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBufferDecoder.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/SourceBufferDecoder.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/SourceBufferDecoder.h 2015-01-09 12:36:56.000000000 +0000
@@ -32,7 +32,8 @@
public:
// This class holds a weak pointer to MediaResource. It's the responsibility
// of the caller to manage the memory of the MediaResource object.
- SourceBufferDecoder(MediaResource* aResource, AbstractMediaDecoder* aParentDecoder);
+ SourceBufferDecoder(MediaResource* aResource, AbstractMediaDecoder* aParentDecoder,
+ int64_t aTimestampOffset /* microseconds */);
NS_DECL_THREADSAFE_ISUPPORTS
@@ -41,6 +42,7 @@
virtual bool IsTransportSeekable() MOZ_FINAL MOZ_OVERRIDE;
virtual bool OnDecodeThread() const MOZ_FINAL MOZ_OVERRIDE;
virtual bool OnStateMachineThread() const MOZ_FINAL MOZ_OVERRIDE;
+ virtual int64_t GetTimestampOffset() const MOZ_FINAL MOZ_OVERRIDE { return mTimestampOffset; }
virtual int64_t GetMediaDuration() MOZ_FINAL MOZ_OVERRIDE;
virtual layers::ImageContainer* GetImageContainer() MOZ_FINAL MOZ_OVERRIDE;
virtual MediaDecoderOwner* GetOwner() MOZ_FINAL MOZ_OVERRIDE;
@@ -129,6 +131,7 @@
AbstractMediaDecoder* mParentDecoder;
nsRefPtr mReader;
+ int64_t mTimestampOffset;
int64_t mMediaDuration;
#ifdef MOZ_EME
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/1005366.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/1005366.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/1005366.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/1005366.html 2015-01-09 12:36:56.000000000 +0000
@@ -6,6 +6,7 @@
/*
user_pref("media.mediasource.enabled", true);
+user_pref("media.mediasource.youtubeonly", false);
*/
function boom()
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/1059035.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/1059035.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/1059035.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/1059035.html 2015-01-09 12:36:56.000000000 +0000
@@ -5,6 +5,7 @@
/*
user_pref("media.mediasource.enabled", true);
+user_pref("media.mediasource.youtubeonly", false);
*/
function boom()
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/crashtests.list thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/crashtests.list
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/crashtests/crashtests.list 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/crashtests/crashtests.list 2015-01-09 12:36:56.000000000 +0000
@@ -1,4 +1,4 @@
-test-pref(media.mediasource.enabled,true) load 926665.html
-test-pref(media.mediasource.enabled,true) load 931388.html
-test-pref(media.mediasource.enabled,true) load 1005366.html
-test-pref(media.mediasource.enabled,true) load 1059035.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 926665.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 931388.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 1005366.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 1059035.html
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/mediasource.js thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/mediasource.js
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/mediasource.js 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/mediasource.js 2015-01-09 12:36:56.000000000 +0000
@@ -17,7 +17,10 @@
}
addLoadEvent(function () {
- SpecialPowers.pushPrefEnv({"set": [[ "media.mediasource.enabled", true ]]},
+ SpecialPowers.pushPrefEnv({"set": [
+ [ "media.mediasource.enabled", true ],
+ [ "media.mediasource.youtubeonly", false ],
+ ]},
bootstrapTest);
});
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/test_MediaSource_disabled.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/test_MediaSource_disabled.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/test/test_MediaSource_disabled.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/test/test_MediaSource_disabled.html 2015-01-09 12:36:56.000000000 +0000
@@ -19,7 +19,12 @@
SimpleTest.finish();
}
-SpecialPowers.pushPrefEnv({"set": [["media.mediasource.enabled", false]]},
+SpecialPowers.pushPrefEnv({"set":
+ [
+ ["media.mediasource.enabled", false],
+ ["media.mediasource.youtubeonly", false],
+ ]
+ },
test);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/TrackBuffer.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/TrackBuffer.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/TrackBuffer.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/TrackBuffer.cpp 2015-01-09 12:36:56.000000000 +0000
@@ -39,6 +39,7 @@
: mParentDecoder(aParentDecoder)
, mType(aType)
, mLastStartTimestamp(0)
+ , mLastTimestampOffset(0)
, mShutdown(false)
{
MOZ_COUNT_CTOR(TrackBuffer);
@@ -85,9 +86,9 @@
}
}
- bool NewDecoder()
+ bool NewDecoder(int64_t aTimestampOffset)
{
- nsRefPtr decoder = mOwner->NewDecoder();
+ nsRefPtr decoder = mOwner->NewDecoder(aTimestampOffset);
if (!decoder) {
return false;
}
@@ -138,14 +139,14 @@
}
bool
-TrackBuffer::AppendData(const uint8_t* aData, uint32_t aLength)
+TrackBuffer::AppendData(const uint8_t* aData, uint32_t aLength, int64_t aTimestampOffset)
{
MOZ_ASSERT(NS_IsMainThread());
DecodersToInitialize decoders(this);
// TODO: Run more of the buffer append algorithm asynchronously.
if (mParser->IsInitSegmentPresent(aData, aLength)) {
MSE_DEBUG("TrackBuffer(%p)::AppendData: New initialization segment.", this);
- if (!decoders.NewDecoder()) {
+ if (!decoders.NewDecoder(aTimestampOffset)) {
return false;
}
} else if (!mParser->HasInitData()) {
@@ -155,16 +156,19 @@
int64_t start, end;
if (mParser->ParseStartAndEndTimestamps(aData, aLength, start, end)) {
+ start += aTimestampOffset;
+ end += aTimestampOffset;
if (mParser->IsMediaSegmentPresent(aData, aLength) &&
mLastEndTimestamp &&
(!mParser->TimestampsFuzzyEqual(start, mLastEndTimestamp.value()) ||
+ mLastTimestampOffset != aTimestampOffset ||
mDecoderPerSegment)) {
MSE_DEBUG("TrackBuffer(%p)::AppendData: Data last=[%lld, %lld] overlaps [%lld, %lld]",
this, mLastStartTimestamp, mLastEndTimestamp.value(), start, end);
// This data is earlier in the timeline than data we have already
// processed, so we must create a new decoder to handle the decoding.
- if (!decoders.NewDecoder()) {
+ if (!decoders.NewDecoder(aTimestampOffset)) {
return false;
}
MSE_DEBUG("TrackBuffer(%p)::AppendData: Decoder marked as initialized.", this);
@@ -331,14 +335,14 @@
}
already_AddRefed
-TrackBuffer::NewDecoder()
+TrackBuffer::NewDecoder(int64_t aTimestampOffset)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mParentDecoder);
DiscardDecoder();
- nsRefPtr decoder = mParentDecoder->CreateSubDecoder(mType);
+ nsRefPtr decoder = mParentDecoder->CreateSubDecoder(mType, aTimestampOffset);
if (!decoder) {
return nullptr;
}
@@ -348,6 +352,7 @@
mLastStartTimestamp = 0;
mLastEndTimestamp.reset();
+ mLastTimestampOffset = aTimestampOffset;
decoder->SetTaskQueue(mTaskQueue);
return decoder.forget();
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/TrackBuffer.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/TrackBuffer.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/mediasource/TrackBuffer.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/mediasource/TrackBuffer.h 2015-01-09 12:36:56.000000000 +0000
@@ -39,7 +39,7 @@
// Append data to the current decoder. Also responsible for calling
// NotifyDataArrived on the decoder to keep buffered range computation up
// to date. Returns false if the append failed.
- bool AppendData(const uint8_t* aData, uint32_t aLength);
+ bool AppendData(const uint8_t* aData, uint32_t aLength, int64_t aTimestampOffset /* microseconds */);
bool EvictData(uint32_t aThreshold);
void EvictBefore(double aTime);
@@ -92,7 +92,7 @@
// for initialization.
// The decoder is not considered initialized until it is added to
// mInitializedDecoders.
- already_AddRefed NewDecoder();
+ already_AddRefed NewDecoder(int64_t aTimestampOffset /* microseconds */);
// Helper for AppendData, ensures NotifyDataArrived is called whenever
// data is appended to the current decoder's SourceBufferResource.
@@ -156,6 +156,9 @@
int64_t mLastStartTimestamp;
Maybe mLastEndTimestamp;
+ // The timestamp offset used by our current decoder, in microseconds.
+ int64_t mLastTimestampOffset;
+
// Set when the first decoder used by this TrackBuffer is initialized.
// Protected by mParentDecoder's monitor.
MediaInfo mInfo;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOffloadPlayer.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOffloadPlayer.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOffloadPlayer.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOffloadPlayer.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -55,18 +55,18 @@
static const uint64_t OFFLOAD_PAUSE_MAX_MSECS = 60000ll;
AudioOffloadPlayer::AudioOffloadPlayer(MediaOmxCommonDecoder* aObserver) :
- mObserver(aObserver),
- mInputBuffer(nullptr),
- mSampleRate(0),
+ mStarted(false),
+ mPlaying(false),
mSeeking(false),
- mSeekDuringPause(false),
mReachedEOS(false),
- mSeekTimeUs(0),
+ mSeekDuringPause(false),
+ mIsElementVisible(true),
+ mSampleRate(0),
mStartPosUs(0),
+ mSeekTimeUs(0),
mPositionTimeMediaUs(-1),
- mStarted(false),
- mPlaying(false),
- mIsElementVisible(true)
+ mInputBuffer(nullptr),
+ mObserver(aObserver)
{
MOZ_ASSERT(NS_IsMainThread());
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOutput.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOutput.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOutput.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOutput.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -33,11 +33,11 @@
using namespace android;
AudioOutput::AudioOutput(int aSessionId, int aUid) :
- mCallback(nullptr),
mCallbackCookie(nullptr),
+ mCallback(nullptr),
mCallbackData(nullptr),
- mSessionId(aSessionId),
- mUid(aUid)
+ mUid(aUid),
+ mSessionId(aSessionId)
{
#ifdef PR_LOGGING
if (!gAudioOffloadPlayerLog) {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOutput.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOutput.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/AudioOutput.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/AudioOutput.h 2015-01-09 12:36:57.000000000 +0000
@@ -26,8 +26,6 @@
#include "AudioSink.h"
-#define LOG_TAG "AudioOffloadPlayer"
-
namespace mozilla {
/**
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/MediaCodecProxy.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/MediaCodecProxy.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/MediaCodecProxy.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/MediaCodecProxy.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -12,9 +12,8 @@
#include
#include "stagefright/MediaErrors.h"
-#define LOG_TAG "MediaCodecProxy"
#include
-#define ALOG(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define MCP_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "MediaCodecProxy", __VA_ARGS__)
#define TIMEOUT_DEQUEUE_INPUTBUFFER_MS 1000000ll
namespace android {
@@ -183,7 +182,7 @@
// Release MediaCodec
if (mCodec != nullptr) {
- status_t err = mCodec->stop();
+ mCodec->stop();
mCodec->release();
mCodec = nullptr;
}
@@ -494,17 +493,16 @@
bool MediaCodecProxy::Prepare()
{
- status_t err;
if (start() != OK) {
- ALOG("Couldn't start MediaCodec");
+ MCP_LOG("Couldn't start MediaCodec");
return false;
}
if (getInputBuffers(&mInputBuffers) != OK) {
- ALOG("Couldn't get input buffers from MediaCodec");
+ MCP_LOG("Couldn't get input buffers from MediaCodec");
return false;
}
if (getOutputBuffers(&mOutputBuffers) != OK) {
- ALOG("Couldn't get output buffers from MediaCodec");
+ MCP_LOG("Couldn't get output buffers from MediaCodec");
return false;
}
@@ -514,13 +512,13 @@
bool MediaCodecProxy::UpdateOutputBuffers()
{
if (mCodec == nullptr) {
- ALOG("MediaCodec has not been inited from input!");
+ MCP_LOG("MediaCodec has not been inited from input!");
return false;
}
status_t err = getOutputBuffers(&mOutputBuffers);
if (err != OK){
- ALOG("Couldn't update output buffers from MediaCodec");
+ MCP_LOG("Couldn't update output buffers from MediaCodec");
return false;
}
return true;
@@ -530,14 +528,14 @@
int64_t aTimestampUsecs, uint64_t aflags)
{
if (mCodec == nullptr) {
- ALOG("MediaCodec has not been inited from input!");
+ MCP_LOG("MediaCodec has not been inited from input!");
return NO_INIT;
}
size_t index;
status_t err = dequeueInputBuffer(&index, TIMEOUT_DEQUEUE_INPUTBUFFER_MS);
if (err != OK) {
- ALOG("dequeueInputBuffer returned %d", err);
+ MCP_LOG("dequeueInputBuffer returned %d", err);
return err;
}
@@ -554,7 +552,7 @@
}
if (err != OK) {
- ALOG("queueInputBuffer returned %d", err);
+ MCP_LOG("queueInputBuffer returned %d", err);
return err;
}
return err;
@@ -563,7 +561,7 @@
status_t MediaCodecProxy::Output(MediaBuffer** aBuffer, int64_t aTimeoutUs)
{
if (mCodec == nullptr) {
- ALOG("MediaCodec has not been inited from output!");
+ MCP_LOG("MediaCodec has not been inited from output!");
return NO_INIT;
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/MediaOmxReader.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/MediaOmxReader.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/MediaOmxReader.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/MediaOmxReader.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -138,15 +138,15 @@
MediaOmxReader::MediaOmxReader(AbstractMediaDecoder *aDecoder)
: MediaOmxCommonReader(aDecoder)
, mMutex("MediaOmxReader.Data")
- , mMP3FrameParser(-1)
, mHasVideo(false)
, mHasAudio(false)
, mVideoSeekTimeUs(-1)
, mAudioSeekTimeUs(-1)
+ , mLastParserDuration(-1)
, mSkipCount(0)
, mUseParserDuration(false)
- , mLastParserDuration(-1)
, mIsShutdown(false)
+ , mMP3FrameParser(-1)
, mIsWaitingResources(false)
{
#ifdef PR_LOGGING
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -148,7 +148,7 @@
return;
}
- const sp& req = mResources.nextRequest(type);
+ sp req = mResources.nextRequest(type);
mResources.aquireResource(req, type, found);
// Notify resource assignment to the client.
sp client = interface_cast(req);
@@ -292,7 +292,7 @@
return queue.size();
}
-const sp& MediaResourceManagerService::ResourceTable::nextRequest(ResourceType type)
+sp MediaResourceManagerService::ResourceTable::nextRequest(ResourceType type)
{
ssize_t found = mMap.indexOfKey(type);
if (found == NAME_NOT_FOUND) {
@@ -333,7 +333,7 @@
status_t MediaResourceManagerService::ResourceTable::forgetClient(const sp& client)
{
// Traverse all resources.
- for (int i = 0; i < mMap.size(); i++) {
+ for (size_t i = 0; i < mMap.size(); i++) {
forgetClient(client, mMap.keyAt(i));
}
return OK;
@@ -358,7 +358,7 @@
// Revoke ownership for given client.
Slots& slots = resources.mSlots;
- for (int i = 0; i < slots.size(); i++) {
+ for (size_t i = 0; i < slots.size(); i++) {
ResourceSlot& slot = slots.editItemAt(i);
if (client.get() == slot.mClient.get()) {
slot.mClient = nullptr;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/MediaResourceManagerService.h 2015-01-09 12:36:57.000000000 +0000
@@ -99,7 +99,7 @@
// Request operations.
bool hasRequest(ResourceType type);
uint32_t countRequests(ResourceType type);
- const sp& nextRequest(ResourceType type);
+ sp nextRequest(ResourceType type);
status_t enqueueRequest(const sp& client, ResourceType type);
status_t dequeueRequest(ResourceType type);
status_t forgetClient(const sp& client, ResourceType type);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/mediaresourcemanager/moz.build 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/mediaresourcemanager/moz.build 2015-01-09 12:36:57.000000000 +0000
@@ -24,6 +24,13 @@
include('/ipc/chromium/chromium-config.mozbuild')
+# Suppress some GCC/clang warnings being treated as errors:
+# - about multi-character constants which are used in codec-related code
+if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
+ CXXFLAGS += [
+ '-Wno-error=multichar'
+ ]
+
CXXFLAGS += [
'-I%s/%s' % (CONFIG['ANDROID_SOURCE'], d) for d in [
'frameworks/base/include',
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/moz.build 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/moz.build 2015-01-09 12:36:57.000000000 +0000
@@ -79,6 +79,16 @@
include('/ipc/chromium/chromium-config.mozbuild')
+# Suppress some GCC/clang warnings being treated as errors:
+# - about attributes on forward declarations for types that are already
+# defined, which complains about an important MOZ_EXPORT for android::AString
+# - about multi-character constants which are used in codec-related code
+if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
+ CXXFLAGS += [
+ '-Wno-error=attributes',
+ '-Wno-error=multichar'
+ ]
+
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/dom/base',
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecDescriptorUtil.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecDescriptorUtil.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecDescriptorUtil.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecDescriptorUtil.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -84,8 +84,8 @@
{
// 2 bytes length value.
uint8_t size[] = {
- (mSize & 0xFF00) >> 8, // MSB.
- mSize & 0x00FF, // LSB.
+ uint8_t((mSize & 0xFF00) >> 8), // MSB.
+ uint8_t(mSize & 0x00FF), // LSB.
};
aOutputBuf->AppendElements(size, sizeof(size));
@@ -189,7 +189,6 @@
return ERROR_MALFORMED;
}
- status_t result = OK;
if (aFormat == OMXVideoEncoder::BlobFormat::AVC_NAL) {
// SPS + PPS.
aOutputBuf->AppendElements(sps->data(), sps->size());
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecProxy.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecProxy.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecProxy.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecProxy.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -55,11 +55,11 @@
const sp &nativeWindow)
: mOMX(omx),
mSrcMeta(meta),
- mIsEncoder(createEncoder),
- mSource(source),
mComponentName(nullptr),
+ mIsEncoder(createEncoder),
mFlags(flags),
mNativeWindow(nativeWindow),
+ mSource(source),
mState(MediaResourceManagerClient::CLIENT_STATE_WAIT_FOR_RESOURCE)
{
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecWrapper.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecWrapper.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OMXCodecWrapper.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OMXCodecWrapper.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -287,11 +287,11 @@
size_t vPixStride = horiSubsample * (1 + aSource->mCrSkip);
size_t lineStride = uvSize.height / uvHeight * aSource->mCbCrStride;
- for (int i = 0; i < uvHeight; i++) {
+ for (size_t i = 0; i < uvHeight; i++) {
// 1st pixel per line.
uint8_t* uSrc = u;
uint8_t* vSrc = v;
- for (int j = 0; j < uvWidth; j++) {
+ for (size_t j = 0; j < uvWidth; j++) {
*aDestination++ = *uSrc;
*aDestination++ = *vSrc;
// Pick next source pixel.
@@ -495,10 +495,10 @@
}
// Replace start code with data length.
uint8_t length[] = {
- (aSize >> 24) & 0xFF,
- (aSize >> 16) & 0xFF,
- (aSize >> 8) & 0xFF,
- aSize & 0xFF,
+ uint8_t((aSize >> 24) & 0xFF),
+ uint8_t((aSize >> 16) & 0xFF),
+ uint8_t((aSize >> 8) & 0xFF),
+ uint8_t(aSize & 0xFF),
};
aOutputBuf->AppendElements(length, sizeof(length));
aOutputBuf->AppendElements(aData + sizeof(length), aSize);
@@ -592,8 +592,8 @@
, mInputFlags(aInputFlags)
, mIndex(0)
, mData(nullptr)
- , mOffset(0)
, mCapicity(0)
+ , mOffset(0)
{}
~InputBufferHelper()
@@ -908,14 +908,14 @@
// Decoder config descriptor
const uint8_t decConfig[] = {
0x04, // Decoder config descriptor tag.
- 15 + csdSize, // Size: following bytes + csd size.
+ uint8_t(15 + csdSize), // Size: following bytes + csd size.
0x40, // Object type: MPEG-4 audio.
0x15, // Stream type: audio, reserved: 1.
0x00, 0x03, 0x00, // Buffer size: 768 (kAACFrameSize).
0x00, 0x01, 0x77, 0x00, // Max bitrate: 96000 (kAACBitrate).
0x00, 0x01, 0x77, 0x00, // Avg bitrate: 96000 (kAACBitrate).
0x05, // Decoder specific descriptor tag.
- csdSize, // Data size.
+ uint8_t(csdSize), // Data size.
};
// SL config descriptor.
const uint8_t slConfig[] = {
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OmxDecoder.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OmxDecoder.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/omx/OmxDecoder.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/omx/OmxDecoder.cpp 2015-01-09 12:36:57.000000000 +0000
@@ -33,10 +33,10 @@
#include "OMXCodecProxy.h"
#include "OmxDecoder.h"
-#define LOG_TAG "OmxDecoder"
#include
-#define ALOG(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define OD_LOG(...) __android_log_print(ANDROID_LOG_DEBUG, "OmxDecoder", __VA_ARGS__)
+#undef LOG
#ifdef PR_LOGGING
PRLogModuleInfo *gOmxDecoderLog;
#define LOG(type, msg...) PR_LOG(gOmxDecoderLog, type, (msg))
@@ -65,13 +65,13 @@
mAudioChannels(-1),
mAudioSampleRate(-1),
mDurationUs(-1),
+ mVideoLastFrameTime(-1),
mVideoBuffer(nullptr),
mAudioBuffer(nullptr),
mIsVideoSeeking(false),
mAudioMetadataRead(false),
mAudioPaused(false),
- mVideoPaused(false),
- mVideoLastFrameTime(-1)
+ mVideoPaused(false)
{
mLooper = new ALooper;
mLooper->setName("OmxDecoder");
@@ -119,7 +119,6 @@
}
#endif
- const char* extractorMime;
sp meta = extractor->getMetaData();
ssize_t audioTrackIndex = -1;
@@ -177,7 +176,6 @@
}
if (mAudioTrack.get()) {
durationUs = -1;
- const char* audioMime;
sp meta = mAudioTrack->getFormat();
if ((durationUs == -1) && meta->findInt64(kKeyDuration, &durationUs)) {
@@ -604,7 +602,7 @@
}
continue;
} else if (err != OK) {
- ALOG("Unexpected error when seeking to %lld", aTimeUs);
+ OD_LOG("Unexpected error when seeking to %lld", aTimeUs);
break;
}
// For some codecs, the length of first decoded frame after seek is 0.
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_canvas_blocked.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_canvas_blocked.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_canvas_blocked.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_canvas_blocked.html 2015-01-09 12:36:57.000000000 +0000
@@ -49,6 +49,7 @@
var prefs = [
[ "media.mediasource.enabled", true ],
+ [ "media.mediasource.youtubeonly", false ],
[ "media.mediasource.mp4.enabled", true ],
];
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_playback.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_playback.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_playback.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_playback.html 2015-01-09 12:36:57.000000000 +0000
@@ -92,6 +92,7 @@
var prefs = [
[ "media.mediasource.enabled", true ],
+ [ "media.mediasource.youtubeonly", false ],
[ "media.mediasource.mp4.enabled", true ],
];
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_requestKeySystemAccess.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_requestKeySystemAccess.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_requestKeySystemAccess.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_requestKeySystemAccess.html 2015-01-09 12:36:57.000000000 +0000
@@ -274,6 +274,7 @@
var prefs = [
[ "media.mediasource.enabled", true ],
+ [ "media.mediasource.youtubeonly", false ],
[ "media.mediasource.mp4.enabled", true ],
];
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_stream_capture_blocked.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_stream_capture_blocked.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_eme_stream_capture_blocked.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_eme_stream_capture_blocked.html 2015-01-09 12:36:57.000000000 +0000
@@ -81,6 +81,7 @@
var prefs = [
[ "media.mediasource.enabled", true ],
+ [ "media.mediasource.youtubeonly", false ],
[ "media.mediasource.mp4.enabled", true ],
];
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_VideoPlaybackQuality_disabled.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_VideoPlaybackQuality_disabled.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_VideoPlaybackQuality_disabled.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_VideoPlaybackQuality_disabled.html 2015-01-09 12:36:57.000000000 +0000
@@ -25,7 +25,12 @@
}
addLoadEvent(function() {
- SpecialPowers.pushPrefEnv({"set": [["media.mediasource.enabled", false]]}, test);
+ SpecialPowers.pushPrefEnv({"set":
+ [
+ ["media.mediasource.enabled", false],
+ ["media.mediasource.youtubeonly", false],
+ ]
+ }, test);
});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_VideoPlaybackQuality.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_VideoPlaybackQuality.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/test/test_VideoPlaybackQuality.html 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/test/test_VideoPlaybackQuality.html 2015-01-09 12:36:57.000000000 +0000
@@ -51,7 +51,12 @@
}
addLoadEvent(function() {
- SpecialPowers.pushPrefEnv({"set": [["media.mediasource.enabled", true]]}, test);
+ SpecialPowers.pushPrefEnv({"set":
+ [
+ ["media.mediasource.enabled", true],
+ ["media.mediasource.youtubeonly", false],
+ ]
+ }, test);
});
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/blink/PeriodicWave.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/blink/PeriodicWave.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/blink/PeriodicWave.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/blink/PeriodicWave.cpp 2015-01-09 12:36:58.000000000 +0000
@@ -291,8 +291,12 @@
case OscillatorType::Triangle:
// Triangle-shaped waveform going from its maximum value to
// its minimum value then back to the maximum value.
- a = (4 - 4 * cos(0.5 * omega)) / (n * n * piFloat * piFloat);
- b = 0;
+ a = 0;
+ if (n & 1) {
+ b = 2 * (2 / (n * piFloat) * 2 / (n * piFloat)) * ((((n - 1) >> 1) & 1) ? -1 : 1);
+ } else {
+ b = 0;
+ }
break;
default:
NS_NOTREACHED("invalid oscillator type");
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/OscillatorNode.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/OscillatorNode.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/OscillatorNode.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/OscillatorNode.cpp 2015-01-09 12:36:58.000000000 +0000
@@ -23,40 +23,6 @@
NS_IMPL_ADDREF_INHERITED(OscillatorNode, AudioNode)
NS_IMPL_RELEASE_INHERITED(OscillatorNode, AudioNode)
-static const float sLeakTriangle = 0.995f;
-static const float sLeak = 0.999f;
-
-class DCBlocker
-{
-public:
- // These are sane defauts when the initial mPhase is zero
- explicit DCBlocker(float aLastInput = 0.0f,
- float aLastOutput = 0.0f,
- float aPole = 0.995)
- :mLastInput(aLastInput),
- mLastOutput(aLastOutput),
- mPole(aPole)
- {
- MOZ_ASSERT(aPole > 0);
- }
-
- inline float Process(float aInput)
- {
- float out;
-
- out = mLastOutput * mPole + aInput - mLastInput;
- mLastOutput = out;
- mLastInput = aInput;
-
- return out;
- }
-private:
- float mLastInput;
- float mLastOutput;
- float mPole;
-};
-
-
class OscillatorNodeEngine : public AudioNodeEngine
{
public:
@@ -71,12 +37,6 @@
, mDetune(0.f)
, mType(OscillatorType::Sine)
, mPhase(0.)
- // mSquare, mTriangle, and mSaw are not used for default type "sine".
- // They are initialized if and when switching to the OscillatorTypes that
- // use them.
- // mFinalFrequency, mNumberOfHarmonics, mSignalPeriod, mAmplitudeAtZero,
- // mPhaseIncrement, and mPhaseWrap are initialized in
- // UpdateParametersIfNeeded() when mRecomputeParameters is set.
, mRecomputeParameters(true)
, mCustomLength(0)
{
@@ -132,41 +92,27 @@
case TYPE:
// Set the new type.
mType = static_cast(aParam);
- if (mType != OscillatorType::Custom) {
+ if (mType == OscillatorType::Sine) {
// Forget any previous custom data.
mCustomLength = 0;
mCustom = nullptr;
mPeriodicWave = nullptr;
mRecomputeParameters = true;
}
- // Update BLIT integrators with the new initial conditions.
switch (mType) {
case OscillatorType::Sine:
mPhase = 0.0;
break;
case OscillatorType::Square:
- mPhase = 0.0;
- // Initial integration condition is -0.5, because our
- // square has 50% duty cycle.
- mSquare = -0.5;
+ mPeriodicWave = WebCore::PeriodicWave::createSquare(mSource->SampleRate());
break;
case OscillatorType::Triangle:
- // Initial mPhase and related integration condition so the
- // triangle is in the middle of the first upward slope.
- // XXX actually do the maths and put the right number here.
- mPhase = (float)(M_PI / 2);
- mSquare = 0.5;
- mTriangle = 0.0;
+ mPeriodicWave = WebCore::PeriodicWave::createTriangle(mSource->SampleRate());
break;
case OscillatorType::Sawtooth:
- // Initial mPhase so the oscillator starts at the
- // middle of the ramp, per spec.
- mPhase = (float)(M_PI / 2);
- // mSaw = 0 when mPhase = pi/2.
- mSaw = 0.0;
+ mPeriodicWave = WebCore::PeriodicWave::createSawtooth(mSource->SampleRate());
break;
case OscillatorType::Custom:
- // Custom waveforms don't use BLIT.
break;
default:
NS_ERROR("Bad OscillatorNodeEngine type parameter.");
@@ -195,31 +141,28 @@
void IncrementPhase()
{
+ const float twoPiFloat = float(2 * M_PI);
mPhase += mPhaseIncrement;
- if (mPhase > mPhaseWrap) {
- mPhase -= mPhaseWrap;
+ if (mPhase > twoPiFloat) {
+ mPhase -= twoPiFloat;
+ } else if (mPhase < -twoPiFloat) {
+ mPhase += twoPiFloat;
}
}
- // Square and triangle are using a bipolar band-limited impulse train, saw is
- // using a normal band-limited impulse train.
- bool UsesBipolarBLIT() {
- return mType == OscillatorType::Square || mType == OscillatorType::Triangle;
- }
-
void UpdateParametersIfNeeded(StreamTime ticks, size_t count)
{
double frequency, detune;
- bool simpleFrequency = mFrequency.HasSimpleValue();
- bool simpleDetune = mDetune.HasSimpleValue();
-
// Shortcut if frequency-related AudioParam are not automated, and we
// already have computed the frequency information and related parameters.
- if (simpleFrequency && simpleDetune && !mRecomputeParameters) {
+ if (!ParametersMayNeedUpdate()) {
return;
}
+ bool simpleFrequency = mFrequency.HasSimpleValue();
+ bool simpleDetune = mDetune.HasSimpleValue();
+
if (simpleFrequency) {
frequency = mFrequency.GetValue();
} else {
@@ -232,21 +175,10 @@
}
mFinalFrequency = frequency * pow(2., detune / 1200.);
+ float signalPeriod = mSource->SampleRate() / mFinalFrequency;
mRecomputeParameters = false;
- // When using bipolar BLIT, we divide the signal period by two, because we
- // are using two BLIT out of phase.
- mSignalPeriod = UsesBipolarBLIT() ? 0.5 * mSource->SampleRate() / mFinalFrequency
- : mSource->SampleRate() / mFinalFrequency;
- // Wrap the phase accordingly:
- mPhaseWrap = UsesBipolarBLIT() || mType == OscillatorType::Sine ? 2 * M_PI
- : M_PI;
- // Even number of harmonics for bipolar blit, odd otherwise.
- mNumberOfHarmonics = UsesBipolarBLIT() ? 2 * floor(0.5 * mSignalPeriod)
- : 2 * floor(0.5 * mSignalPeriod) + 1;
- mPhaseIncrement = mType == OscillatorType::Sine ? 2 * M_PI / mSignalPeriod
- : M_PI / mSignalPeriod;
- mAmplitudeAtZero = mNumberOfHarmonics / mSignalPeriod;
+ mPhaseIncrement = 2 * M_PI / signalPeriod;
}
void FillBounds(float* output, StreamTime ticks,
@@ -271,39 +203,6 @@
}
}
- float BipolarBLIT()
- {
- float blit;
- float denom = sin(mPhase);
-
- if (fabs(denom) < std::numeric_limits::epsilon()) {
- if (mPhase < 0.1f || mPhase > 2 * M_PI - 0.1f) {
- blit = mAmplitudeAtZero;
- } else {
- blit = -mAmplitudeAtZero;
- }
- } else {
- blit = sin(mNumberOfHarmonics * mPhase);
- blit /= mSignalPeriod * denom;
- }
- return blit;
- }
-
- float UnipolarBLIT()
- {
- float blit;
- float denom = sin(mPhase);
-
- if (fabs(denom) <= std::numeric_limits::epsilon()) {
- blit = mAmplitudeAtZero;
- } else {
- blit = sin(mNumberOfHarmonics * mPhase);
- blit /= mSignalPeriod * denom;
- }
-
- return blit;
- }
-
void ComputeSine(float * aOutput, StreamTime ticks, uint32_t aStart, uint32_t aEnd)
{
for (uint32_t i = aStart; i < aEnd; ++i) {
@@ -315,54 +214,11 @@
}
}
- void ComputeSquare(float * aOutput, StreamTime ticks, uint32_t aStart, uint32_t aEnd)
- {
- for (uint32_t i = aStart; i < aEnd; ++i) {
- UpdateParametersIfNeeded(ticks, i);
- // Integration to get us a square. It turns out we can have a
- // pure integrator here.
- mSquare = mSquare * sLeak + BipolarBLIT();
- aOutput[i] = mSquare;
- // maybe we want to apply a gain, the wg has not decided yet
- aOutput[i] *= 1.5;
- IncrementPhase();
- }
- }
-
- void ComputeSawtooth(float * aOutput, StreamTime ticks, uint32_t aStart, uint32_t aEnd)
+ bool ParametersMayNeedUpdate()
{
- float dcoffset;
- for (uint32_t i = aStart; i < aEnd; ++i) {
- UpdateParametersIfNeeded(ticks, i);
- // DC offset so the Saw does not ramp up to infinity when integrating.
- dcoffset = mFinalFrequency / mSource->SampleRate();
- // Integrate and offset so we get mAmplitudeAtZero sawtooth. We have a
- // very low frequency component somewhere here, but I'm not sure where.
- mSaw = mSaw * sLeak + (UnipolarBLIT() - dcoffset);
- // reverse the saw so we are spec compliant
- aOutput[i] = -mSaw * 1.5;
-
- IncrementPhase();
- }
- }
-
- void ComputeTriangle(float * aOutput, StreamTime ticks, uint32_t aStart, uint32_t aEnd)
- {
- for (uint32_t i = aStart; i < aEnd; ++i) {
- UpdateParametersIfNeeded(ticks, i);
- // Integrate to get a square
- mSquare += BipolarBLIT();
- // Leaky integrate to get a triangle. We get too much dc offset if we don't
- // leaky integrate here.
- // C6 = k0 / period
- // (period is samplingrate / frequency, k0 = (PI/2)/(2*PI)) = 0.25
- float C6 = 0.25 / (mSource->SampleRate() / mFinalFrequency);
- mTriangle = mTriangle * sLeakTriangle + mSquare + C6;
- // DC Block, and scale back to [-1.0; 1.0]
- aOutput[i] = mDCBlocker.Process(mTriangle) / (mSignalPeriod/2) * 1.5;
-
- IncrementPhase();
- }
+ return !mDetune.HasSimpleValue() ||
+ !mFrequency.HasSimpleValue() ||
+ mRecomputeParameters;
}
void ComputeCustom(float* aOutput,
@@ -382,15 +238,24 @@
float tableInterpolationFactor;
// Phase increment at frequency of 1 Hz.
// mPhase runs [0,periodicWaveSize) here instead of [0,2*M_PI).
- float basePhaseIncrement =
- static_cast(periodicWaveSize) / mSource->SampleRate();
+ float basePhaseIncrement = mPeriodicWave->rateScale();
+
+ UpdateParametersIfNeeded(ticks, aStart);
+
+ bool parametersMayNeedUpdate = ParametersMayNeedUpdate();
+ mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
+ lowerWaveData,
+ higherWaveData,
+ tableInterpolationFactor);
for (uint32_t i = aStart; i < aEnd; ++i) {
- UpdateParametersIfNeeded(ticks, i);
- mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
- lowerWaveData,
- higherWaveData,
- tableInterpolationFactor);
+ if (parametersMayNeedUpdate) {
+ mPeriodicWave->waveDataForFundamentalFrequency(mFinalFrequency,
+ lowerWaveData,
+ higherWaveData,
+ tableInterpolationFactor);
+ UpdateParametersIfNeeded(ticks, i);
+ }
// Bilinear interpolation between adjacent samples in each table.
float floorPhase = floorf(mPhase);
uint32_t j1 = floorPhase;
@@ -457,14 +322,8 @@
ComputeSine(output, ticks, start, end);
break;
case OscillatorType::Square:
- ComputeSquare(output, ticks, start, end);
- break;
case OscillatorType::Triangle:
- ComputeTriangle(output, ticks, start, end);
- break;
case OscillatorType::Sawtooth:
- ComputeSawtooth(output, ticks, start, end);
- break;
case OscillatorType::Custom:
ComputeCustom(output, ticks, start, end);
break;
@@ -500,7 +359,6 @@
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
}
- DCBlocker mDCBlocker;
AudioNodeStream* mSource;
AudioNodeStream* mDestination;
StreamTime mStart;
@@ -510,14 +368,7 @@
OscillatorType mType;
float mPhase;
float mFinalFrequency;
- uint32_t mNumberOfHarmonics;
- float mSignalPeriod;
- float mAmplitudeAtZero;
float mPhaseIncrement;
- float mSquare;
- float mTriangle;
- float mSaw;
- float mPhaseWrap;
bool mRecomputeParameters;
nsRefPtr mCustom;
uint32_t mCustomLength;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/test/mochitest.ini thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/test/mochitest.ini
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/test/mochitest.ini 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/test/mochitest.ini 2015-01-09 12:36:58.000000000 +0000
@@ -126,6 +126,8 @@
[test_offlineDestinationChannelCountMore.html]
[test_oscillatorNode.html]
[test_oscillatorNode2.html]
+[test_oscillatorNodeNegativeFrequency.html]
+skip-if = (toolkit == 'gonk') || (toolkit == 'android')
[test_oscillatorNodePassThrough.html]
[test_oscillatorNodeStart.html]
[test_oscillatorTypeChange.html]
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html 1970-01-01 00:00:00.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html 2015-01-09 12:36:58.000000000 +0000
@@ -0,0 +1,50 @@
+
+
+
+ Test the OscillatorNode when the frequency is negative
+
+
+
+
+
+
+
+
+
+
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/GonkCameraImage.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/GonkCameraImage.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/GonkCameraImage.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/GonkCameraImage.cpp 2015-01-09 12:36:59.000000000 +0000
@@ -26,7 +26,7 @@
}
nsresult
-GonkCameraImage::GetBuffer(android::MediaBuffer** aBuffer)
+GonkCameraImage::GetMediaBuffer(android::MediaBuffer** aBuffer)
{
ReentrantMonitorAutoEnter mon(mMonitor);
@@ -50,7 +50,7 @@
}
nsresult
-GonkCameraImage::SetBuffer(android::MediaBuffer* aBuffer)
+GonkCameraImage::SetMediaBuffer(android::MediaBuffer* aBuffer)
{
ReentrantMonitorAutoEnter mon(mMonitor);
MOZ_ASSERT(!mMediaBuffer);
@@ -63,7 +63,7 @@
}
nsresult
-GonkCameraImage::ClearBuffer()
+GonkCameraImage::ClearMediaBuffer()
{
ReentrantMonitorAutoEnter mon(mMonitor);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/GonkCameraImage.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/GonkCameraImage.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/GonkCameraImage.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/GonkCameraImage.h 2015-01-09 12:36:59.000000000 +0000
@@ -24,8 +24,8 @@
* shared memory based on android binder (IMemory), the actual format in IMemory
* is platform dependent.
* This instance is created in MediaEngine when the preview image arrives.
- * The MediaBuffer is attached to the current created GonkCameraImage via SetBuffer().
- * After sending this image to MediaStreamGraph by AppendToTrack(), ClearBuffer()
+ * The MediaBuffer is attached to the current created GonkCameraImage via SetMediaBuffer().
+ * After sending this image to MediaStreamGraph by AppendToTrack(), ClearMediaBuffer()
* must be called to clear MediaBuffer to avoid MediaBuffer be kept in MSG thread.
* The reason to keep MediaBuffer be accessed from MSG thread is MediaBuffer is
* limited resource and it could cause frame rate jitter if MediaBuffer stay too
@@ -37,8 +37,8 @@
* Third is the MSG thread via NotifyPull, the image should have preview image
* only in NotifyPull.
*
- * Note: SetBuffer() and GetBuffer() should be called from the same thread. It
- * is forbidden to call GetBuffer() from other threads.
+ * Note: SetMediaBuffer() and GetMediaBuffer() should be called from the same
+ * thread. It is forbidden to call GetMediaBuffer() from other threads.
*/
class GonkCameraImage : public layers::GrallocImage
{
@@ -47,15 +47,15 @@
// The returned aBuffer has called aBuffer->add_ref() already, so it is caller's
// duty to release aBuffer. It should be called from the same thread which
- // called SetBuffer().
- nsresult GetBuffer(android::MediaBuffer** aBuffer);
+ // called SetMediaBuffer().
+ nsresult GetMediaBuffer(android::MediaBuffer** aBuffer);
- // Set MediaBuffer to image. It is caller's responsibility to call ClearBuffer()
+ // Set MediaBuffer to image. It is caller's responsibility to call ClearMediaBuffer()
// after the MediaBuffer is sent via MediaStreamGraph.
- nsresult SetBuffer(android::MediaBuffer* aBuffer);
+ nsresult SetMediaBuffer(android::MediaBuffer* aBuffer);
- // It should be called from the same thread which called SetBuffer().
- nsresult ClearBuffer();
+ // It should be called from the same thread which called SetMediaBuffer().
+ nsresult ClearMediaBuffer();
bool HasMediaBuffer();
@@ -65,7 +65,7 @@
// mMonitor protects mMediaBuffer and mThread.
ReentrantMonitor mMonitor;
android::MediaBuffer* mMediaBuffer;
- // Check if current thread is the same one which called SetBuffer().
+ // Check if current thread is the same one which called SetMediaBuffer().
// It doesn't need to hold reference count.
DebugOnly mThread;
};
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.cpp 2015-01-09 12:36:59.000000000 +0000
@@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MediaEngineGonkVideoSource.h"
+#undef LOG_TAG
#define LOG_TAG "MediaEngineGonkVideoSource"
#include
@@ -23,6 +24,7 @@
using namespace mozilla::gfx;
using namespace android;
+#undef LOG
#ifdef PR_LOGGING
extern PRLogModuleInfo* GetMediaManagerLog();
#define LOG(msg) PR_LOG(GetMediaManagerLog(), PR_LOG_DEBUG, msg)
@@ -800,7 +802,7 @@
// MediaEngineGonkVideoSource expects that GrallocImage is GonkCameraImage.
// See Bug 938034.
GonkCameraImage* cameraImage = static_cast(mImage.get());
- cameraImage->SetBuffer(aBuffer);
+ cameraImage->SetMediaBuffer(aBuffer);
} else {
LOG(("mImage is non-GrallocImage"));
}
@@ -821,7 +823,7 @@
GonkCameraImage* cameraImage = static_cast(mImage.get());
// Clear MediaBuffer immediately, it prevents MediaBuffer is kept in
// MediaStreamGraph thread.
- cameraImage->ClearBuffer();
+ cameraImage->ClearMediaBuffer();
}
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineGonkVideoSource.h 2015-01-09 12:36:59.000000000 +0000
@@ -97,7 +97,7 @@
// It adds aBuffer to current preview image and sends this image to MediaStreamDirectListener
// via AppendToTrack(). Due to MediaBuffer is limited resource, it will clear
- // image's MediaBuffer by calling GonkCameraImage::ClearBuffer() before leaving
+ // image's MediaBuffer by calling GonkCameraImage::ClearMediaBuffer() before leaving
// this function.
nsresult OnNewMediaBufferFrame(android::MediaBuffer* aBuffer);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineTabVideoSource.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineTabVideoSource.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/MediaEngineTabVideoSource.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/MediaEngineTabVideoSource.h 2015-01-09 12:36:59.000000000 +0000
@@ -18,27 +18,27 @@
NS_DECL_NSITIMERCALLBACK
MediaEngineTabVideoSource();
- virtual void GetName(nsAString_internal&);
- virtual void GetUUID(nsAString_internal&);
+ virtual void GetName(nsAString_internal&) MOZ_OVERRIDE;
+ virtual void GetUUID(nsAString_internal&) MOZ_OVERRIDE;
virtual nsresult Allocate(const VideoTrackConstraintsN &,
- const mozilla::MediaEnginePrefs&);
- virtual nsresult Deallocate();
- virtual nsresult Start(mozilla::SourceMediaStream*, mozilla::TrackID);
- virtual void SetDirectListeners(bool aHasDirectListeners) {};
+ const mozilla::MediaEnginePrefs&) MOZ_OVERRIDE;
+ virtual nsresult Deallocate() MOZ_OVERRIDE;
+ virtual nsresult Start(mozilla::SourceMediaStream*, mozilla::TrackID) MOZ_OVERRIDE;
+ virtual void SetDirectListeners(bool aHasDirectListeners) MOZ_OVERRIDE {};
virtual void NotifyPull(mozilla::MediaStreamGraph*, mozilla::SourceMediaStream*, mozilla::TrackID, mozilla::StreamTime) MOZ_OVERRIDE;
- virtual nsresult Stop(mozilla::SourceMediaStream*, mozilla::TrackID);
- virtual nsresult Config(bool, uint32_t, bool, uint32_t, bool, uint32_t, int32_t);
- virtual bool IsFake();
- virtual const MediaSourceType GetMediaSource() {
+ virtual nsresult Stop(mozilla::SourceMediaStream*, mozilla::TrackID) MOZ_OVERRIDE;
+ virtual nsresult Config(bool, uint32_t, bool, uint32_t, bool, uint32_t, int32_t) MOZ_OVERRIDE;
+ virtual bool IsFake() MOZ_OVERRIDE;
+ virtual const MediaSourceType GetMediaSource() MOZ_OVERRIDE {
return MediaSourceType::Browser;
}
virtual bool SatisfiesConstraintSets(
- const nsTArray& aConstraintSets)
+ const nsTArray& aConstraintSets) MOZ_OVERRIDE
{
return true;
}
- virtual nsresult TakePhoto(PhotoCallback* aCallback)
+ virtual nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE
{
return NS_ERROR_NOT_IMPLEMENTED;
}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webrtc/moz.build 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webrtc/moz.build 2015-01-09 12:36:59.000000000 +0000
@@ -60,6 +60,15 @@
include('/ipc/chromium/chromium-config.mozbuild')
+# Suppress some GCC/clang warnings being treated as errors:
+# - about attributes on forward declarations for types that are already
+# defined, which complains about important MOZ_EXPORT attributes for
+# android API types
+if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
+ CXXFLAGS += [
+ '-Wno-error=attributes'
+ ]
+
FINAL_LIBRARY = 'xul'
if CONFIG['OS_ARCH'] == 'WINNT':
DEFINES['NOMINMAX'] = True
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.h 2015-01-09 12:36:59.000000000 +0000
@@ -82,11 +82,11 @@
NS_IMETHOD SendAudioNative(int16_t* aData, uint32_t aDataLen) MOZ_OVERRIDE;
- virtual void Pause();
+ virtual void Pause() MOZ_OVERRIDE;
- virtual void Resume();
+ virtual void Resume() MOZ_OVERRIDE;
- virtual void Cancel();
+ virtual void Cancel() MOZ_OVERRIDE;
private:
SpeechSynthesisRequestChild* mActor;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webspeech/synth/nsSpeechTask.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webspeech/synth/nsSpeechTask.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/media/webspeech/synth/nsSpeechTask.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/media/webspeech/synth/nsSpeechTask.cpp 2015-01-09 12:36:59.000000000 +0000
@@ -68,7 +68,7 @@
}
}
- virtual void NotifyBlockingChanged(MediaStreamGraph* aGraph, Blocking aBlocked)
+ virtual void NotifyBlockingChanged(MediaStreamGraph* aGraph, Blocking aBlocked) MOZ_OVERRIDE
{
if (aBlocked == MediaStreamListener::UNBLOCKED && !mStarted) {
mStarted = true;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/DOMMMIError.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/DOMMMIError.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/DOMMMIError.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/DOMMMIError.cpp 1970-01-01 00:00:00.000000000 +0000
@@ -1,39 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/DOMMMIError.h"
-#include "mozilla/dom/DOMMMIErrorBinding.h"
-
-using namespace mozilla::dom;
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(DOMMMIError)
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(DOMMMIError, DOMError)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(DOMMMIError, DOMError)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMMMIError)
-NS_INTERFACE_MAP_END_INHERITING(DOMError)
-
-NS_IMPL_ADDREF_INHERITED(DOMMMIError, DOMError)
-NS_IMPL_RELEASE_INHERITED(DOMMMIError, DOMError)
-
-DOMMMIError::DOMMMIError(nsPIDOMWindow* aWindow, const nsAString& aName,
- const nsAString& aMessage, const nsAString& aServiceCode,
- const Nullable& aInfo)
- : DOMError(aWindow, aName, aMessage)
- , mServiceCode(aServiceCode)
- , mInfo(aInfo)
-{
-}
-
-JSObject*
-DOMMMIError::WrapObject(JSContext* aCx)
-{
- return DOMMMIErrorBinding::Wrap(aCx, this);
-}
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/DOMMMIError.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/DOMMMIError.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/DOMMMIError.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/DOMMMIError.h 1970-01-01 00:00:00.000000000 +0000
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_MmiError_h
-#define mozilla_dom_MmiError_h
-
-#include "mozilla/dom/DOMError.h"
-
-namespace mozilla {
-namespace dom {
-
-class DOMMMIError MOZ_FINAL : public DOMError
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMMMIError, DOMError)
-
- DOMMMIError(nsPIDOMWindow* aWindow, const nsAString& aName,
- const nsAString& aMessage, const nsAString& aServiceCode,
- const Nullable& aInfo);
-
- virtual JSObject*
- WrapObject(JSContext* aCx) MOZ_OVERRIDE;
-
- // WebIDL interface
-
- void
- GetServiceCode(nsString& aServiceCode) const
- {
- aServiceCode = mServiceCode;
- }
-
- Nullable
- GetAdditionalInformation() const
- {
- return mInfo;
- }
-
-private:
- ~DOMMMIError() {}
-
-private:
- nsString mServiceCode;
- Nullable mInfo;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_MmiError_h
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/ipc/MobileConnectionParent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/ipc/MobileConnectionParent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/ipc/MobileConnectionParent.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/ipc/MobileConnectionParent.h 2015-01-09 12:36:59.000000000 +0000
@@ -36,7 +36,7 @@
}
virtual void
- ActorDestroy(ActorDestroyReason why);
+ ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
virtual bool
RecvPMobileConnectionRequestConstructor(PMobileConnectionRequestParent* aActor,
@@ -152,7 +152,7 @@
}
virtual void
- ActorDestroy(ActorDestroyReason why);
+ ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
nsresult
SendReply(const MobileConnectionReply& aReply);
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/moz.build thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/moz.build
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobileconnection/moz.build 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobileconnection/moz.build 2015-01-09 12:36:59.000000000 +0000
@@ -7,7 +7,6 @@
MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
EXPORTS.mozilla.dom += [
- 'DOMMMIError.h',
'MobileCellInfo.h',
'MobileConnection.h',
'MobileConnectionArray.h',
@@ -34,7 +33,6 @@
UNIFIED_SOURCES += [
'Assertions.cpp',
- 'DOMMMIError.cpp',
'ipc/MobileConnectionChild.cpp',
'ipc/MobileConnectionIPCService.cpp',
'ipc/MobileConnectionParent.cpp',
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobilemessage/ipc/SmsParent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobilemessage/ipc/SmsParent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/mobilemessage/ipc/SmsParent.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/mobilemessage/ipc/SmsParent.h 2015-01-09 12:36:59.000000000 +0000
@@ -44,7 +44,7 @@
}
virtual void
- ActorDestroy(ActorDestroyReason why);
+ ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
virtual bool
RecvPSmsRequestConstructor(PSmsRequestParent* aActor,
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/network/Connection.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/network/Connection.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/network/Connection.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/network/Connection.h 2015-01-09 12:36:59.000000000 +0000
@@ -37,7 +37,7 @@
void Shutdown();
// For IObserver
- void Notify(const hal::NetworkInformation& aNetworkInfo);
+ void Notify(const hal::NetworkInformation& aNetworkInfo) MOZ_OVERRIDE;
// WebIDL
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/network/TCPSocketParent.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/network/TCPSocketParent.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/network/TCPSocketParent.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/network/TCPSocketParent.h 2015-01-09 12:36:59.000000000 +0000
@@ -52,7 +52,7 @@
TCPSocketParent() {}
virtual bool RecvOpen(const nsString& aHost, const uint16_t& aPort,
- const bool& useSSL, const nsString& aBinaryType);
+ const bool& useSSL, const nsString& aBinaryType) MOZ_OVERRIDE;
virtual bool RecvStartTLS() MOZ_OVERRIDE;
virtual bool RecvSuspend() MOZ_OVERRIDE;
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/notification/DesktopNotification.h thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/notification/DesktopNotification.h
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/notification/DesktopNotification.h 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/notification/DesktopNotification.h 2015-01-09 12:36:59.000000000 +0000
@@ -150,9 +150,9 @@
void Disconnect() { mNotification = nullptr; }
NS_IMETHODIMP
- Observe(nsISupports *aSubject,
- const char *aTopic,
- const char16_t *aData)
+ Observe(nsISupports* aSubject,
+ const char* aTopic,
+ const char16_t* aData) MOZ_OVERRIDE
{
// forward to parent
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/notification/Notification.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/notification/Notification.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/notification/Notification.cpp 2015-01-07 22:15:28.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/notification/Notification.cpp 2015-01-09 12:36:59.000000000 +0000
@@ -64,7 +64,7 @@
const nsAString& aIcon,
const nsAString& aData,
const nsAString& aBehavior,
- JSContext* aCx)
+ JSContext* aCx) MOZ_OVERRIDE
{
MOZ_ASSERT(!aID.IsEmpty());
@@ -99,7 +99,7 @@
return NS_OK;
}
- NS_IMETHOD Done(JSContext* aCx)
+ NS_IMETHOD Done(JSContext* aCx) MOZ_OVERRIDE
{
JSAutoCompartment ac(aCx, mGlobal);
JS::Rooted result(aCx, JS::ObjectValue(*mNotifications));
diff -Nru thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/plugins/base/nsJSNPRuntime.cpp thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/plugins/base/nsJSNPRuntime.cpp
--- thunderbird-trunk-37.0~a1~hg20150107r17323.222415/mozilla/dom/plugins/base/nsJSNPRuntime.cpp 2015-01-07 22:15:29.000000000 +0000
+++ thunderbird-trunk-37.0~a1~hg20150108r17327.222808/mozilla/dom/plugins/base/nsJSNPRuntime.cpp 2015-01-09 12:36:59.000000000 +0000
@@ -1750,7 +1750,7 @@
NPObject *npobj = (NPObject *)::JS_GetPrivate(obj);
if (npobj) {
if (sNPObjWrappers.ops) {
- PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_REMOVE);
+ PL_DHashTableRemove(&sNPObjWrappers, npobj);
}
}
@@ -1779,7 +1779,7 @@
JS::AutoSuppressGCAnalysis nogc;
NPObjWrapperHashEntry *entry = static_cast
- (PL_DHashTableOperate(&sNPObjWrappers, npobj, PL_DHASH_LOOKUP));
+ (PL_DHashTableLookup(&sNPObjWrappers, npobj));
MOZ_ASSERT(PL_DHASH_ENTRY_IS_BUSY(entry) && entry->mJSObj);
MOZ_ASSERT(entry->mJSObj == old);
entry->mJSObj = obj;
@@ -1832,7 +1832,7 @@
}
NPObjWrapperHashEntry *entry = static_cast