Bug 1237201 part 4 - Handle Vector OOM in ipc/. r=billm
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 14 Jan 2016 15:19:24 +0100
changeset 279978 13e1546239391ef5a00058e83a549b8364b911e0
parent 279977 2ebafa1c0eee604355b6acbc37270c668f6889f1
child 279979 b072874b9253c3ade313f8e47645eb9f7ba9b3ed
push id70281
push userjandemooij@gmail.com
push dateThu, 14 Jan 2016 14:18:23 +0000
treeherdermozilla-inbound@cdd2accc2d1a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1237201
milestone46.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 1237201 part 4 - Handle Vector OOM in ipc/. r=billm
ipc/glue/MessageChannel.cpp
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -221,17 +221,18 @@ public:
     CxxStackFrame(MessageChannel& that, Direction direction, const Message* msg)
       : mThat(that)
     {
         mThat.AssertWorkerThread();
 
         if (mThat.mCxxStackFrames.empty())
             mThat.EnteredCxxStack();
 
-        mThat.mCxxStackFrames.append(InterruptFrame(direction, msg));
+        if (!mThat.mCxxStackFrames.append(InterruptFrame(direction, msg)))
+            MOZ_CRASH();
 
         const InterruptFrame& frame = mThat.mCxxStackFrames.back();
 
         if (frame.IsInterruptIncall())
             mThat.EnteredCall();
 
         if (frame.IsOutgoingSync())
             mThat.EnteredSyncSend();
@@ -773,17 +774,18 @@ MessageChannel::ProcessPendingRequests()
 {
     // Loop until there aren't any more priority messages to process.
     for (;;) {
         mozilla::Vector<Message> toProcess;
 
         for (MessageQueue::iterator it = mPending.begin(); it != mPending.end(); ) {
             Message &msg = *it;
             if (!ShouldDeferMessage(msg)) {
-                toProcess.append(Move(msg));
+                if (!toProcess.append(Move(msg)))
+                    MOZ_CRASH();
                 it = mPending.erase(it);
                 continue;
             }
             it++;
         }
 
         if (toProcess.empty())
             break;