зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1408333 Get rid of nsIIPCBackgroundChildCreateCallback - part 5 - IPCBlob, r=asuth
This commit is contained in:
Родитель
b244cf03d0
Коммит
2bd17b771a
|
@ -11,7 +11,6 @@
|
|||
#include "mozilla/TaskCategory.h"
|
||||
#include "mozilla/ipc/BackgroundChild.h"
|
||||
#include "mozilla/ipc/PBackgroundChild.h"
|
||||
#include "nsIIPCBackgroundChildCreateCallback.h"
|
||||
#include "nsXPCOMPrivate.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -42,11 +41,8 @@ public:
|
|||
};
|
||||
|
||||
class MigrateActorRunnable final : public Runnable
|
||||
, public nsIIPCBackgroundChildCreateCallback
|
||||
{
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
explicit MigrateActorRunnable(IPCBlobInputStreamChild* aActor)
|
||||
: Runnable("dom::MigrateActorRunnable")
|
||||
, mActor(aActor)
|
||||
|
@ -56,30 +52,25 @@ public:
|
|||
|
||||
NS_IMETHOD
|
||||
Run() override
|
||||
{
|
||||
BackgroundChild::GetOrCreateForCurrentThread(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
ActorFailed() override
|
||||
{
|
||||
// We cannot continue. We are probably shutting down.
|
||||
}
|
||||
|
||||
void
|
||||
ActorCreated(mozilla::ipc::PBackgroundChild* aActor) override
|
||||
{
|
||||
MOZ_ASSERT(mActor->State() == IPCBlobInputStreamChild::eInactiveMigrating);
|
||||
|
||||
if (aActor->SendPIPCBlobInputStreamConstructor(mActor, mActor->ID(),
|
||||
mActor->Size())) {
|
||||
PBackgroundChild* actorChild =
|
||||
BackgroundChild::GetOrCreateForCurrentThread();
|
||||
if (!actorChild) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (actorChild->SendPIPCBlobInputStreamConstructor(mActor, mActor->ID(),
|
||||
mActor->Size())) {
|
||||
// We need manually to increase the reference for this actor because the
|
||||
// IPC allocator method is not triggered. The Release() is called by IPDL
|
||||
// when the actor is deleted.
|
||||
mActor.get()->AddRef();
|
||||
mActor->Migrated();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -88,9 +79,6 @@ private:
|
|||
RefPtr<IPCBlobInputStreamChild> mActor;
|
||||
};
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED(MigrateActorRunnable, Runnable,
|
||||
nsIIPCBackgroundChildCreateCallback)
|
||||
|
||||
} // anonymous
|
||||
|
||||
NS_IMPL_ISUPPORTS(IPCBlobInputStreamThread, nsIObserver, nsIEventTarget)
|
||||
|
|
Загрузка…
Ссылка в новой задаче