2016-05-28 00:54:31 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-11-27 11:59:41 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "BackgroundChildImpl.h"
|
|
|
|
|
2014-10-16 08:56:52 +04:00
|
|
|
#include "ActorsChild.h" // IndexedDB
|
2015-01-15 19:58:40 +03:00
|
|
|
#include "BroadcastChannelChild.h"
|
2015-06-04 21:51:57 +03:00
|
|
|
#include "ServiceWorkerManagerChild.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "FileDescriptorSetChild.h"
|
2015-09-18 09:29:14 +03:00
|
|
|
#ifdef MOZ_WEBRTC
|
2015-08-31 15:51:29 +03:00
|
|
|
#include "CamerasChild.h"
|
2015-09-18 09:29:14 +03:00
|
|
|
#endif
|
2015-08-31 15:51:29 +03:00
|
|
|
#include "mozilla/media/MediaChild.h"
|
2014-11-20 22:48:18 +03:00
|
|
|
#include "mozilla/Assertions.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "mozilla/dom/PBlobChild.h"
|
2016-04-09 21:17:02 +03:00
|
|
|
#include "mozilla/dom/PFileSystemRequestChild.h"
|
|
|
|
#include "mozilla/dom/FileSystemTaskBase.h"
|
2015-08-29 08:45:04 +03:00
|
|
|
#include "mozilla/dom/asmjscache/AsmJSCache.h"
|
2015-03-02 16:20:00 +03:00
|
|
|
#include "mozilla/dom/cache/ActorUtils.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIDBFactoryChild.h"
|
2015-11-22 12:44:33 +03:00
|
|
|
#include "mozilla/dom/indexedDB/PBackgroundIndexedDBUtilsChild.h"
|
2014-09-27 03:21:57 +04:00
|
|
|
#include "mozilla/dom/ipc/BlobChild.h"
|
2015-11-22 12:43:55 +03:00
|
|
|
#include "mozilla/dom/quota/PQuotaChild.h"
|
2016-06-28 01:25:00 +03:00
|
|
|
#include "mozilla/dom/GamepadEventChannelChild.h"
|
2016-06-28 01:26:00 +03:00
|
|
|
#include "mozilla/dom/GamepadTestChannelChild.h"
|
2015-06-17 13:44:27 +03:00
|
|
|
#include "mozilla/dom/MessagePortChild.h"
|
2013-11-27 11:59:41 +04:00
|
|
|
#include "mozilla/ipc/PBackgroundTestChild.h"
|
2017-03-14 14:28:58 +03:00
|
|
|
#include "mozilla/ipc/PChildToParentStreamChild.h"
|
2015-01-14 02:37:00 +03:00
|
|
|
#include "mozilla/layout/VsyncChild.h"
|
2015-05-29 17:14:14 +03:00
|
|
|
#include "mozilla/net/PUDPSocketChild.h"
|
|
|
|
#include "mozilla/dom/network/UDPSocketChild.h"
|
2014-10-16 08:56:52 +04:00
|
|
|
#include "nsID.h"
|
2013-11-27 11:59:41 +04:00
|
|
|
#include "nsTraceRefcnt.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class TestChild final : public mozilla::ipc::PBackgroundTestChild
|
2013-11-27 11:59:41 +04:00
|
|
|
{
|
|
|
|
friend class mozilla::ipc::BackgroundChildImpl;
|
|
|
|
|
|
|
|
nsCString mTestArg;
|
|
|
|
|
2014-09-01 05:12:55 +04:00
|
|
|
explicit TestChild(const nsCString& aTestArg)
|
2014-09-27 03:21:57 +04:00
|
|
|
: mTestArg(aTestArg)
|
2013-11-27 11:59:41 +04:00
|
|
|
{
|
2014-07-15 19:37:45 +04:00
|
|
|
MOZ_COUNT_CTOR(TestChild);
|
2013-11-27 11:59:41 +04:00
|
|
|
}
|
|
|
|
|
2014-07-15 19:37:45 +04:00
|
|
|
protected:
|
2016-11-17 16:12:09 +03:00
|
|
|
~TestChild() override
|
2013-11-27 11:59:41 +04:00
|
|
|
{
|
2014-07-15 19:37:45 +04:00
|
|
|
MOZ_COUNT_DTOR(TestChild);
|
2013-11-27 11:59:41 +04:00
|
|
|
}
|
|
|
|
|
2014-07-15 19:37:45 +04:00
|
|
|
public:
|
2016-11-17 16:12:09 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2015-03-21 19:28:04 +03:00
|
|
|
Recv__delete__(const nsCString& aTestArg) override;
|
2013-11-27 11:59:41 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace
|
2013-11-27 11:59:41 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
2015-05-29 17:14:14 +03:00
|
|
|
using mozilla::dom::UDPSocketChild;
|
|
|
|
using mozilla::net::PUDPSocketChild;
|
|
|
|
|
2015-08-29 08:45:04 +03:00
|
|
|
using mozilla::dom::asmjscache::PAsmJSCacheEntryChild;
|
2015-03-02 16:20:00 +03:00
|
|
|
using mozilla::dom::cache::PCacheChild;
|
|
|
|
using mozilla::dom::cache::PCacheStorageChild;
|
|
|
|
using mozilla::dom::cache::PCacheStreamControlChild;
|
|
|
|
|
2014-04-01 06:55:36 +04:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// BackgroundChildImpl::ThreadLocal
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
BackgroundChildImpl::
|
|
|
|
ThreadLocal::ThreadLocal()
|
2015-09-09 14:15:05 +03:00
|
|
|
: mCurrentFileHandle(nullptr)
|
2014-04-01 06:55:36 +04:00
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
MOZ_COUNT_CTOR(mozilla::ipc::BackgroundChildImpl::ThreadLocal);
|
|
|
|
}
|
|
|
|
|
|
|
|
BackgroundChildImpl::
|
|
|
|
ThreadLocal::~ThreadLocal()
|
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
MOZ_COUNT_DTOR(mozilla::ipc::BackgroundChildImpl::ThreadLocal);
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// BackgroundChildImpl
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
2013-11-27 11:59:41 +04:00
|
|
|
BackgroundChildImpl::BackgroundChildImpl()
|
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
MOZ_COUNT_CTOR(mozilla::ipc::BackgroundChildImpl);
|
|
|
|
}
|
|
|
|
|
|
|
|
BackgroundChildImpl::~BackgroundChildImpl()
|
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
MOZ_COUNT_DTOR(mozilla::ipc::BackgroundChildImpl);
|
|
|
|
}
|
|
|
|
|
2014-11-20 22:48:18 +03:00
|
|
|
void
|
2015-02-03 20:09:27 +03:00
|
|
|
BackgroundChildImpl::ProcessingError(Result aCode, const char* aReason)
|
2014-11-20 22:48:18 +03:00
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
|
|
|
|
nsAutoCString abortMessage;
|
|
|
|
|
2015-02-03 20:09:27 +03:00
|
|
|
switch (aCode) {
|
2014-11-20 22:48:18 +03:00
|
|
|
|
|
|
|
#define HANDLE_CASE(_result) \
|
|
|
|
case _result: \
|
|
|
|
abortMessage.AssignLiteral(#_result); \
|
|
|
|
break
|
|
|
|
|
|
|
|
HANDLE_CASE(MsgDropped);
|
|
|
|
HANDLE_CASE(MsgNotKnown);
|
|
|
|
HANDLE_CASE(MsgNotAllowed);
|
|
|
|
HANDLE_CASE(MsgPayloadError);
|
|
|
|
HANDLE_CASE(MsgProcessingError);
|
|
|
|
HANDLE_CASE(MsgRouteError);
|
|
|
|
HANDLE_CASE(MsgValueError);
|
|
|
|
|
|
|
|
#undef HANDLE_CASE
|
|
|
|
|
|
|
|
default:
|
|
|
|
MOZ_CRASH("Unknown error code!");
|
|
|
|
}
|
|
|
|
|
2017-02-21 20:01:48 +03:00
|
|
|
MOZ_CRASH_UNSAFE_PRINTF("%s: %s", abortMessage.get(), aReason);
|
2014-11-20 22:48:18 +03:00
|
|
|
}
|
|
|
|
|
2013-11-27 11:59:41 +04:00
|
|
|
void
|
|
|
|
BackgroundChildImpl::ActorDestroy(ActorDestroyReason aWhy)
|
|
|
|
{
|
|
|
|
// May happen on any thread!
|
|
|
|
}
|
|
|
|
|
|
|
|
PBackgroundTestChild*
|
|
|
|
BackgroundChildImpl::AllocPBackgroundTestChild(const nsCString& aTestArg)
|
|
|
|
{
|
|
|
|
return new TestChild(aTestArg);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPBackgroundTestChild(PBackgroundTestChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
delete static_cast<TestChild*>(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
BackgroundChildImpl::PBackgroundIDBFactoryChild*
|
2014-10-16 08:56:52 +04:00
|
|
|
BackgroundChildImpl::AllocPBackgroundIDBFactoryChild(
|
|
|
|
const LoggingInfo& aLoggingInfo)
|
2014-09-27 03:21:57 +04:00
|
|
|
{
|
|
|
|
MOZ_CRASH("PBackgroundIDBFactoryChild actors should be manually "
|
|
|
|
"constructed!");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPBackgroundIDBFactoryChild(
|
|
|
|
PBackgroundIDBFactoryChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
delete aActor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-11-22 12:44:33 +03:00
|
|
|
BackgroundChildImpl::PBackgroundIndexedDBUtilsChild*
|
|
|
|
BackgroundChildImpl::AllocPBackgroundIndexedDBUtilsChild()
|
|
|
|
{
|
|
|
|
MOZ_CRASH("PBackgroundIndexedDBUtilsChild actors should be manually "
|
|
|
|
"constructed!");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPBackgroundIndexedDBUtilsChild(
|
|
|
|
PBackgroundIndexedDBUtilsChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
delete aActor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
auto
|
|
|
|
BackgroundChildImpl::AllocPBlobChild(const BlobConstructorParams& aParams)
|
|
|
|
-> PBlobChild*
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aParams.type() != BlobConstructorParams::T__None);
|
|
|
|
|
|
|
|
return mozilla::dom::BlobChild::Create(this, aParams);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPBlobChild(PBlobChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
mozilla::dom::BlobChild::Destroy(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PFileDescriptorSetChild*
|
|
|
|
BackgroundChildImpl::AllocPFileDescriptorSetChild(
|
|
|
|
const FileDescriptor& aFileDescriptor)
|
|
|
|
{
|
|
|
|
return new FileDescriptorSetChild(aFileDescriptor);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPFileDescriptorSetChild(
|
|
|
|
PFileDescriptorSetChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
delete static_cast<FileDescriptorSetChild*>(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-01-14 02:37:00 +03:00
|
|
|
BackgroundChildImpl::PVsyncChild*
|
|
|
|
BackgroundChildImpl::AllocPVsyncChild()
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::layout::VsyncChild> actor = new mozilla::layout::VsyncChild();
|
2015-01-30 00:19:00 +03:00
|
|
|
// There still has one ref-count after return, and it will be released in
|
|
|
|
// DeallocPVsyncChild().
|
|
|
|
return actor.forget().take();
|
2015-01-14 02:37:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPVsyncChild(PVsyncChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
2015-01-30 00:19:00 +03:00
|
|
|
// This actor already has one ref-count. Please check AllocPVsyncChild().
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<mozilla::layout::VsyncChild> actor =
|
2015-01-30 00:19:00 +03:00
|
|
|
dont_AddRef(static_cast<mozilla::layout::VsyncChild*>(aActor));
|
2015-01-14 02:37:00 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-05-29 17:14:14 +03:00
|
|
|
PUDPSocketChild*
|
|
|
|
BackgroundChildImpl::AllocPUDPSocketChild(const OptionalPrincipalInfo& aPrincipalInfo,
|
|
|
|
const nsCString& aFilter)
|
|
|
|
{
|
|
|
|
MOZ_CRASH("AllocPUDPSocket should not be called");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPUDPSocketChild(PUDPSocketChild* child)
|
|
|
|
{
|
|
|
|
|
|
|
|
UDPSocketChild* p = static_cast<UDPSocketChild*>(child);
|
|
|
|
p->ReleaseIPDLReference();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-01-15 19:58:40 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// BroadcastChannel API
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
dom::PBroadcastChannelChild*
|
|
|
|
BackgroundChildImpl::AllocPBroadcastChannelChild(const PrincipalInfo& aPrincipalInfo,
|
2015-07-06 21:28:41 +03:00
|
|
|
const nsCString& aOrigin,
|
2016-06-07 14:50:00 +03:00
|
|
|
const nsString& aChannel)
|
2015-01-15 19:58:40 +03:00
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::BroadcastChannelChild> agent =
|
2015-04-01 14:41:29 +03:00
|
|
|
new dom::BroadcastChannelChild(aOrigin);
|
2015-01-15 19:58:40 +03:00
|
|
|
return agent.forget().take();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPBroadcastChannelChild(
|
|
|
|
PBroadcastChannelChild* aActor)
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::BroadcastChannelChild> child =
|
2015-01-15 19:58:40 +03:00
|
|
|
dont_AddRef(static_cast<dom::BroadcastChannelChild*>(aActor));
|
|
|
|
MOZ_ASSERT(child);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-08-31 15:51:29 +03:00
|
|
|
camera::PCamerasChild*
|
|
|
|
BackgroundChildImpl::AllocPCamerasChild()
|
|
|
|
{
|
2015-09-18 09:29:14 +03:00
|
|
|
#ifdef MOZ_WEBRTC
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<camera::CamerasChild> agent =
|
2015-08-31 15:51:29 +03:00
|
|
|
new camera::CamerasChild();
|
|
|
|
return agent.forget().take();
|
2015-09-18 09:29:14 +03:00
|
|
|
#else
|
|
|
|
return nullptr;
|
|
|
|
#endif
|
2015-08-31 15:51:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPCamerasChild(camera::PCamerasChild *aActor)
|
|
|
|
{
|
2015-09-18 09:29:14 +03:00
|
|
|
#ifdef MOZ_WEBRTC
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<camera::CamerasChild> child =
|
2015-08-31 15:51:29 +03:00
|
|
|
dont_AddRef(static_cast<camera::CamerasChild*>(aActor));
|
|
|
|
MOZ_ASSERT(aActor);
|
2015-09-18 09:29:14 +03:00
|
|
|
#endif
|
2015-08-31 15:51:29 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-04 21:51:57 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// ServiceWorkerManager
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
dom::PServiceWorkerManagerChild*
|
|
|
|
BackgroundChildImpl::AllocPServiceWorkerManagerChild()
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::workers::ServiceWorkerManagerChild> agent =
|
2015-06-04 21:51:57 +03:00
|
|
|
new dom::workers::ServiceWorkerManagerChild();
|
|
|
|
return agent.forget().take();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPServiceWorkerManagerChild(
|
|
|
|
PServiceWorkerManagerChild* aActor)
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::workers::ServiceWorkerManagerChild> child =
|
2015-06-04 21:51:57 +03:00
|
|
|
dont_AddRef(static_cast<dom::workers::ServiceWorkerManagerChild*>(aActor));
|
|
|
|
MOZ_ASSERT(child);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-03-02 16:20:00 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// Cache API
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
PCacheStorageChild*
|
|
|
|
BackgroundChildImpl::AllocPCacheStorageChild(const Namespace& aNamespace,
|
|
|
|
const PrincipalInfo& aPrincipalInfo)
|
|
|
|
{
|
|
|
|
MOZ_CRASH("CacheStorageChild actor must be provided to PBackground manager");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPCacheStorageChild(PCacheStorageChild* aActor)
|
|
|
|
{
|
|
|
|
dom::cache::DeallocPCacheStorageChild(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PCacheChild*
|
|
|
|
BackgroundChildImpl::AllocPCacheChild()
|
|
|
|
{
|
|
|
|
return dom::cache::AllocPCacheChild();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPCacheChild(PCacheChild* aActor)
|
|
|
|
{
|
|
|
|
dom::cache::DeallocPCacheChild(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
PCacheStreamControlChild*
|
|
|
|
BackgroundChildImpl::AllocPCacheStreamControlChild()
|
|
|
|
{
|
|
|
|
return dom::cache::AllocPCacheStreamControlChild();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPCacheStreamControlChild(PCacheStreamControlChild* aActor)
|
|
|
|
{
|
|
|
|
dom::cache::DeallocPCacheStreamControlChild(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-17 13:44:27 +03:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// MessageChannel/MessagePort API
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
dom::PMessagePortChild*
|
|
|
|
BackgroundChildImpl::AllocPMessagePortChild(const nsID& aUUID,
|
|
|
|
const nsID& aDestinationUUID,
|
|
|
|
const uint32_t& aSequenceID)
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::MessagePortChild> agent = new dom::MessagePortChild();
|
2015-06-17 13:44:27 +03:00
|
|
|
return agent.forget().take();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPMessagePortChild(PMessagePortChild* aActor)
|
|
|
|
{
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<dom::MessagePortChild> child =
|
2015-06-17 13:44:27 +03:00
|
|
|
dont_AddRef(static_cast<dom::MessagePortChild*>(aActor));
|
|
|
|
MOZ_ASSERT(child);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-03-14 14:28:58 +03:00
|
|
|
PChildToParentStreamChild*
|
|
|
|
BackgroundChildImpl::AllocPChildToParentStreamChild()
|
2016-05-15 20:32:09 +03:00
|
|
|
{
|
2017-03-14 14:28:58 +03:00
|
|
|
MOZ_CRASH("PChildToParentStreamChild actors should be manually constructed!");
|
2016-05-15 20:32:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2017-03-14 14:28:58 +03:00
|
|
|
BackgroundChildImpl::DeallocPChildToParentStreamChild(PChildToParentStreamChild* aActor)
|
2016-05-15 20:32:09 +03:00
|
|
|
{
|
|
|
|
delete aActor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-08-29 08:45:04 +03:00
|
|
|
PAsmJSCacheEntryChild*
|
|
|
|
BackgroundChildImpl::AllocPAsmJSCacheEntryChild(
|
|
|
|
const dom::asmjscache::OpenMode& aOpenMode,
|
|
|
|
const dom::asmjscache::WriteParams& aWriteParams,
|
|
|
|
const PrincipalInfo& aPrincipalInfo)
|
|
|
|
{
|
|
|
|
MOZ_CRASH("PAsmJSCacheEntryChild actors should be manually constructed!");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPAsmJSCacheEntryChild(PAsmJSCacheEntryChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
dom::asmjscache::DeallocEntryChild(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-11-22 12:43:55 +03:00
|
|
|
BackgroundChildImpl::PQuotaChild*
|
|
|
|
BackgroundChildImpl::AllocPQuotaChild()
|
|
|
|
{
|
|
|
|
MOZ_CRASH("PQuotaChild actor should be manually constructed!");
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPQuotaChild(PQuotaChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
|
|
|
|
delete aActor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-04-09 21:17:02 +03:00
|
|
|
dom::PFileSystemRequestChild*
|
|
|
|
BackgroundChildImpl::AllocPFileSystemRequestChild(const FileSystemParams& aParams)
|
|
|
|
{
|
|
|
|
MOZ_CRASH("Should never get here!");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPFileSystemRequestChild(PFileSystemRequestChild* aActor)
|
|
|
|
{
|
|
|
|
// The reference is increased in FileSystemTaskBase::Start of
|
|
|
|
// FileSystemTaskBase.cpp. We should decrease it after IPC.
|
2016-04-09 21:17:28 +03:00
|
|
|
RefPtr<dom::FileSystemTaskChildBase> child =
|
|
|
|
dont_AddRef(static_cast<dom::FileSystemTaskChildBase*>(aActor));
|
2016-04-09 21:17:02 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-06-28 01:25:00 +03:00
|
|
|
// Gamepad API Background IPC
|
|
|
|
dom::PGamepadEventChannelChild*
|
|
|
|
BackgroundChildImpl::AllocPGamepadEventChannelChild()
|
|
|
|
{
|
|
|
|
MOZ_CRASH("PGamepadEventChannelChild actor should be manually constructed!");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPGamepadEventChannelChild(PGamepadEventChannelChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
delete static_cast<dom::GamepadEventChannelChild*>(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-06-28 01:26:00 +03:00
|
|
|
dom::PGamepadTestChannelChild*
|
|
|
|
BackgroundChildImpl::AllocPGamepadTestChannelChild()
|
|
|
|
{
|
|
|
|
MOZ_CRASH("PGamepadTestChannelChild actor should be manually constructed!");
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
BackgroundChildImpl::DeallocPGamepadTestChannelChild(PGamepadTestChannelChild* aActor)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aActor);
|
|
|
|
delete static_cast<dom::GamepadTestChannelChild*>(aActor);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-11-27 11:59:41 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
mozilla::ipc::IPCResult
|
2013-11-27 11:59:41 +04:00
|
|
|
TestChild::Recv__delete__(const nsCString& aTestArg)
|
|
|
|
{
|
|
|
|
MOZ_RELEASE_ASSERT(aTestArg == mTestArg,
|
|
|
|
"BackgroundTest message was corrupted!");
|
|
|
|
|
2016-11-15 06:26:00 +03:00
|
|
|
return IPC_OK();
|
2013-11-27 11:59:41 +04:00
|
|
|
}
|