From bd8276dd081d32f76e27c56af29b375d82fcdf06 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 02:30:23 -0700 Subject: [PATCH 01/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/a5c433a2df05 Author: Cristian Rodriguez Desc: Merge pull request #10942 from crdlc/bug-892357-master Bug 892357 - Followup to bug 890454 - [Homescreen] The save-bookmark scr... ======== https://hg.mozilla.org/integration/gaia-central/rev/54cf0f6d18f5 Author: crdlc Desc: Bug 892357 - Followup to bug 890454 - [Homescreen] The save-bookmark screen does not work fine when Add to Home Screen button is pressed continuously --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index d98dcc1401c..1708c72e07d 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "d717e2e751a6bb1303499bde6be9dbd88b275e30", + "revision": "a5c433a2df05be7b80c6b95f657fb742adb2caa7", "repo_path": "/integration/gaia-central" } From b7470d2b8daf836368b61988fcba50321016115d Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 03:25:23 -0700 Subject: [PATCH 02/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/4839476d648c Author: Arthur Chen Desc: Merge pull request #10925 from masap/20130711 Bug 892434 - [WiFi] Fix Showing gone network r=arthurcc ======== https://hg.mozilla.org/integration/gaia-central/rev/18fb5d823e8b Author: masap Desc: Bug 892434 - [WiFi] Fix Showing gone network --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 1708c72e07d..5a036e5836f 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "a5c433a2df05be7b80c6b95f657fb742adb2caa7", + "revision": "4839476d648c5e990f290372e5ae59627de7603b", "repo_path": "/integration/gaia-central" } From 7e382a803e282121c25b107b7a8638297c601bda Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 03:45:23 -0700 Subject: [PATCH 03/26] Bumping gaia.json for 8 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/007f168bd8ec Author: Arthur Chen Desc: Merge pull request #10969 from crh0716/893693 Bug 893693 - Add removeEventListener funtion to IccHelper r=echen ======== https://hg.mozilla.org/integration/gaia-central/rev/b51cca845416 Author: crh0716 Desc: Bug 893693 - Add removeEventListener funtion to IccHelper ======== https://hg.mozilla.org/integration/gaia-central/rev/86dd4fe57bbc Author: Jan Jongboom Desc: Merge pull request #10920 from comoyo/fix_settings_b2gdesk Bug 796623 - Settings throw error in B2G desktop. r=arthurcc ======== https://hg.mozilla.org/integration/gaia-central/rev/e6434ee1a344 Author: Jan Jongboom Desc: Bug 796623 - Settings throw error in B2G desktop ======== https://hg.mozilla.org/integration/gaia-central/rev/ea4a47341f08 Author: George Desc: Merge pull request #10816 from cctuan/889757 Bug 889757 - [Dialer] When holding a call and selecting keypad, cannot hide keypad and input number ======== https://hg.mozilla.org/integration/gaia-central/rev/a2cbb3a6ed3d Author: cctuan Desc: Bug 889757 - [Dialer] When holding a call and selecting keypad, cannot hide keypad and input number ======== https://hg.mozilla.org/integration/gaia-central/rev/8306f751be94 Author: Francisco Borja Salguero Castellano Desc: Merge pull request #10771 from rwldrn/888150 Bug 888150 - [MMS][Regression] Header actions are not working properly. ======== https://hg.mozilla.org/integration/gaia-central/rev/ad7b307bc892 Author: Rick Waldron Desc: Bug 888150 - [MMS][Regression] Header actions are not working properly. - STR1 Fixed - STR2 Cannot Reproduce (https://www.dropbox.com/sh/3lr5a5kepnns8z1/rydxqmpucg) - STR3 Fixed - Fixes broken activity handling introduced here: https://github.com/mozilla-b2g/gaia/commit/8b41ee9a80c1d6b3613339e7388035d3fbcc575d#L2R227 includes tests. https://bugzilla.mozilla.org/show_bug.cgi?id=888150 Signed-off-by: Rick Waldron --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5a036e5836f..01cc471dbf7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "4839476d648c5e990f290372e5ae59627de7603b", + "revision": "007f168bd8ec7ff7452acfac86576b6ff67199cb", "repo_path": "/integration/gaia-central" } From 799e370aa3446e1b23ae70279ddd5bf66c717dc6 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 04:00:23 -0700 Subject: [PATCH 04/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/a9de5769866d Author: Arthur Chen Desc: Merge pull request #10909 from leob2g/Bug_890448_wrong_info_is_shown_when_receiving_second_call Bug 890448 - [Dialer] When receiving second call that has withheld number, shows contact information (not withheld number token) r=etienne, a=leo+ ======== https://hg.mozilla.org/integration/gaia-central/rev/e7a9586e0ec9 Author: sungwoo.yoon Desc: Bug 890448 - [Dialer] When receiving second call that has withheld number, shows contact information (not withheld number token) --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 01cc471dbf7..58bb8fe3121 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "007f168bd8ec7ff7452acfac86576b6ff67199cb", + "revision": "a9de5769866dcabd8205fcd5008cac4a52de687d", "repo_path": "/integration/gaia-central" } From 00d02f8e0f7800525d49721cf1ba078c8d672786 Mon Sep 17 00:00:00 2001 From: Gina Yeh Date: Mon, 15 Jul 2013 19:24:49 +0800 Subject: [PATCH 05/26] Bug 892862 - Patch 2: Bluetooth-related system messages cleanup, r=echou --- dom/messages/SystemMessagePermissionsChecker.jsm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/dom/messages/SystemMessagePermissionsChecker.jsm b/dom/messages/SystemMessagePermissionsChecker.jsm index 5d9243e65dd..1dcb2561abb 100644 --- a/dom/messages/SystemMessagePermissionsChecker.jsm +++ b/dom/messages/SystemMessagePermissionsChecker.jsm @@ -34,15 +34,6 @@ this.SystemMessagePermissionsTable = { "bluetooth-dialer-command": { "telephony": [] }, - "bluetooth-requestconfirmation": { - "bluetooth": [] - }, - "bluetooth-requestpasskey": { - "bluetooth": [] - }, - "bluetooth-requestpincode": { - "bluetooth": [] - }, "bluetooth-authorize": { "bluetooth": [] }, @@ -52,6 +43,9 @@ this.SystemMessagePermissionsTable = { "bluetooth-pairedstatuschanged": { "bluetooth": [] }, + "bluetooth-a2dp-status-changed": { + "bluetooth": [] + }, "bluetooth-hfp-status-changed": { "bluetooth": [] }, From ec0be1d68f2cf46a7ba2a0132660450a33167175 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 05:50:22 -0700 Subject: [PATCH 06/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/8d0f8afa3650 Author: Cristian Rodriguez Desc: Merge pull request #10966 from crdlc/bug-890811 Bug 890811 - SIM import needs to support canceling ======== https://hg.mozilla.org/integration/gaia-central/rev/068a73311596 Author: crdlc Desc: Bug 890811 - SIM import needs to support canceling --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 58bb8fe3121..6a59b80bb54 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "a9de5769866dcabd8205fcd5008cac4a52de687d", + "revision": "8d0f8afa365038dd77ada227541ef3323114a3bc", "repo_path": "/integration/gaia-central" } From 85bc6aeb9f4fddf4b05a22c3de251fa2cd7238ae Mon Sep 17 00:00:00 2001 From: Chia-hung Tai Date: Thu, 11 Jul 2013 10:03:47 +0800 Subject: [PATCH 07/26] Bug 890218 - [MMS] If reboot device while downloading MMS attachment, the message will be empty and will not be deleted anymore. r=gene --- dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js index bad424f36e8..9de371e10b7 100644 --- a/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js +++ b/dom/mobilemessage/src/gonk/MobileMessageDatabaseService.js @@ -780,6 +780,11 @@ MobileMessageDatabaseService.prototype = { if (DEBUG) { debug("MMS: part[" + i + "]: " + JSON.stringify(part)); } + // Sometimes the part is incomplete because the device reboots when + // downloading MMS. Don't need to expose this part to the content. + if (!part) { + continue; + } let partHeaders = part["headers"]; let partContent = part["content"]; From 65575bb64c8fc0e088f79895b4e4dc9a844dd013 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 15 Jul 2013 08:53:25 -0400 Subject: [PATCH 08/26] Bug 881142 - Part 1: Remove call state busy (idl). r=hsinyi, sr=jonas --- dom/telephony/nsIDOMTelephonyCall.idl | 3 +-- dom/telephony/nsITelephonyProvider.idl | 17 ++++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/dom/telephony/nsIDOMTelephonyCall.idl b/dom/telephony/nsIDOMTelephonyCall.idl index 14ab2c1f89a..3b6ccd3b5d3 100644 --- a/dom/telephony/nsIDOMTelephonyCall.idl +++ b/dom/telephony/nsIDOMTelephonyCall.idl @@ -8,7 +8,7 @@ interface nsIDOMEventListener; -[scriptable, builtinclass, uuid(22e44e8c-cb74-44f2-abe6-b37e9f42ea79)] +[scriptable, builtinclass, uuid(74d240f5-a379-4ac0-a085-a7f714189a27)] interface nsIDOMTelephonyCall : nsIDOMEventTarget { readonly attribute DOMString number; @@ -32,7 +32,6 @@ interface nsIDOMTelephonyCall : nsIDOMEventTarget [implicit_jscontext] attribute jsval ondialing; [implicit_jscontext] attribute jsval onalerting; - [implicit_jscontext] attribute jsval onbusy; [implicit_jscontext] attribute jsval onconnecting; [implicit_jscontext] attribute jsval onconnected; [implicit_jscontext] attribute jsval ondisconnecting; diff --git a/dom/telephony/nsITelephonyProvider.idl b/dom/telephony/nsITelephonyProvider.idl index ca94c1606b8..4917f7a34ce 100644 --- a/dom/telephony/nsITelephonyProvider.idl +++ b/dom/telephony/nsITelephonyProvider.idl @@ -83,15 +83,14 @@ interface nsITelephonyProvider : nsISupports const unsigned short CALL_STATE_UNKNOWN = 0; const unsigned short CALL_STATE_DIALING = 1; const unsigned short CALL_STATE_ALERTING = 2; - const unsigned short CALL_STATE_BUSY = 3; - const unsigned short CALL_STATE_CONNECTING = 4; - const unsigned short CALL_STATE_CONNECTED = 5; - const unsigned short CALL_STATE_HOLDING = 6; - const unsigned short CALL_STATE_HELD = 7; - const unsigned short CALL_STATE_RESUMING = 8; - const unsigned short CALL_STATE_DISCONNECTING = 9; - const unsigned short CALL_STATE_DISCONNECTED = 10; - const unsigned short CALL_STATE_INCOMING = 11; + const unsigned short CALL_STATE_CONNECTING = 3; + const unsigned short CALL_STATE_CONNECTED = 4; + const unsigned short CALL_STATE_HOLDING = 5; + const unsigned short CALL_STATE_HELD = 6; + const unsigned short CALL_STATE_RESUMING = 7; + const unsigned short CALL_STATE_DISCONNECTING = 8; + const unsigned short CALL_STATE_DISCONNECTED = 9; + const unsigned short CALL_STATE_INCOMING = 10; /** * Called when a content process registers receiving unsolicited messages from From 676c4988b302e87d901a4fe688713c9e5ee6159f Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 15 Jul 2013 08:53:47 -0400 Subject: [PATCH 09/26] Bug 881142 - Part 2: Remove call state busy (telephony dom). r=hsinyi, r=bent --- dom/telephony/TelephonyCall.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dom/telephony/TelephonyCall.cpp b/dom/telephony/TelephonyCall.cpp index 7b0275af9a6..d4785cb6b29 100644 --- a/dom/telephony/TelephonyCall.cpp +++ b/dom/telephony/TelephonyCall.cpp @@ -61,9 +61,6 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents) case nsITelephonyProvider::CALL_STATE_ALERTING: stateString.AssignLiteral("alerting"); break; - case nsITelephonyProvider::CALL_STATE_BUSY: - stateString.AssignLiteral("busy"); - break; case nsITelephonyProvider::CALL_STATE_CONNECTING: stateString.AssignLiteral("connecting"); break; @@ -269,7 +266,6 @@ TelephonyCall::Resume() NS_IMPL_EVENT_HANDLER(TelephonyCall, statechange) NS_IMPL_EVENT_HANDLER(TelephonyCall, dialing) NS_IMPL_EVENT_HANDLER(TelephonyCall, alerting) -NS_IMPL_EVENT_HANDLER(TelephonyCall, busy) NS_IMPL_EVENT_HANDLER(TelephonyCall, connecting) NS_IMPL_EVENT_HANDLER(TelephonyCall, connected) NS_IMPL_EVENT_HANDLER(TelephonyCall, disconnecting) From 7513aaacb22792fc1bb37328c1deb99b0d7ecc47 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 15 Jul 2013 08:54:07 -0400 Subject: [PATCH 10/26] Bug 881142 - Part 3: Remove call state busy (bluetooth dom). r=gyeh --- dom/bluetooth/BluetoothHfpManager.cpp | 4 ++-- dom/bluetooth/BluetoothHfpManager.h | 4 ++-- dom/bluetooth/BluetoothTelephonyListener.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dom/bluetooth/BluetoothHfpManager.cpp b/dom/bluetooth/BluetoothHfpManager.cpp index 4d6f3a06945..3fbc1d53596 100644 --- a/dom/bluetooth/BluetoothHfpManager.cpp +++ b/dom/bluetooth/BluetoothHfpManager.cpp @@ -1270,6 +1270,7 @@ BluetoothHfpManager::GetNumberOfCalls(uint16_t aState) void BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState, + const nsAString& aError, const nsAString& aNumber, const bool aIsOutgoing, bool aSend) @@ -1391,7 +1392,6 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex, case nsITelephonyProvider::CALL_STATE_DISCONNECTED: switch (prevCallState) { case nsITelephonyProvider::CALL_STATE_INCOMING: - case nsITelephonyProvider::CALL_STATE_BUSY: // Incoming call, no break sStopSendingRingFlag = true; case nsITelephonyProvider::CALL_STATE_DIALING: @@ -1424,7 +1424,7 @@ BluetoothHfpManager::HandleCallStateChanged(uint32_t aCallIndex, GetNumberOfCalls(nsITelephonyProvider::CALL_STATE_DISCONNECTED)) { // In order to let user hear busy tone via connected Bluetooth headset, // we postpone the timing of dropping SCO. - if (prevCallState != nsITelephonyProvider::CALL_STATE_BUSY) { + if (!(aError.Equals(NS_LITERAL_STRING("BusyError")))) { DisconnectSco(); } else { // Close Sco later since Dialer is still playing busy tone via HF. diff --git a/dom/bluetooth/BluetoothHfpManager.h b/dom/bluetooth/BluetoothHfpManager.h index 6e2f805854b..af623222d23 100644 --- a/dom/bluetooth/BluetoothHfpManager.h +++ b/dom/bluetooth/BluetoothHfpManager.h @@ -86,8 +86,8 @@ public: * @param aSend A boolean indicates whether we need to notify headset or not */ void HandleCallStateChanged(uint32_t aCallIndex, uint16_t aCallState, - const nsAString& aNumber, const bool aIsOutgoing, - bool aSend); + const nsAString& aError, const nsAString& aNumber, + const bool aIsOutgoing, bool aSend); bool IsConnected(); bool IsScoConnected(); diff --git a/dom/bluetooth/BluetoothTelephonyListener.cpp b/dom/bluetooth/BluetoothTelephonyListener.cpp index e84d577e8e3..b6f9f53b8d0 100644 --- a/dom/bluetooth/BluetoothTelephonyListener.cpp +++ b/dom/bluetooth/BluetoothTelephonyListener.cpp @@ -35,7 +35,7 @@ TelephonyListener::CallStateChanged(uint32_t aCallIndex, bool aIsEmergency) { BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber, + hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber, aIsOutgoing, true); return NS_OK; @@ -57,7 +57,7 @@ TelephonyListener::EnumerateCallState(uint32_t aCallIndex, bool* aResult) { BluetoothHfpManager* hfp = BluetoothHfpManager::Get(); - hfp->HandleCallStateChanged(aCallIndex, aCallState, aNumber, + hfp->HandleCallStateChanged(aCallIndex, aCallState, EmptyString(), aNumber, aIsOutgoing, false); *aResult = true; return NS_OK; @@ -77,7 +77,7 @@ TelephonyListener::NotifyError(int32_t aCallIndex, // via setting CALL_STATE_DISCONNECTED hfp->HandleCallStateChanged(aCallIndex, nsITelephonyProvider::CALL_STATE_DISCONNECTED, - EmptyString(), false, true); + aError, EmptyString(), false, true); NS_WARNING("Reset the call state due to call transition ends abnormally"); } From 2bd6d9d6a0ad55b6c52924dea6eaae3c32218b68 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 15 Jul 2013 08:54:22 -0400 Subject: [PATCH 11/26] Bug 881142 - Part 4: Remove call state busy (RIL). r=hsinyi --- dom/system/gonk/RadioInterfaceLayer.js | 2 -- dom/system/gonk/ril_consts.js | 1 - dom/system/gonk/ril_worker.js | 5 ----- 3 files changed, 8 deletions(-) diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 16d9bdaca00..ef6bec53a11 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -194,8 +194,6 @@ function convertRILCallState(state) { case RIL.CALL_STATE_INCOMING: case RIL.CALL_STATE_WAITING: return nsITelephonyProvider.CALL_STATE_INCOMING; - case RIL.CALL_STATE_BUSY: - return nsITelephonyProvider.CALL_STATE_BUSY; default: throw new Error("Unknown rilCallState: " + state); } diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index d77997f1dcb..cc006a3ce9c 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -442,7 +442,6 @@ this.CALL_STATE_DIALING = 2; this.CALL_STATE_ALERTING = 3; this.CALL_STATE_INCOMING = 4; this.CALL_STATE_WAITING = 5; -this.CALL_STATE_BUSY = 6; this.TOA_INTERNATIONAL = 0x91; this.TOA_UNKNOWN = 0x81; diff --git a/dom/system/gonk/ril_worker.js b/dom/system/gonk/ril_worker.js index 5cda64cadec..807a811853f 100644 --- a/dom/system/gonk/ril_worker.js +++ b/dom/system/gonk/ril_worker.js @@ -4690,11 +4690,6 @@ RIL[REQUEST_LAST_CALL_FAIL_CAUSE] = function REQUEST_LAST_CALL_FAIL_CAUSE(length case CALL_FAIL_NORMAL: this._handleDisconnectedCall(options); break; - case CALL_FAIL_BUSY: - options.state = CALL_STATE_BUSY; - this._handleChangedCallState(options); - this._handleDisconnectedCall(options); - break; default: options.rilMessageType = "callError"; options.errorMsg = RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[failCause]; From e287dcf8a5166f878de10a1b3de6567801f3f854 Mon Sep 17 00:00:00 2001 From: "Szu-Yu Chen [:aknow]" Date: Mon, 15 Jul 2013 08:54:38 -0400 Subject: [PATCH 12/26] Bug 881142 - Part 5: Modify test_outgoing_busy for removing call state busy. r=hsinyi --- dom/telephony/test/marionette/test_outgoing_busy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dom/telephony/test/marionette/test_outgoing_busy.js b/dom/telephony/test/marionette/test_outgoing_busy.js index 333110623ef..c27d081fd7c 100644 --- a/dom/telephony/test/marionette/test_outgoing_busy.js +++ b/dom/telephony/test/marionette/test_outgoing_busy.js @@ -92,10 +92,10 @@ function dial() { function busy() { log("The receiver is busy."); - outgoing.onbusy = function onbusy(event) { - log("Received 'busy' call event."); + outgoing.onerror = function onerror(event) { + log("Received 'error' call event."); is(outgoing, event.call); - is(outgoing.state, "busy"); + is(event.call.error.name, "BusyError"); runEmulatorCmd("gsm list", function(result) { log("Call list is now: " + result); @@ -103,6 +103,7 @@ function busy() { cleanUp(); }); }; + runEmulatorCmd("gsm busy " + number); }; From ef85bfba975cfdc337fb7b2330af6ac247ec7a2b Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Mon, 15 Jul 2013 08:54:53 -0400 Subject: [PATCH 13/26] Bug 890928 - Crash when creating object url in subworker. r=bent --- dom/workers/URL.cpp | 4 ++-- dom/workers/test/test_url.html | 18 ++++++++++++++++-- dom/workers/test/url_worker.js | 12 +++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/dom/workers/URL.cpp b/dom/workers/URL.cpp index c1220fbab2c..2bb0f2802c4 100644 --- a/dom/workers/URL.cpp +++ b/dom/workers/URL.cpp @@ -144,7 +144,7 @@ public: principal = doc->NodePrincipal(); } else { - MOZ_ASSERT(mWorkerPrivate->IsChromeWorker()); + MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker()); principal = mWorkerPrivate->GetPrincipal(); } @@ -199,7 +199,7 @@ public: principal = doc->NodePrincipal(); } else { - MOZ_ASSERT(mWorkerPrivate->IsChromeWorker()); + MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker()); principal = mWorkerPrivate->GetPrincipal(); } diff --git a/dom/workers/test/test_url.html b/dom/workers/test/test_url.html index 0ce5976c2a3..2916a094d55 100644 --- a/dom/workers/test/test_url.html +++ b/dom/workers/test/test_url.html @@ -21,7 +21,7 @@ is(event.target, worker); if (event.data.type == 'finish') { - SimpleTest.finish(); + runTest(); } else if (event.data.type == 'status') { ok(event.data.status, event.data.msg); } else if (event.data.type == 'url') { @@ -42,8 +42,22 @@ SimpleTest.finish(); }; - worker.postMessage(true); + var tests = [ + function() { worker.postMessage(0); }, + function() { worker.postMessage(4); } + ]; + function runTest() { + if (!tests.length) { + SimpleTest.finish(); + return; + } + + var test = tests.shift(); + test(); + } + + runTest(); SimpleTest.waitForExplicitFinish(); diff --git a/dom/workers/test/url_worker.js b/dom/workers/test/url_worker.js index 0c7c2d8b930..4d8c84fc610 100644 --- a/dom/workers/test/url_worker.js +++ b/dom/workers/test/url_worker.js @@ -1,4 +1,14 @@ -onmessage = function() { +onmessage = function(event) { + if (event.data != 0) { + var worker = new Worker('url_worker.js'); + worker.onmessage = function(event) { + postMessage(event.data); + } + + worker.postMessage(event.data - 1); + return; + } + status = false; try { if ((URL instanceof Object)) { From 39744d9386c314ed31f4f29a015b14fbc76a69bf Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 15 Jul 2013 08:55:13 -0400 Subject: [PATCH 14/26] Bug 893172 - Call ShutDownProcess in ContentParent::ActorDestroy. r=bent --- dom/ipc/ContentParent.cpp | 29 ++++++++++++++++++++++------- dom/ipc/ContentParent.h | 8 +++++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index eb598f19e3a..dca00799ba5 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -730,19 +730,28 @@ ContentParent::TransformPreallocatedIntoApp(const nsAString& aAppManifestURL, } void -ContentParent::ShutDownProcess() +ContentParent::ShutDownProcess(bool aFromActorDestroyed) { if (!mIsDestroyed) { + mIsDestroyed = true; + const InfallibleTArray& idbParents = ManagedPIndexedDBParent(); for (uint32_t i = 0; i < idbParents.Length(); ++i) { static_cast(idbParents[i])->Disconnect(); } - // Close() can only be called once. It kicks off the - // destruction sequence. - Close(); - mIsDestroyed = true; + if (aFromActorDestroyed) { + // If ActorDestroyed() is calling this method but mIsDestroyed was false, + // we're in an error state. + AsyncChannel* channel = GetIPCChannel(); + if (channel) { + channel->CloseWithError(); + } + } else { + // Close() can only be called once: It kicks off the destruction sequence. + Close(); + } } // NB: must MarkAsDead() here so that this isn't accidentally // returned from Get*() while in the midst of shutdown. @@ -948,6 +957,11 @@ ContentParent::ActorDestroy(ActorDestroyReason why) obs->NotifyObservers((nsIPropertyBag2*) props, "ipc:content-shutdown", nullptr); } + // If the child process was terminated due to a SIGKIL, ShutDownProcess + // might not have been called yet. We must call it to ensure that our + // channel is closed, etc. + ShutDownProcess(/* aForce = */ true); + MessageLoop::current()-> PostTask(FROM_HERE, NewRunnableFunction(DelayedDeleteSubprocess, mSubprocess)); @@ -1006,7 +1020,8 @@ ContentParent::NotifyTabDestroyed(PBrowserParent* aTab, if (ManagedPBrowserParent().Length() == 1) { MessageLoop::current()->PostTask( FROM_HERE, - NewRunnableMethod(this, &ContentParent::ShutDownProcess)); + NewRunnableMethod(this, &ContentParent::ShutDownProcess, + /* force */ false)); } } @@ -1464,7 +1479,7 @@ ContentParent::Observe(nsISupports* aSubject, const PRUnichar* aData) { if (!strcmp(aTopic, "xpcom-shutdown") && mSubprocess) { - ShutDownProcess(); + ShutDownProcess(/* force */ false); NS_ASSERTION(!mSubprocess, "Close should have nulled mSubprocess"); } diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h index abdaa21c3b7..844da4a974d 100644 --- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -242,8 +242,14 @@ private: * will return false and this ContentParent will not be returned * by the Get*() funtions. However, the shutdown sequence itself * may be asynchronous. + * + * If aFromActorDestroyed is true and this is the first call to + * ShutDownProcess, then we'll close our channel using CloseWithError() + * rather than vanilla Close(). CloseWithError() indicates to IPC that this + * is an abnormal shutdown (e.g. a crash); when the process shuts down + * cleanly, ShutDownProcess runs before ActorDestroyed. */ - void ShutDownProcess(); + void ShutDownProcess(bool aFromActorDestroyed); PCompositorParent* AllocPCompositorParent(mozilla::ipc::Transport* aTransport, From 36bb0607bae99aa04a9700a138a278d99eaf1bf9 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 07:40:25 -0700 Subject: [PATCH 15/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/ba45890684e4 Author: Dale Harvey Desc: Merge pull request #10945 from dominickuo/bug-889739 Bug 889739 - [gallery] Enable the done button after the picked image is. r=daleharvey ======== https://hg.mozilla.org/integration/gaia-central/rev/551d17f156a2 Author: Dominic Kuo Desc: Bug 889739 - [gallery] Enable the done button after the picked image is loaded --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 6a59b80bb54..7fc1e0d1667 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "8d0f8afa365038dd77ada227541ef3323114a3bc", + "revision": "ba45890684e496778c4910c6f32ca75fa72d9754", "repo_path": "/integration/gaia-central" } From 1d535e0072c23f5a70147ec2245e0b79725c75ba Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 08:50:22 -0700 Subject: [PATCH 16/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/3451c5dbd0bf Author: Kevin Grandon Desc: Merge pull request #10951 from KevinGrandon/bug_893188_fix_system_messages Bug 893188 - Update system message manager r=vingtetun ======== https://hg.mozilla.org/integration/gaia-central/rev/d5d6294ffcef Author: Kevin Grandon Desc: Bug 893188 - Update system message manager --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 7fc1e0d1667..c77f01ff0eb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "ba45890684e496778c4910c6f32ca75fa72d9754", + "revision": "3451c5dbd0bfa8a6dbf5ed8a64e9003cdd61bdcc", "repo_path": "/integration/gaia-central" } From 79aeb720522308b7e2f6a997a2bf4fdf60c3a681 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 09:00:23 -0700 Subject: [PATCH 17/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/c61d272d29ae Author: Kevin Grandon Desc: Merge pull request #10871 from KevinGrandon/bug_882346_add_date_time_mappings_for_now Bug 882346 - Add date time mappings for now r=vingtetun,lightsofapollo ======== https://hg.mozilla.org/integration/gaia-central/rev/8515ff8e847a Author: Kevin Grandon Desc: Bug 882346 - Add dom.experimental_forms pref --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c77f01ff0eb..e611e29d07b 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "3451c5dbd0bfa8a6dbf5ed8a64e9003cdd61bdcc", + "revision": "c61d272d29ae209d8289ea8605d4bfa253c27833", "repo_path": "/integration/gaia-central" } From f0e34ef29bc5a798eb88ad756f942eba49e6950e Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 09:55:22 -0700 Subject: [PATCH 18/26] Bumping gaia.json for 1 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/02b50e5b3ca8 Author: Corey Frang Desc: Bug 892480 - [SMS] Sending two phone numbers separed by space or enter should detect two phone numbers - r=arcturus * Shorten the greediness of the match to not accept as many numbers * Added a check to ensure that the character after the match is not a digit * Only allow space and tab as separators in phone numbers --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index e611e29d07b..5ca40332fca 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "c61d272d29ae209d8289ea8605d4bfa253c27833", + "revision": "02b50e5b3ca8d7a12bd64499c1bc56d83cd6fc78", "repo_path": "/integration/gaia-central" } From 9db8dcec18f47674ee39a63ceb66d6c17407189c Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 10:15:24 -0700 Subject: [PATCH 19/26] Bumping gaia.json for 1 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/77058600c39f Author: Corey Frang Desc: Bug 891908 - [MMS] Replacing an attachment with a large image should trigger resizing - r=schung * Ensure that image resizing is triggered whenever an image is added (even via replace) --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5ca40332fca..22c5231d38a 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "02b50e5b3ca8d7a12bd64499c1bc56d83cd6fc78", + "revision": "77058600c39f678e5527cce73c9799105eeea5a9", "repo_path": "/integration/gaia-central" } From af8004c69b89b64d736a280b2587dbdf7d488106 Mon Sep 17 00:00:00 2001 From: Gregor Wagner Date: Mon, 15 Jul 2013 10:16:33 -0700 Subject: [PATCH 20/26] Bug 892497 - [contacts] the upgrade path is error-prone. r=bent --- dom/contacts/ContactManager.js | 2 + dom/contacts/fallback/ContactDB.jsm | 616 ++++++++++--------- dom/contacts/fallback/ContactService.jsm | 6 +- dom/contacts/tests/test_contacts_basics.html | 4 +- 4 files changed, 343 insertions(+), 285 deletions(-) diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js index 7c79ef14515..cba2221aa5a 100644 --- a/dom/contacts/ContactManager.js +++ b/dom/contacts/ContactManager.js @@ -640,6 +640,8 @@ ContactManager.prototype = { case "Contact:Save:Return:KO": case "Contact:Remove:Return:KO": case "Contacts:Clear:Return:KO": + case "Contacts:GetRevision:Return:KO": + case "Contacts:Count:Return:KO": req = this.getRequest(msg.requestID); if (req) Services.DOMRequest.fireError(req.request, msg.errorMsg); diff --git a/dom/contacts/fallback/ContactDB.jsm b/dom/contacts/fallback/ContactDB.jsm index 034794c4107..f1d6b15558f 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -93,284 +93,8 @@ ContactDB.prototype = { _dispatcher: {}, upgradeSchema: function upgradeSchema(aTransaction, aDb, aOldVersion, aNewVersion) { - if (DEBUG) debug("upgrade schema from: " + aOldVersion + " to " + aNewVersion + " called!"); - let db = aDb; - let objectStore; - for (let currVersion = aOldVersion; currVersion < aNewVersion; currVersion++) { - if (currVersion == 0) { - /** - * Create the initial database schema. - * - * The schema of records stored is as follows: - * - * {id: "...", // UUID - * published: Date(...), // First published date. - * updated: Date(...), // Last updated date. - * properties: {...} // Object holding the ContactProperties - * } - */ - if (DEBUG) debug("create schema"); - objectStore = db.createObjectStore(STORE_NAME, {keyPath: "id"}); - - // Properties indexes - objectStore.createIndex("familyName", "properties.familyName", { multiEntry: true }); - objectStore.createIndex("givenName", "properties.givenName", { multiEntry: true }); - - objectStore.createIndex("familyNameLowerCase", "search.familyName", { multiEntry: true }); - objectStore.createIndex("givenNameLowerCase", "search.givenName", { multiEntry: true }); - objectStore.createIndex("telLowerCase", "search.tel", { multiEntry: true }); - objectStore.createIndex("emailLowerCase", "search.email", { multiEntry: true }); - } else if (currVersion == 1) { - if (DEBUG) debug("upgrade 1"); - - // Create a new scheme for the tel field. We move from an array of tel-numbers to an array of - // ContactTelephone. - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - // Delete old tel index. - if (objectStore.indexNames.contains("tel")) { - objectStore.deleteIndex("tel"); - } - - // Upgrade existing tel field in the DB. - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (DEBUG) debug("upgrade tel1: " + JSON.stringify(cursor.value)); - for (let number in cursor.value.properties.tel) { - cursor.value.properties.tel[number] = {number: number}; - } - cursor.update(cursor.value); - if (DEBUG) debug("upgrade tel2: " + JSON.stringify(cursor.value)); - cursor.continue(); - } - }; - - // Create new searchable indexes. - objectStore.createIndex("tel", "search.tel", { multiEntry: true }); - objectStore.createIndex("category", "properties.category", { multiEntry: true }); - } else if (currVersion == 2) { - if (DEBUG) debug("upgrade 2"); - // Create a new scheme for the email field. We move from an array of emailaddresses to an array of - // ContactEmail. - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - - // Delete old email index. - if (objectStore.indexNames.contains("email")) { - objectStore.deleteIndex("email"); - } - - // Upgrade existing email field in the DB. - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.email) { - if (DEBUG) debug("upgrade email1: " + JSON.stringify(cursor.value)); - cursor.value.properties.email = - cursor.value.properties.email.map(function(address) { return { address: address }; }); - cursor.update(cursor.value); - if (DEBUG) debug("upgrade email2: " + JSON.stringify(cursor.value)); - } - cursor.continue(); - } - }; - - // Create new searchable indexes. - objectStore.createIndex("email", "search.email", { multiEntry: true }); - } else if (currVersion == 3) { - if (DEBUG) debug("upgrade 3"); - - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - - // Upgrade existing impp field in the DB. - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.impp) { - if (DEBUG) debug("upgrade impp1: " + JSON.stringify(cursor.value)); - cursor.value.properties.impp = - cursor.value.properties.impp.map(function(value) { return { value: value }; }); - cursor.update(cursor.value); - if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); - } - cursor.continue(); - } - }; - // Upgrade existing url field in the DB. - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.url) { - if (DEBUG) debug("upgrade url1: " + JSON.stringify(cursor.value)); - cursor.value.properties.url = - cursor.value.properties.url.map(function(value) { return { value: value }; }); - cursor.update(cursor.value); - if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); - } - cursor.continue(); - } - }; - } else if (currVersion == 4) { - if (DEBUG) debug("Add international phone numbers upgrade"); - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.tel) { - if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); - cursor.value.properties.tel.forEach( - function(duple) { - let parsedNumber = PhoneNumberUtils.parse(duple.value.toString()); - if (parsedNumber) { - if (DEBUG) { - debug("InternationalFormat: " + parsedNumber.internationalFormat); - debug("InternationalNumber: " + parsedNumber.internationalNumber); - debug("NationalNumber: " + parsedNumber.nationalNumber); - debug("NationalFormat: " + parsedNumber.nationalFormat); - } - if (duple.value.toString() !== parsedNumber.internationalNumber) { - cursor.value.search.tel.push(parsedNumber.internationalNumber); - } - } else { - dump("Warning: No international number found for " + duple.value + "\n"); - } - } - ) - cursor.update(cursor.value); - } - if (DEBUG) debug("upgrade2 : " + JSON.stringify(cursor.value)); - cursor.continue(); - } - }; - } else if (currVersion == 5) { - if (DEBUG) debug("Add index for equals tel searches"); - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - - // Delete old tel index (not on the right field). - if (objectStore.indexNames.contains("tel")) { - objectStore.deleteIndex("tel"); - } - - // Create new index for "equals" searches - objectStore.createIndex("tel", "search.exactTel", { multiEntry: true }); - - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.tel) { - if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); - cursor.value.properties.tel.forEach( - function(duple) { - let number = duple.value.toString(); - let parsedNumber = PhoneNumberUtils.parse(number); - - cursor.value.search.exactTel = [number]; - if (parsedNumber && - parsedNumber.internationalNumber && - number !== parsedNumber.internationalNumber) { - cursor.value.search.exactTel.push(parsedNumber.internationalNumber); - } - } - ) - cursor.update(cursor.value); - } - if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); - cursor.continue(); - } - }; - } else if (currVersion == 6) { - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - let names = objectStore.indexNames; - let blackList = ["tel", "familyName", "givenName", "familyNameLowerCase", - "givenNameLowerCase", "telLowerCase", "category", "email", - "emailLowerCase"]; - for (var i = 0; i < names.length; i++) { - if (blackList.indexOf(names[i]) < 0) { - objectStore.deleteIndex(names[i]); - } - } - } else if (currVersion == 7) { - if (DEBUG) debug("Adding object store for cached searches"); - db.createObjectStore(SAVED_GETALL_STORE_NAME); - } else if (currVersion == 8) { - if (DEBUG) debug("Make exactTel only contain the value entered by the user"); - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.tel) { - cursor.value.search.exactTel = []; - cursor.value.properties.tel.forEach( - function(tel) { - let normalized = PhoneNumberUtils.normalize(tel.value.toString()); - cursor.value.search.exactTel.push(normalized); - } - ); - cursor.update(cursor.value); - } - cursor.continue(); - } - }; - } else if (currVersion == 9) { - // no-op, see https://bugzilla.mozilla.org/show_bug.cgi?id=883770#c16 - } else if (currVersion == 10) { - if (DEBUG) debug("Adding object store for database revision"); - db.createObjectStore(REVISION_STORE).put(0, REVISION_KEY); - } else if (currVersion == 11) { - if (DEBUG) debug("Add a telMatch index with national and international numbers"); - if (!objectStore) { - objectStore = aTransaction.objectStore(STORE_NAME); - } - if (!objectStore.indexNames.contains("telMatch")) { - objectStore.createIndex("telMatch", "search.parsedTel", {multiEntry: true}); - } - objectStore.openCursor().onsuccess = function(event) { - let cursor = event.target.result; - if (cursor) { - if (cursor.value.properties.tel) { - cursor.value.search.parsedTel = []; - cursor.value.properties.tel.forEach( - function(tel) { - let parsed = PhoneNumberUtils.parse(tel.value.toString()); - if (parsed) { - cursor.value.search.parsedTel.push(parsed.nationalNumber); - cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(parsed.nationalFormat)); - cursor.value.search.parsedTel.push(parsed.internationalNumber); - cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(parsed.internationalFormat)); - } - cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(tel.value.toString())); - } - ); - cursor.update(cursor.value); - } - cursor.continue(); - } - }; - } - - // Increment the DB revision on future schema changes as well - if (currVersion > 11) { - this.incrementRevision(aTransaction); - } - } - - // Add default contacts - if (aOldVersion == 0) { + function loadInitialContacts() { + // Add default contacts let jsm = {}; Cu.import("resource://gre/modules/FileUtils.jsm", jsm); Cu.import("resource://gre/modules/NetUtil.jsm", jsm); @@ -419,6 +143,334 @@ ContactDB.prototype = { objectStore.put(contact); } } + + if (DEBUG) debug("upgrade schema from: " + aOldVersion + " to " + aNewVersion + " called!"); + let db = aDb; + let objectStore; + + let steps = [ + function upgrade0to1() { + /** + * Create the initial database schema. + * + * The schema of records stored is as follows: + * + * {id: "...", // UUID + * published: Date(...), // First published date. + * updated: Date(...), // Last updated date. + * properties: {...} // Object holding the ContactProperties + * } + */ + if (DEBUG) debug("create schema"); + objectStore = db.createObjectStore(STORE_NAME, {keyPath: "id"}); + + // Properties indexes + objectStore.createIndex("familyName", "properties.familyName", { multiEntry: true }); + objectStore.createIndex("givenName", "properties.givenName", { multiEntry: true }); + + objectStore.createIndex("familyNameLowerCase", "search.familyName", { multiEntry: true }); + objectStore.createIndex("givenNameLowerCase", "search.givenName", { multiEntry: true }); + objectStore.createIndex("telLowerCase", "search.tel", { multiEntry: true }); + objectStore.createIndex("emailLowerCase", "search.email", { multiEntry: true }); + next(); + }, + function upgrade1to2() { + if (DEBUG) debug("upgrade 1"); + + // Create a new scheme for the tel field. We move from an array of tel-numbers to an array of + // ContactTelephone. + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + // Delete old tel index. + if (objectStore.indexNames.contains("tel")) { + objectStore.deleteIndex("tel"); + } + + // Upgrade existing tel field in the DB. + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (DEBUG) debug("upgrade tel1: " + JSON.stringify(cursor.value)); + for (let number in cursor.value.properties.tel) { + cursor.value.properties.tel[number] = {number: number}; + } + cursor.update(cursor.value); + if (DEBUG) debug("upgrade tel2: " + JSON.stringify(cursor.value)); + cursor.continue(); + } else { + next(); + } + }; + + // Create new searchable indexes. + objectStore.createIndex("tel", "search.tel", { multiEntry: true }); + objectStore.createIndex("category", "properties.category", { multiEntry: true }); + }, + function upgrade2to3() { + if (DEBUG) debug("upgrade 2"); + // Create a new scheme for the email field. We move from an array of emailaddresses to an array of + // ContactEmail. + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + + // Delete old email index. + if (objectStore.indexNames.contains("email")) { + objectStore.deleteIndex("email"); + } + + // Upgrade existing email field in the DB. + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.email) { + if (DEBUG) debug("upgrade email1: " + JSON.stringify(cursor.value)); + cursor.value.properties.email = + cursor.value.properties.email.map(function(address) { return { address: address }; }); + cursor.update(cursor.value); + if (DEBUG) debug("upgrade email2: " + JSON.stringify(cursor.value)); + } + cursor.continue(); + } else { + next(); + } + }; + + // Create new searchable indexes. + objectStore.createIndex("email", "search.email", { multiEntry: true }); + }, + function upgrade3to4() { + if (DEBUG) debug("upgrade 3"); + + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + + // Upgrade existing impp field in the DB. + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.impp) { + if (DEBUG) debug("upgrade impp1: " + JSON.stringify(cursor.value)); + cursor.value.properties.impp = + cursor.value.properties.impp.map(function(value) { return { value: value }; }); + cursor.update(cursor.value); + if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); + } + cursor.continue(); + } + }; + // Upgrade existing url field in the DB. + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.url) { + if (DEBUG) debug("upgrade url1: " + JSON.stringify(cursor.value)); + cursor.value.properties.url = + cursor.value.properties.url.map(function(value) { return { value: value }; }); + cursor.update(cursor.value); + if (DEBUG) debug("upgrade impp2: " + JSON.stringify(cursor.value)); + } + cursor.continue(); + } else { + next(); + } + }; + }, + function upgrade4to5() { + if (DEBUG) debug("Add international phone numbers upgrade"); + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.tel) { + if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); + cursor.value.properties.tel.forEach( + function(duple) { + let parsedNumber = PhoneNumberUtils.parse(duple.value.toString()); + if (parsedNumber) { + if (DEBUG) { + debug("InternationalFormat: " + parsedNumber.internationalFormat); + debug("InternationalNumber: " + parsedNumber.internationalNumber); + debug("NationalNumber: " + parsedNumber.nationalNumber); + debug("NationalFormat: " + parsedNumber.nationalFormat); + } + if (duple.value.toString() !== parsedNumber.internationalNumber) { + cursor.value.search.tel.push(parsedNumber.internationalNumber); + } + } else { + dump("Warning: No international number found for " + duple.value + "\n"); + } + } + ) + cursor.update(cursor.value); + } + if (DEBUG) debug("upgrade2 : " + JSON.stringify(cursor.value)); + cursor.continue(); + } else { + next(); + } + }; + }, + function upgrade5to6() { + if (DEBUG) debug("Add index for equals tel searches"); + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + + // Delete old tel index (not on the right field). + if (objectStore.indexNames.contains("tel")) { + objectStore.deleteIndex("tel"); + } + + // Create new index for "equals" searches + objectStore.createIndex("tel", "search.exactTel", { multiEntry: true }); + + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.tel) { + if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); + cursor.value.properties.tel.forEach( + function(duple) { + let number = duple.value.toString(); + let parsedNumber = PhoneNumberUtils.parse(number); + + cursor.value.search.exactTel = [number]; + if (parsedNumber && + parsedNumber.internationalNumber && + number !== parsedNumber.internationalNumber) { + cursor.value.search.exactTel.push(parsedNumber.internationalNumber); + } + } + ) + cursor.update(cursor.value); + } + if (DEBUG) debug("upgrade : " + JSON.stringify(cursor.value)); + cursor.continue(); + } else { + next(); + } + }; + }, + function upgrade6to7() { + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + let names = objectStore.indexNames; + let blackList = ["tel", "familyName", "givenName", "familyNameLowerCase", + "givenNameLowerCase", "telLowerCase", "category", "email", + "emailLowerCase"]; + for (var i = 0; i < names.length; i++) { + if (blackList.indexOf(names[i]) < 0) { + objectStore.deleteIndex(names[i]); + } + } + next(); + }, + function upgrade7to8() { + if (DEBUG) debug("Adding object store for cached searches"); + db.createObjectStore(SAVED_GETALL_STORE_NAME); + next(); + }, + function upgrade8to9() { + if (DEBUG) debug("Make exactTel only contain the value entered by the user"); + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.tel) { + cursor.value.search.exactTel = []; + cursor.value.properties.tel.forEach( + function(tel) { + let normalized = PhoneNumberUtils.normalize(tel.value.toString()); + cursor.value.search.exactTel.push(normalized); + } + ); + cursor.update(cursor.value); + } + cursor.continue(); + } else { + next(); + } + }; + }, + function upgrade9to10() { + // no-op, see https://bugzilla.mozilla.org/show_bug.cgi?id=883770#c16 + next(); + }, + function upgrade10to11() { + if (DEBUG) debug("Adding object store for database revision"); + db.createObjectStore(REVISION_STORE).put(0, REVISION_KEY); + next(); + }, + function upgrade11to12() { + if (DEBUG) debug("Add a telMatch index with national and international numbers"); + if (!objectStore) { + objectStore = aTransaction.objectStore(STORE_NAME); + } + if (!objectStore.indexNames.contains("telMatch")) { + objectStore.createIndex("telMatch", "search.parsedTel", {multiEntry: true}); + } + objectStore.openCursor().onsuccess = function(event) { + let cursor = event.target.result; + if (cursor) { + if (cursor.value.properties.tel) { + cursor.value.search.parsedTel = []; + cursor.value.properties.tel.forEach( + function(tel) { + let parsed = PhoneNumberUtils.parse(tel.value.toString()); + if (parsed) { + cursor.value.search.parsedTel.push(parsed.nationalNumber); + cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(parsed.nationalFormat)); + cursor.value.search.parsedTel.push(parsed.internationalNumber); + cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(parsed.internationalFormat)); + } + cursor.value.search.parsedTel.push(PhoneNumberUtils.normalize(tel.value.toString())); + } + ); + cursor.update(cursor.value); + } + cursor.continue(); + } else { + next(); + } + }; + } + ]; + + let index = aOldVersion; + let outer = this; + function next() { + if (index == aNewVersion) { + if (aOldVersion === 0) { + loadInitialContacts(); + } + outer.incrementRevision(aTransaction); + return; + } + try { + var i = index++; + if (DEBUG) debug("Upgrade step: " + i + "\n"); + steps[i](); + } catch(ex) { + dump("Caught exception" + ex); + aTransaction.abort(); + return; + } + }; + if (aNewVersion > steps.length) { + dump("Contacts DB upgrade error!"); + aTransaction.abort(); + } + next(); }, makeImport: function makeImport(aContact) { @@ -739,22 +791,22 @@ ContactDB.prototype = { }.bind(this), aFailureCb); }, - getRevision: function CDB_getRevision(aSuccessCb) { + getRevision: function CDB_getRevision(aSuccessCb, aErrorCb) { if (DEBUG) debug("getRevision"); this.newTxn("readonly", REVISION_STORE, function (txn, store) { store.get(REVISION_KEY).onsuccess = function (e) { aSuccessCb(e.target.result); }; - }); + },null, aErrorCb); }, - getCount: function CDB_getCount(aSuccessCb) { + getCount: function CDB_getCount(aSuccessCb, aErrorCb) { if (DEBUG) debug("getCount"); this.newTxn("readonly", STORE_NAME, function (txn, store) { store.count().onsuccess = function (e) { aSuccessCb(e.target.result); }; - }); + }, null, aErrorCb); }, /* diff --git a/dom/contacts/fallback/ContactService.jsm b/dom/contacts/fallback/ContactService.jsm index 9bd5bc4dfb5..a4a04741a34 100644 --- a/dom/contacts/fallback/ContactService.jsm +++ b/dom/contacts/fallback/ContactService.jsm @@ -205,7 +205,8 @@ let ContactService = { requestID: msg.requestID, revision: revision }); - } + }, + function(aErrorMsg) { mm.sendAsyncMessage("Contacts:GetRevision:Return:KO", { requestID: msg.requestID, errorMsg: aErrorMsg }); }.bind(this) ); break; case "Contacts:GetCount": @@ -218,7 +219,8 @@ let ContactService = { requestID: msg.requestID, count: count }); - } + }, + function(aErrorMsg) { mm.sendAsyncMessage("Contacts:Count:Return:KO", { requestID: msg.requestID, errorMsg: aErrorMsg }); }.bind(this) ); break; case "Contacts:RegisterForMessages": diff --git a/dom/contacts/tests/test_contacts_basics.html b/dom/contacts/tests/test_contacts_basics.html index 8d617dd47ed..8d2afb1f9cb 100644 --- a/dom/contacts/tests/test_contacts_basics.html +++ b/dom/contacts/tests/test_contacts_basics.html @@ -257,10 +257,12 @@ ok(mozContacts, "mozContacts exists"); ok("mozContact" in window, "mozContact exists"); var steps = [ function() { - mozContacts.getRevision().onsuccess = function(e) { + req = mozContacts.getRevision(); + req.onsuccess = function(e) { initialRev = e.target.result; next(); }; + req.onerror = onFailure; }, function () { ok(true, "Deleting database"); From cf98902d13f0b65015fe627a414fba88a303438a Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 15 Jul 2013 13:19:41 -0400 Subject: [PATCH 21/26] Backed out changeset d8a89848224b (bug 890928) for B2G mochitest-9 failures. --- dom/workers/URL.cpp | 4 ++-- dom/workers/test/test_url.html | 18 ++---------------- dom/workers/test/url_worker.js | 12 +----------- 3 files changed, 5 insertions(+), 29 deletions(-) diff --git a/dom/workers/URL.cpp b/dom/workers/URL.cpp index 2bb0f2802c4..c1220fbab2c 100644 --- a/dom/workers/URL.cpp +++ b/dom/workers/URL.cpp @@ -144,7 +144,7 @@ public: principal = doc->NodePrincipal(); } else { - MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker()); + MOZ_ASSERT(mWorkerPrivate->IsChromeWorker()); principal = mWorkerPrivate->GetPrincipal(); } @@ -199,7 +199,7 @@ public: principal = doc->NodePrincipal(); } else { - MOZ_ASSERT_IF(!mWorkerPrivate->GetParent(), mWorkerPrivate->IsChromeWorker()); + MOZ_ASSERT(mWorkerPrivate->IsChromeWorker()); principal = mWorkerPrivate->GetPrincipal(); } diff --git a/dom/workers/test/test_url.html b/dom/workers/test/test_url.html index 2916a094d55..0ce5976c2a3 100644 --- a/dom/workers/test/test_url.html +++ b/dom/workers/test/test_url.html @@ -21,7 +21,7 @@ is(event.target, worker); if (event.data.type == 'finish') { - runTest(); + SimpleTest.finish(); } else if (event.data.type == 'status') { ok(event.data.status, event.data.msg); } else if (event.data.type == 'url') { @@ -42,22 +42,8 @@ SimpleTest.finish(); }; - var tests = [ - function() { worker.postMessage(0); }, - function() { worker.postMessage(4); } - ]; + worker.postMessage(true); - function runTest() { - if (!tests.length) { - SimpleTest.finish(); - return; - } - - var test = tests.shift(); - test(); - } - - runTest(); SimpleTest.waitForExplicitFinish(); diff --git a/dom/workers/test/url_worker.js b/dom/workers/test/url_worker.js index 4d8c84fc610..0c7c2d8b930 100644 --- a/dom/workers/test/url_worker.js +++ b/dom/workers/test/url_worker.js @@ -1,14 +1,4 @@ -onmessage = function(event) { - if (event.data != 0) { - var worker = new Worker('url_worker.js'); - worker.onmessage = function(event) { - postMessage(event.data); - } - - worker.postMessage(event.data - 1); - return; - } - +onmessage = function() { status = false; try { if ((URL instanceof Object)) { From 7496b7dfb0de92096181270f7639329397f1bac6 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 10:30:22 -0700 Subject: [PATCH 22/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/686f7e5027bd Author: Kevin Grandon Desc: Merge pull request #10930 from eeejay/lockscreen-elastic-fix Bug 892649 - Make sure elastic is never played when screen reader is enabled r=kgrandon ======== https://hg.mozilla.org/integration/gaia-central/rev/024a08abc7cd Author: Eitan Isaacson Desc: Bug 892649 - Make sure elastic is never played when screen reader is enabled. --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 22c5231d38a..2f0606937c7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "77058600c39f678e5527cce73c9799105eeea5a9", + "revision": "686f7e5027bdb74fb70bfc31bfadbe7fe317397c", "repo_path": "/integration/gaia-central" } From dbb5225f80cb46850beff60adcf1688f35a991b1 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 11:35:23 -0700 Subject: [PATCH 23/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/e44b13b6a7b0 Author: Rudy Lu Desc: Merge pull request #10939 from RudyLu/homescreen/4x5grid_onWVGA_support Bug 881149 - hdpi/xhdpi resolution layout for Homescreen app. r=crdlc. ======== https://hg.mozilla.org/integration/gaia-central/rev/5dbcf6c990dd Author: Rudy Lu Desc: Bug 881149 - hdpi/xhdpi resolution layout for Homescreen app 1. adjust to show 4 x 5 grid on WVGA. 2. modify the scale ratio of app icon according to window.devicePixelRatio. ============== 1. To address review comment, for reset the hidden of the 17th icon 2. Add 1.5x graphics (not complete, some assets are still missing) --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 2f0606937c7..631333040e7 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "686f7e5027bdb74fb70bfc31bfadbe7fe317397c", + "revision": "e44b13b6a7b0196b80aa792ea73055b6da803c4b", "repo_path": "/integration/gaia-central" } From 053ea1dfb859f0ca96c2723a4e88de8fd2e19cf4 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 12:30:23 -0700 Subject: [PATCH 24/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/9a8405332100 Author: Jonathan Griffin Desc: Merge pull request #10988 from jonallengriffin/disablegridtest Bug 892658 - Disable grid_test.js in TBPL for very frequent orange, a=te... ======== https://hg.mozilla.org/integration/gaia-central/rev/56e5813a8ab9 Author: Jonathan Griffin Desc: Bug 892658 - Disable grid_test.js in TBPL for very frequent orange, a=test-only --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 631333040e7..5ef51a5eb96 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "e44b13b6a7b0196b80aa792ea73055b6da803c4b", + "revision": "9a8405332100cc0e4223058978a5cc444baa5120", "repo_path": "/integration/gaia-central" } From d216182ac4fcb6ce4be65c3c6479e94c91925f24 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 12:55:23 -0700 Subject: [PATCH 25/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/d266560b990b Author: Jonathan Griffin Desc: Merge pull request #10990 from jonallengriffin/disablebusytime Bug 893248 - Disable busytime_test.js for near perma-orange in TBPL, a=t... ======== https://hg.mozilla.org/integration/gaia-central/rev/f42afb0f2a73 Author: Jonathan Griffin Desc: Bug 893248 - Disable busytime_test.js for near perma-orange in TBPL, a=test-only --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 5ef51a5eb96..028d15167e5 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "9a8405332100cc0e4223058978a5cc444baa5120", + "revision": "d266560b990b5c4fe6055c30873b97f7f75765f0", "repo_path": "/integration/gaia-central" } From 8770e81f8249a99ad2f38e1b572bdd239dd753e1 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Mon, 15 Jul 2013 13:15:23 -0700 Subject: [PATCH 26/26] Bumping gaia.json for 2 gaia-central revision(s) ======== https://hg.mozilla.org/integration/gaia-central/rev/846f8e708936 Author: Gareth Aye Desc: Merge pull request #10983 from gaye/bug-889396 Bug 889396 - Sync button went away r=lightsofapollo ======== https://hg.mozilla.org/integration/gaia-central/rev/87f21415dc13 Author: gaye Desc: Bug 889396 - Sync button went away --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 028d15167e5..674dd45c45f 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "d266560b990b5c4fe6055c30873b97f7f75765f0", + "revision": "846f8e7089361d42e1362ab591561f94d3bd31e9", "repo_path": "/integration/gaia-central" }