Bug 1167423 - patch 10 - Handle return values of FallibleTArray functions in MobileMessage, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Mon, 25 May 2015 12:50:15 +0100
changeset 245471 0fd1df73aa8bb0d5f7a94f68b1a19640ff655674
parent 245470 cfe431411b3dca836348491291a412a807cd844c
child 245472 c1f1c3ef81762046a0645b6254d8be554a6b0144
push id28806
push userphilringnalda@gmail.com
push dateTue, 26 May 2015 02:10:16 +0000
treeherdermozilla-central@4362d9251296 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1167423
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1167423 - patch 10 - Handle return values of FallibleTArray functions in MobileMessage, r=smaug
dom/mobilemessage/MobileMessageManager.cpp
--- a/dom/mobilemessage/MobileMessageManager.cpp
+++ b/dom/mobilemessage/MobileMessageManager.cpp
@@ -594,23 +594,27 @@ MobileMessageManager::DispatchTrustedDel
     init.mBubbles = false;
     init.mCancelable = false;
     DeletedMessageInfo* info =
       static_cast<DeletedMessageInfo*>(deletedInfo.get());
 
     uint32_t msgIdLength = info->GetData().deletedMessageIds().Length();
     if (msgIdLength) {
       Sequence<int32_t>& deletedMsgIds = init.mDeletedMessageIds.SetValue();
-      deletedMsgIds.AppendElements(info->GetData().deletedMessageIds());
+      if (!deletedMsgIds.AppendElements(info->GetData().deletedMessageIds())) {
+        return NS_ERROR_OUT_OF_MEMORY;
+      }
     }
 
     uint32_t threadIdLength = info->GetData().deletedThreadIds().Length();
     if (threadIdLength) {
       Sequence<uint64_t>& deletedThreadIds = init.mDeletedThreadIds.SetValue();
-      deletedThreadIds.AppendElements(info->GetData().deletedThreadIds());
+      if (!deletedThreadIds.AppendElements(info->GetData().deletedThreadIds())) {
+        return NS_ERROR_OUT_OF_MEMORY;
+      }
     }
 
     nsRefPtr<MozMessageDeletedEvent> event =
       MozMessageDeletedEvent::Constructor(this, DELETED_EVENT_NAME, init);
     return DispatchTrustedEvent(event);
   }
 
   NS_ERROR("Got a 'deleted' topic without a valid message!");