Bug 1570369 - Part 2: Use IPDL refcounted for PAPZInputBridge, r=rhunt

Differential Revision: https://phabricator.services.mozilla.com/D40253

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nika Layzell 2019-08-08 16:46:22 +00:00
Родитель 57067bd337
Коммит f9fb4fc118
8 изменённых файлов: 10 добавлений и 35 удалений

Просмотреть файл

@ -89,19 +89,6 @@ base::ProcessHandle GPUChild::GetChildProcessHandle() {
return mHost->GetChildProcessHandle();
}
PAPZInputBridgeChild* GPUChild::AllocPAPZInputBridgeChild(
const LayersId& aLayersId) {
APZInputBridgeChild* child = new APZInputBridgeChild();
child->AddRef();
return child;
}
bool GPUChild::DeallocPAPZInputBridgeChild(PAPZInputBridgeChild* aActor) {
APZInputBridgeChild* child = static_cast<APZInputBridgeChild*>(aActor);
child->Release();
return true;
}
mozilla::ipc::IPCResult GPUChild::RecvInitComplete(const GPUDeviceData& aData) {
// We synchronously requested GPU parameters before this arrived.
if (mGPUReady) {

Просмотреть файл

@ -35,9 +35,6 @@ class GPUChild final : public PGPUChild, public gfxVarReceiver {
bool EnsureGPUReady();
base::ProcessHandle GetChildProcessHandle();
PAPZInputBridgeChild* AllocPAPZInputBridgeChild(const LayersId& aLayersId);
bool DeallocPAPZInputBridgeChild(PAPZInputBridgeChild* aActor);
// gfxVarReceiver overrides.
void OnVarChanged(const GfxVarUpdate& aVar) override;

Просмотреть файл

@ -160,17 +160,9 @@ void GPUParent::NotifyDeviceReset() {
Unused << SendNotifyDeviceReset(data);
}
PAPZInputBridgeParent* GPUParent::AllocPAPZInputBridgeParent(
already_AddRefed<PAPZInputBridgeParent> GPUParent::AllocPAPZInputBridgeParent(
const LayersId& aLayersId) {
APZInputBridgeParent* parent = new APZInputBridgeParent(aLayersId);
parent->AddRef();
return parent;
}
bool GPUParent::DeallocPAPZInputBridgeParent(PAPZInputBridgeParent* aActor) {
APZInputBridgeParent* parent = static_cast<APZInputBridgeParent*>(aActor);
parent->Release();
return true;
return MakeAndAddRef<APZInputBridgeParent>(aLayersId);
}
mozilla::ipc::IPCResult GPUParent::RecvInit(

Просмотреть файл

@ -34,8 +34,8 @@ class GPUParent final : public PGPUParent {
MessageLoop* aIOLoop, IPC::Channel* aChannel);
void NotifyDeviceReset();
PAPZInputBridgeParent* AllocPAPZInputBridgeParent(const LayersId& aLayersId);
bool DeallocPAPZInputBridgeParent(PAPZInputBridgeParent* aActor);
already_AddRefed<PAPZInputBridgeParent> AllocPAPZInputBridgeParent(
const LayersId& aLayersId);
mozilla::ipc::IPCResult RecvInit(nsTArray<GfxVarUpdate>&& vars,
const DevicePrefs& devicePrefs,

Просмотреть файл

@ -812,12 +812,11 @@ RefPtr<CompositorSession> GPUProcessManager::CreateRemoteSession(
}
apz = static_cast<APZCTreeManagerChild*>(papz);
PAPZInputBridgeChild* pinput =
mGPUChild->SendPAPZInputBridgeConstructor(aRootLayerTreeId);
if (!pinput) {
RefPtr<APZInputBridgeChild> pinput = new APZInputBridgeChild();
if (!mGPUChild->SendPAPZInputBridgeConstructor(pinput, aRootLayerTreeId)) {
return nullptr;
}
apz->SetInputBridge(static_cast<APZInputBridgeChild*>(pinput));
apz->SetInputBridge(pinput);
}
RefPtr<RemoteCompositorSession> session = new RemoteCompositorSession(

Просмотреть файл

@ -14,7 +14,7 @@ namespace mozilla {
namespace layers {
class APZInputBridgeChild : public PAPZInputBridgeChild, public APZInputBridge {
NS_INLINE_DECL_REFCOUNTING(APZInputBridgeChild)
NS_INLINE_DECL_REFCOUNTING(APZInputBridgeChild, final)
public:
APZInputBridgeChild();

Просмотреть файл

@ -15,7 +15,7 @@ namespace layers {
class IAPZCTreeManager;
class APZInputBridgeParent : public PAPZInputBridgeParent {
NS_INLINE_DECL_REFCOUNTING(APZInputBridgeParent)
NS_INLINE_DECL_REFCOUNTING(APZInputBridgeParent, final)
public:
explicit APZInputBridgeParent(const LayersId& aLayersId);

Просмотреть файл

@ -31,7 +31,7 @@ namespace layers {
* and the parent side lives on the main thread in the GPU process. If there
* is no GPU process, then this protocol is not instantiated.
*/
sync protocol PAPZInputBridge
sync refcounted protocol PAPZInputBridge
{
manager PGPU;