Remove unused run-to-completion feature in IPDL (bug 876989, r=cjones).
authorDavid Anderson <danderson@mozilla.com>
Wed, 31 Jul 2013 10:59:22 -0700
changeset 148157 e2069ef0e3341dc5284cb45b53c8b21dc451c342
parent 148156 4574bf8e1e869a016c39385013d7821211c49460
child 148158 ade6bee5d94f1ca75e03c35d98ad0fde1c55989f
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs876989
milestone24.0a2
Remove unused run-to-completion feature in IPDL (bug 876989, r=cjones).
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
ipc/glue/ProtocolUtils.h
ipc/glue/RPCChannel.cpp
ipc/glue/RPCChannel.h
ipc/glue/WindowsMessageLoop.cpp
ipc/ipdl/ipdl/lower.py
ipc/ipdl/test/cxx/Makefile.in
ipc/ipdl/test/cxx/PTestBlockChild.ipdl
ipc/ipdl/test/cxx/TestBlockChild.cpp
ipc/ipdl/test/cxx/TestBlockChild.h
ipc/ipdl/test/cxx/ipdl.mk
ipc/testshell/TestShellParent.cpp
js/ipc/ContextWrapperParent.h
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -900,18 +900,16 @@ ContentParent::ActorDestroy(ActorDestroy
     RecvRemoveGeolocationListener();
 
     mConsoleService = nullptr;
 
     nsCOMPtr<nsIThreadInternal>
         threadInt(do_QueryInterface(NS_GetCurrentThread()));
     if (threadInt)
         threadInt->RemoveObserver(this);
-    if (mRunToCompletionDepth)
-        mRunToCompletionDepth = 0;
 
     MarkAsDead();
 
     if (obs) {
         nsRefPtr<nsHashPropertyBag> props = new nsHashPropertyBag();
         props->Init();
 
         props->SetPropertyAsUint64(NS_LITERAL_STRING("childID"), mChildID);
@@ -1034,18 +1032,16 @@ ContentParent::ContentParent(mozIApplica
                              bool aIsForBrowser,
                              bool aIsForPreallocated,
                              ChildPrivileges aOSPrivileges,
                              ProcessPriority aInitialPriority /* = PROCESS_PRIORITY_FOREGROUND */)
     : mSubprocess(nullptr)
     , mOSPrivileges(aOSPrivileges)
     , mChildID(gContentChildID++)
     , mGeolocationWatchID(-1)
-    , mRunToCompletionDepth(0)
-    , mShouldCallUnblockChild(false)
     , mForceKillTask(nullptr)
     , mNumDestroyingTabs(0)
     , mIsAlive(true)
     , mIsDestroyed(false)
     , mSendPermissionUpdates(false)
     , mIsForBrowser(aIsForBrowser)
 {
     // No more than one of !!aApp, aIsForBrowser, and aIsForPreallocated should
@@ -2049,42 +2045,16 @@ ContentParent::RecvPSpeechSynthesisConst
 {
 #ifdef MOZ_WEBSPEECH
     return true;
 #else
     return false;
 #endif
 }
 
-void
-ContentParent::ReportChildAlreadyBlocked()
-{
-    if (!mRunToCompletionDepth) {
-#ifdef DEBUG
-        printf("Running to completion...\n");
-#endif
-        mRunToCompletionDepth = 1;
-        mShouldCallUnblockChild = false;
-    }
-}
-    
-bool
-ContentParent::RequestRunToCompletion()
-{
-    if (!mRunToCompletionDepth &&
-        BlockChild()) {
-#ifdef DEBUG
-        printf("Running to completion...\n");
-#endif
-        mRunToCompletionDepth = 1;
-        mShouldCallUnblockChild = true;
-    }
-    return !!mRunToCompletionDepth;
-}
-
 bool
 ContentParent::RecvStartVisitedQuery(const URIParams& aURI)
 {
     nsCOMPtr<nsIURI> newURI = DeserializeURI(aURI);
     if (!newURI) {
         return false;
     }
     nsCOMPtr<IHistory> history = services::GetHistoryService();
@@ -2243,38 +2213,24 @@ ContentParent::OnDispatchedEvent(nsIThre
 }
 
 /* void onProcessNextEvent (in nsIThreadInternal thread, in boolean mayWait, in unsigned long recursionDepth); */
 NS_IMETHODIMP
 ContentParent::OnProcessNextEvent(nsIThreadInternal *thread,
                                   bool mayWait,
                                   uint32_t recursionDepth)
 {
-    if (mRunToCompletionDepth)
-        ++mRunToCompletionDepth;
-
     return NS_OK;
 }
 
 /* void afterProcessNextEvent (in nsIThreadInternal thread, in unsigned long recursionDepth); */
 NS_IMETHODIMP
 ContentParent::AfterProcessNextEvent(nsIThreadInternal *thread,
                                      uint32_t recursionDepth)
 {
-    if (mRunToCompletionDepth &&
-        !--mRunToCompletionDepth) {
-#ifdef DEBUG
-            printf("... ran to completion.\n");
-#endif
-            if (mShouldCallUnblockChild) {
-                mShouldCallUnblockChild = false;
-                UnblockChild();
-            }
-    }
-
     return NS_OK;
 }
 
 bool
 ContentParent::RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
                                          const nsString& aText, const bool& aTextClickable,
                                          const nsString& aCookie, const nsString& aName,
                                          const nsString& aBidi, const nsString& aLang)
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -408,18 +408,16 @@ private:
 
     virtual void ProcessingError(Result what) MOZ_OVERRIDE;
 
     GeckoChildProcessHost* mSubprocess;
     base::ChildPrivileges mOSPrivileges;
 
     uint64_t mChildID;
     int32_t mGeolocationWatchID;
-    int mRunToCompletionDepth;
-    bool mShouldCallUnblockChild;
 
     // This is a cache of all of the memory reporters
     // registered in the child process.  To update this, one
     // can broadcast the topic "child-memory-reporter-request" using
     // the nsIObserverService.
     nsCOMArray<nsIMemoryReporter> mMemoryReporters;
 
     nsString mAppManifestURL;
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -24,20 +24,18 @@
 namespace {
 // XXX the max message ID is actually kuint32max now ... when this
 // changed, the assumptions of the special message IDs changed in that
 // they're not carving out messages from likely-unallocated space, but
 // rather carving out messages from the end of space allocated to
 // protocol 0.  Oops!  We can get away with this until protocol 0
 // starts approaching its 65,536th message.
 enum {
-    CHANNEL_OPENED_MESSAGE_TYPE = kuint16max - 7,
-    SHMEM_DESTROYED_MESSAGE_TYPE = kuint16max - 6,
-    UNBLOCK_CHILD_MESSAGE_TYPE = kuint16max - 5,
-    BLOCK_CHILD_MESSAGE_TYPE   = kuint16max - 4,
+    CHANNEL_OPENED_MESSAGE_TYPE = kuint16max - 5,
+    SHMEM_DESTROYED_MESSAGE_TYPE = kuint16max - 4,
     SHMEM_CREATED_MESSAGE_TYPE = kuint16max - 3,
     GOODBYE_MESSAGE_TYPE       = kuint16max - 2
 
     // kuint16max - 1 is used by ipc_channel.h.
 };
 }
 
 namespace mozilla {
--- a/ipc/glue/RPCChannel.cpp
+++ b/ipc/glue/RPCChannel.cpp
@@ -23,53 +23,26 @@ using mozilla::MonitorAutoUnlock;
 template<>
 struct RunnableMethodTraits<mozilla::ipc::RPCChannel>
 {
     static void RetainCallee(mozilla::ipc::RPCChannel* obj) { }
     static void ReleaseCallee(mozilla::ipc::RPCChannel* obj) { }
 };
 
 
-namespace
-{
-
-// Async (from the sending side's perspective)
-class BlockChildMessage : public IPC::Message
-{
-public:
-    enum { ID = BLOCK_CHILD_MESSAGE_TYPE };
-    BlockChildMessage() :
-        Message(MSG_ROUTING_NONE, ID, IPC::Message::PRIORITY_NORMAL)
-    { }
-};
-
-// Async
-class UnblockChildMessage : public IPC::Message
-{
-public:
-    enum { ID = UNBLOCK_CHILD_MESSAGE_TYPE };
-    UnblockChildMessage() :
-        Message(MSG_ROUTING_NONE, ID, IPC::Message::PRIORITY_NORMAL)
-    { }
-};
-
-} // namespace <anon>
-
-
 namespace mozilla {
 namespace ipc {
 
 RPCChannel::RPCChannel(RPCListener* aListener)
   : SyncChannel(aListener),
     mPending(),
     mStack(),
     mOutOfTurnReplies(),
     mDeferred(),
     mRemoteStackDepthGuess(0),
-    mBlockedOnParent(false),
     mSawRPCOutMsg(false)
 {
     MOZ_COUNT_CTOR(RPCChannel);
 
     mDequeueOneTask = new RefCountedTask(NewRunnableMethod(
                                                  this,
                                                  &RPCChannel::OnMaybeDequeueOne));
 }
@@ -498,123 +471,16 @@ RPCChannel::DispatchIncall(const Message
 
     {
         MonitorAutoLock lock(*mMonitor);
         if (ChannelConnected == mChannelState)
             mLink->SendMessage(reply);
     }
 }
 
-bool
-RPCChannel::BlockChild()
-{
-    AssertWorkerThread();
-
-    if (mChild)
-        NS_RUNTIMEABORT("child tried to block parent");
-
-    MonitorAutoLock lock(*mMonitor);
-    SendSpecialMessage(new BlockChildMessage());
-    return true;
-}
-
-bool
-RPCChannel::UnblockChild()
-{
-    AssertWorkerThread();
-
-    if (mChild)
-        NS_RUNTIMEABORT("child tried to unblock parent");
-
-    MonitorAutoLock lock(*mMonitor);
-    SendSpecialMessage(new UnblockChildMessage());
-    return true;
-}
-
-bool
-RPCChannel::OnSpecialMessage(uint16_t id, const Message& msg)
-{
-    AssertWorkerThread();
-
-    switch (id) {
-    case BLOCK_CHILD_MESSAGE_TYPE:
-        BlockOnParent();
-        return true;
-
-    case UNBLOCK_CHILD_MESSAGE_TYPE:
-        UnblockFromParent();
-        return true;
-
-    default:
-        return SyncChannel::OnSpecialMessage(id, msg);
-    }
-}
-
-void
-RPCChannel::BlockOnParent()
-{
-    AssertWorkerThread();
-
-    if (!mChild)
-        NS_RUNTIMEABORT("child tried to block parent");
-
-    MonitorAutoLock lock(*mMonitor);
-
-    if (mBlockedOnParent || AwaitingSyncReply() || 0 < StackDepth())
-        NS_RUNTIMEABORT("attempt to block child when it's already blocked");
-
-    mBlockedOnParent = true;
-    do {
-        // XXX this dispatch loop shares some similarities with the
-        // one in Call(), but the logic is simpler and different
-        // enough IMHO to warrant its own dispatch loop
-        while (Connected() && mPending.empty() && mBlockedOnParent) {
-            WaitForNotify();
-        }
-
-        if (!Connected()) {
-            mBlockedOnParent = false;
-            ReportConnectionError("RPCChannel");
-            break;
-        }
-
-        if (!mPending.empty()) {
-            Message recvd = mPending.front();
-            mPending.pop_front();
-
-            MonitorAutoUnlock unlock(*mMonitor);
-
-            CxxStackFrame f(*this, IN_MESSAGE, &recvd);
-            if (recvd.is_rpc()) {
-                // stack depth must be 0 here
-                Incall(recvd, 0);
-            }
-            else if (recvd.is_sync()) {
-                SyncChannel::OnDispatchMessage(recvd);
-            }
-            else {
-                AsyncChannel::OnDispatchMessage(recvd);
-            }
-        }
-    } while (mBlockedOnParent);
-
-    EnqueuePendingMessages();
-}
-
-void
-RPCChannel::UnblockFromParent()
-{
-    AssertWorkerThread();
-
-    if (!mChild)
-        NS_RUNTIMEABORT("child tried to block parent");
-    MonitorAutoLock lock(*mMonitor);
-    mBlockedOnParent = false;
-}
-
 void
 RPCChannel::ExitedCxxStack()
 {
     Listener()->OnExitedCxxStack();
     if (mSawRPCOutMsg) {
         MonitorAutoLock lock(*mMonitor);
         // see long comment in OnMaybeDequeueOne()
         EnqueuePendingMessages();
@@ -706,17 +572,17 @@ RPCChannel::OnMessageReceivedFromLink(co
         // the queue was the same message type and routed to the same
         // destination.  Replace it with the newer message.
         MOZ_ASSERT(mPending.back().compress());
         mPending.pop_back();
     }
 
     mPending.push_back(msg);
 
-    if (0 == StackDepth() && !mBlockedOnParent) {
+    if (0 == StackDepth()) {
         // the worker thread might be idle, make sure it wakes up
         if (!compressMessage) {
             // If we compressed away the previous message, we'll reuse
             // its pending task.
             mWorkerLoop->PostTask(FROM_HERE, new DequeueTask(mDequeueOneTask));
         }
     }
     else if (!AwaitingSyncReply())
--- a/ipc/glue/RPCChannel.h
+++ b/ipc/glue/RPCChannel.h
@@ -91,47 +91,21 @@ public:
     // Make an RPC to the other side of the channel
     bool Call(Message* msg, Message* reply);
 
     // RPCChannel overrides these so that the async and sync messages
     // can be counted against mStackFrames
     virtual bool Send(Message* msg) MOZ_OVERRIDE;
     virtual bool Send(Message* msg, Message* reply) MOZ_OVERRIDE;
 
-    // Asynchronously, send the child a message that puts it in such a
-    // state that it can't send messages to the parent unless the
-    // parent sends a message to it first.  The child stays in this
-    // state until the parent calls |UnblockChild()|.
-    //
-    // It is an error to
-    //  - call this on the child side of the channel.
-    //  - nest |BlockChild()| calls
-    //  - call this when the child is already blocked on a sync or RPC
-    //    in-/out- message/call
-    //
-    // Return true iff successful.
-    bool BlockChild();
-
-    // Asynchronously undo |BlockChild()|.
-    //
-    // It is an error to
-    //  - call this on the child side of the channel
-    //  - call this without a matching |BlockChild()|
-    //
-    // Return true iff successful.
-    bool UnblockChild();
-
     // Return true iff this has code on the C++ stack.
     bool IsOnCxxStack() const {
         return !mCxxStackFrames.empty();
     }
 
-    virtual bool OnSpecialMessage(uint16_t id, const Message& msg) MOZ_OVERRIDE;
-
-
     /**
      * If there is a pending RPC message, process all pending messages.
      *
      * @note This method is used on Windows when we detect that an outbound
      * OLE RPC call is being made to unblock the parent.
      */
     void FlushPendingRPCQueue();
 
@@ -180,19 +154,16 @@ private:
      *
      * Only called from the worker thread.
      */
     size_t RemoteViewOfStackDepth(size_t stackDepth) const;
 
     void Incall(const Message& call, size_t stackDepth);
     void DispatchIncall(const Message& call);
 
-    void BlockOnParent();
-    void UnblockFromParent();
-
     // This helper class managed RPCChannel.mCxxStackDepth on behalf
     // of RPCChannel.  When the stack depth is incremented from zero
     // to non-zero, it invokes an RPCChannel callback, and similarly
     // for when the depth goes from non-zero to zero;
     void EnteredCxxStack()
     {
         Listener()->OnEnteredCxxStack();
     }
@@ -386,19 +357,16 @@ private:
     // |mPending|.
     //
     // One nice aspect of this race detection is that it is symmetric;
     // if one side detects a race, then the other side must also 
     // detect the same race.
     //
     size_t mRemoteStackDepthGuess;
 
-    // True iff the parent has put us in a |BlockChild()| state.
-    bool mBlockedOnParent;
-
     // Approximation of Sync/RPCChannel-code frames on the C++ stack.
     // It can only be interpreted as the implication
     //
     //  !mCxxStackFrames.empty() => RPCChannel code on C++ stack
     //
     // This member is only accessed on the worker thread, and so is
     // not protected by mMonitor.  It is managed exclusively by the
     // helper |class CxxStackFrame|.
--- a/ipc/glue/WindowsMessageLoop.cpp
+++ b/ipc/glue/WindowsMessageLoop.cpp
@@ -818,17 +818,17 @@ SyncChannel::WaitForNotify()
   return WaitResponse(timedout);
 }
 
 bool
 RPCChannel::WaitForNotify()
 {
   mMonitor->AssertCurrentThreadOwns();
 
-  if (!StackDepth() && !mBlockedOnParent) {
+  if (!StackDepth()) {
     // There is currently no way to recover from this condition.
     NS_RUNTIMEABORT("StackDepth() is 0 in call to RPCChannel::WaitForNotify!");
   }
 
   // Initialize global objects used in deferred messaging.
   Init();
 
   NS_ASSERTION(mTopFrame && mTopFrame->mRPC,
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -3186,32 +3186,16 @@ class _GenerateProtocolActorCode(ipdl.as
                     args=[ ExprCall(otherpidvar), dumpvar, seqvar ])),
                 CppDirective('else'),
                 StmtReturn.FALSE,
                 CppDirective('endif')
             ])
             self.cls.addstmts([ otherpid, Whitespace.NL,
                                 getdump, Whitespace.NL ])
 
-        if (ptype.isToplevel() and self.side is 'parent'
-            and ptype.talksRpc()):
-            # offer BlockChild() and UnblockChild().
-            # See ipc/glue/RPCChannel.h
-            blockchild = MethodDefn(MethodDecl(
-                'BlockChild', ret=Type.BOOL))
-            blockchild.addstmt(StmtReturn(ExprCall(
-                ExprSelect(p.channelVar(), '.', 'BlockChild'))))
-
-            unblockchild = MethodDefn(MethodDecl(
-                'UnblockChild', ret=Type.BOOL))
-            unblockchild.addstmt(StmtReturn(ExprCall(
-                ExprSelect(p.channelVar(), '.', 'UnblockChild'))))
-
-            self.cls.addstmts([ blockchild, unblockchild, Whitespace.NL ])
-
         ## private methods
         self.cls.addstmt(Label.PRIVATE)
 
         ## FatalError()       
         msgparam = ExprVar('aMsg')
         msgvar = ExprVar('formattedMessage')
         actorname = _actorName(p.name, self.side)
         fatalerror = MethodDefn(MethodDecl(
--- a/ipc/ipdl/test/cxx/Makefile.in
+++ b/ipc/ipdl/test/cxx/Makefile.in
@@ -11,17 +11,16 @@ include $(DEPTH)/config/autoconf.mk
 
 LIBRARY_NAME = $(MODULE)_s
 LIBXUL_LIBRARY = 1
 FORCE_STATIC_LIB = 1
 EXPORT_LIBRARY = 1
 
 IPDLTESTS = \
   TestActorPunning \
-  TestBlockChild \
   TestBridgeMain \
   TestCrashCleanup \
   TestDataStructures \
   TestDesc \
   TestFailedCtor \
   TestHangs \
   TestJSON \
   TestLatency \
deleted file mode 100644
--- a/ipc/ipdl/test/cxx/PTestBlockChild.ipdl
+++ /dev/null
@@ -1,51 +0,0 @@
-namespace mozilla {
-namespace _ipdltest {
-
-rpc protocol PTestBlockChild {
-both:
-    rpc StackFrame();
-
-child:
-    async Poke1();
-    async Poke2();
-    async LastPoke();
-    async __delete__();
-
-parent:
-    async P1();
-    async P2();
-    async Done();
-
-state START:
-    // here we |BlockChild()| in the C++
-    send Poke1 goto CHILD_BLOCKED;
-
-state CHILD_BLOCKED:
-    call StackFrame goto CHILD_BLOCKED_RPC;
-
-state CHILD_BLOCKED_RPC:
-    answer StackFrame goto CHILD_BLOCKED_RPC_POKE;
-
-state CHILD_BLOCKED_RPC_POKE:
-    send Poke2 goto CHILD_STILL_BLOCKED;
-
-    // RPC stack frame gone.  child should still be blocked
-
-state CHILD_STILL_BLOCKED:
-    send LastPoke goto CHILD_FLUSH_QUEUE;
-
-    // here we |UnblockChild()| in the C++
-
-state CHILD_FLUSH_QUEUE:
-    recv P1 goto CHILD_FLUSH_QUEUE_P2;
-state CHILD_FLUSH_QUEUE_P2:
-    recv P2 goto CHILD_FLUSH_QUEUE_DONE;
-state CHILD_FLUSH_QUEUE_DONE:
-    recv Done goto DONE;
-
-state DONE:
-    send __delete__;
-};
-
-} // namespace _ipdltest
-} // namespace mozilla
deleted file mode 100644
--- a/ipc/ipdl/test/cxx/TestBlockChild.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-#include "TestBlockChild.h"
-
-#include "IPDLUnitTests.h"      // fail etc.
-
-template<>
-struct RunnableMethodTraits<mozilla::_ipdltest::TestBlockChildChild>
-{
-    typedef mozilla::_ipdltest::TestBlockChildChild T;
-    static void RetainCallee(T* obj) { }
-    static void ReleaseCallee(T* obj) { }
-};
-
-
-namespace mozilla {
-namespace _ipdltest {
-
-//-----------------------------------------------------------------------------
-// parent
-
-void
-TestBlockChildParent::Main()
-{
-    BlockChildInLowerFrame();
-
-    if (!SendPoke1())
-        fail("couldn't poke the child");
-
-    if (!CallStackFrame())
-        fail("couldn't poke the child");
-
-    if (!SendLastPoke())
-        fail("couldn't poke the child");
-
-    if (!UnblockChild())
-        fail("can't UnblockChild()!");
-    mChildBlocked = false;
-}
-
-void
-TestBlockChildParent::BlockChildInLowerFrame()
-{
-    if (!BlockChild())
-        fail("can't BlockChild()!");
-    // child should be blocked and stay blocked after this returns
-    mChildBlocked = true;
-}
-
-bool
-TestBlockChildParent::AnswerStackFrame()
-{
-    if (!SendPoke2())
-        fail("couldn't poke the child");
-    return true;
-}
-
-bool
-TestBlockChildParent::RecvP1()
-{
-    if (mChildBlocked)
-        fail("child shouldn't been able to slip this past the blockade!");
-    mGotP1 = true;
-    return true;
-}
-
-bool
-TestBlockChildParent::RecvP2()
-{
-    if (mChildBlocked)
-        fail("child shouldn't been able to slip this past the blockade!");
-    mGotP2 = true;
-    return true;
-}
-
-bool
-TestBlockChildParent::RecvDone()
-{
-    if (mChildBlocked)
-        fail("child shouldn't been able to slip this past the blockade!");
-
-    // XXX IPDL transition checking makes this redundant, but never
-    // hurts to double-check, especially if we eventually turn off
-    // state checking in OPT builds
-    if (!mGotP1)
-        fail("should have received P1!");
-    if (!mGotP2)
-        fail("should have received P2!");
-
-    Close();
-
-    return true;
-}
-
-
-//-----------------------------------------------------------------------------
-// child
-
-bool
-TestBlockChildChild::RecvPoke1()
-{
-    MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableMethod(this, &TestBlockChildChild::OnPoke1));
-    return true;
-}
-
-bool
-TestBlockChildChild::AnswerStackFrame()
-{
-    return CallStackFrame();
-}
-
-bool
-TestBlockChildChild::RecvPoke2()
-{
-    MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableMethod(this, &TestBlockChildChild::OnPoke2));
-    return true;
-}
-
-bool
-TestBlockChildChild::RecvLastPoke()
-{
-    MessageLoop::current()->PostTask(
-        FROM_HERE, NewRunnableMethod(this, &TestBlockChildChild::OnLastPoke));
-    return true;
-}
-
-void
-TestBlockChildChild::OnPoke1()
-{
-    if (!SendP1())
-        fail("couldn't send P1");
-}
-
-void
-TestBlockChildChild::OnPoke2()
-{
-    if (!SendP2())
-        fail("couldn't send P2");
-}
-
-void
-TestBlockChildChild::OnLastPoke()
-{
-    if (!SendDone())
-        fail("couldn't send Done");
-}
-
-} // namespace _ipdltest
-} // namespace mozilla
deleted file mode 100644
--- a/ipc/ipdl/test/cxx/TestBlockChild.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef mozilla__ipdltest_TestBlockChild_h
-#define mozilla__ipdltest_TestBlockChild_h 1
-
-#include "mozilla/_ipdltest/IPDLUnitTests.h"
-
-#include "mozilla/_ipdltest/PTestBlockChildParent.h"
-#include "mozilla/_ipdltest/PTestBlockChildChild.h"
-
-namespace mozilla {
-namespace _ipdltest {
-
-
-class TestBlockChildParent :
-    public PTestBlockChildParent
-{
-public:
-    TestBlockChildParent() : mChildBlocked(false),
-                             mGotP1(false),
-                             mGotP2(false)
-    { }
-    virtual ~TestBlockChildParent() { }
-
-    static bool RunTestInProcesses() { return true; }
-    static bool RunTestInThreads() { return true; }
-
-    void Main();
-
-protected:
-    virtual bool AnswerStackFrame() MOZ_OVERRIDE;
-
-    virtual bool RecvP1() MOZ_OVERRIDE;
-
-    virtual bool RecvP2() MOZ_OVERRIDE;
-
-    virtual bool RecvDone() MOZ_OVERRIDE;
-
-    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
-    {
-        if (NormalShutdown != why)
-            fail("unexpected destruction!");  
-        passed("ok");
-        QuitParent();
-    }
-
-private:
-    void BlockChildInLowerFrame();
-
-    bool mChildBlocked;
-    bool mGotP1;
-    bool mGotP2;
-    bool mGotP3;
-};
-
-
-class TestBlockChildChild :
-    public PTestBlockChildChild
-{
-public:
-    TestBlockChildChild() { }
-    virtual ~TestBlockChildChild() { }
-
-protected:
-    virtual bool RecvPoke1() MOZ_OVERRIDE;
-
-    virtual bool AnswerStackFrame() MOZ_OVERRIDE;
-
-    virtual bool RecvPoke2() MOZ_OVERRIDE;
-
-    virtual bool RecvLastPoke() MOZ_OVERRIDE;
-
-    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
-    {
-        if (NormalShutdown != why)
-            fail("unexpected destruction!");
-        QuitChild();
-    }
-
-private:
-    void OnPoke1();
-    void OnPoke2();
-    void OnLastPoke();
-};
-
-
-} // namespace _ipdltest
-} // namespace mozilla
-
-
-#endif // ifndef mozilla__ipdltest_TestBlockChild_h
--- a/ipc/ipdl/test/cxx/ipdl.mk
+++ b/ipc/ipdl/test/cxx/ipdl.mk
@@ -1,13 +1,12 @@
 IPDLSRCS =					\
   PTestActorPunning.ipdl			\
   PTestActorPunningPunned.ipdl			\
   PTestActorPunningSub.ipdl			\
-  PTestBlockChild.ipdl				\
   PTestBridgeMain.ipdl				\
   PTestBridgeSub.ipdl				\
   PTestBridgeMainSub.ipdl			\
   PTestCrashCleanup.ipdl			\
   PTestDataStructures.ipdl			\
   PTestDataStructuresCommon.ipdlh		\
   PTestDataStructuresSub.ipdl			\
   PTestDesc.ipdl				\
--- a/ipc/testshell/TestShellParent.cpp
+++ b/ipc/testshell/TestShellParent.cpp
@@ -42,18 +42,17 @@ TestShellParent::CommandDone(TestShellCo
   command->ReleaseCallback();
 
   return true;
 }
 
 PContextWrapperParent*
 TestShellParent::AllocPContextWrapper()
 {
-    ContentParent* cpp = static_cast<ContentParent*>(Manager());
-    return new ContextWrapperParent(cpp);
+    return new ContextWrapperParent();
 }
 
 bool
 TestShellParent::DeallocPContextWrapper(PContextWrapperParent* actor)
 {
     delete actor;
     return true;
 }
--- a/js/ipc/ContextWrapperParent.h
+++ b/js/ipc/ContextWrapperParent.h
@@ -21,40 +21,38 @@ namespace jsipc {
 
 using mozilla::dom::ContentParent;
     
 class ContextWrapperParent
     : public PContextWrapperParent
 {
 public:
 
-    ContextWrapperParent(ContentParent* cpp)
-        : mContent(cpp)
-        , mGlobal(NULL)
+    ContextWrapperParent()
+        : mGlobal(NULL)
     {}
 
     JSBool GetGlobalJSObject(JSContext* cx, JSObject** globalp) {
         if (!mGlobal)
             return JS_FALSE;
         mGlobalHolder.Hold(cx);
         mGlobalHolder = *globalp = mGlobal->GetJSObject(cx);
         return JS_TRUE;
     }
 
     ObjectWrapperParent* GetGlobalObjectWrapper() const {
         return mGlobal;
     }
 
     bool RequestRunToCompletion() {
-        return mContent->RequestRunToCompletion();
+        return false;
     }
 
 private:
 
-    ContentParent* mContent;
     ObjectWrapperParent* mGlobal;
     nsAutoJSValHolder mGlobalHolder;
 
     PObjectWrapperParent* AllocPObjectWrapper(const bool&) {
         return new ObjectWrapperParent();
     }
 
     bool RecvPObjectWrapperConstructor(PObjectWrapperParent* actor,