Bug 1137875 - Have the LayerTransactionChild hold a copy of the layers id. r=nical, a=bajaj
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 06 Mar 2015 06:25:33 -0500
changeset 237570 2fe3ae4546c3eb4d52a078bb911f72bbbe140834
parent 237569 f248015e7f0c73808b924dd3e994d0ab627f5935
child 237571 e798cfd378608691f3c6f970f6a112cb503a5f40
push id301
push userryanvm@gmail.com
push dateWed, 11 Mar 2015 02:14:36 +0000
treeherdermozilla-b2g37_v2_2@004fa1cb1dd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical, bajaj
bugs1137875
milestone37.0
Bug 1137875 - Have the LayerTransactionChild hold a copy of the layers id. r=nical, a=bajaj
gfx/layers/ipc/CompositorChild.cpp
gfx/layers/ipc/LayerTransactionChild.h
--- a/gfx/layers/ipc/CompositorChild.cpp
+++ b/gfx/layers/ipc/CompositorChild.cpp
@@ -111,17 +111,17 @@ CompositorChild::Get()
 
 PLayerTransactionChild*
 CompositorChild::AllocPLayerTransactionChild(const nsTArray<LayersBackend>& aBackendHints,
                                              const uint64_t& aId,
                                              TextureFactoryIdentifier*,
                                              bool*)
 {
   MOZ_ASSERT(mCanSend);
-  LayerTransactionChild* c = new LayerTransactionChild();
+  LayerTransactionChild* c = new LayerTransactionChild(aId);
   c->AddIPDLReference();
   return c;
 }
 
 bool
 CompositorChild::DeallocPLayerTransactionChild(PLayerTransactionChild* actor)
 {
   static_cast<LayerTransactionChild*>(actor)->ReleaseIPDLReference();
--- a/gfx/layers/ipc/LayerTransactionChild.h
+++ b/gfx/layers/ipc/LayerTransactionChild.h
@@ -46,21 +46,24 @@ public:
   {
     mForwarder = aForwarder;
   }
 
   virtual void SendFenceHandle(AsyncTransactionTracker* aTracker,
                                PTextureChild* aTexture,
                                const FenceHandle& aFence);
 
+  uint64_t GetId() const { return mId; }
+
 protected:
-  LayerTransactionChild()
+  explicit LayerTransactionChild(const uint64_t& aId)
     : mForwarder(nullptr)
     , mIPCOpen(false)
     , mDestroyed(false)
+    , mId(aId)
   {}
   ~LayerTransactionChild() { }
 
   virtual PLayerChild* AllocPLayerChild() MOZ_OVERRIDE;
   virtual bool DeallocPLayerChild(PLayerChild* actor) MOZ_OVERRIDE;
 
   virtual PCompositableChild* AllocPCompositableChild(const TextureInfo& aInfo) MOZ_OVERRIDE;
   virtual bool DeallocPCompositableChild(PCompositableChild* actor) MOZ_OVERRIDE;
@@ -85,14 +88,15 @@ protected:
     Release();
   }
   friend class CompositorChild;
   friend class layout::RenderFrameChild;
 
   ShadowLayerForwarder* mForwarder;
   bool mIPCOpen;
   bool mDestroyed;
+  uint64_t mId;
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H