1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  * vim: sw=2 ts=8 et :
3  */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 
8 #ifndef MOZILLA_LAYERS_COMPOSITABLETRANSACTIONPARENT_H
9 #define MOZILLA_LAYERS_COMPOSITABLETRANSACTIONPARENT_H
10 
11 #include <vector>                       // for vector
12 #include "mozilla/Attributes.h"         // for override
13 #include "mozilla/layers/ISurfaceAllocator.h"  // for ISurfaceAllocator
14 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
15 
16 namespace mozilla {
17 namespace layers {
18 
19 class CompositableHost;
20 
21 typedef std::vector<mozilla::layers::EditReply> EditReplyVector;
22 
23 // Since PCompositble has two potential manager protocols, we can't just call
24 // the Manager() method usually generated when there's one manager protocol,
25 // so both manager protocols implement this and we keep a reference to them
26 // through this interface.
27 class CompositableParentManager : public HostIPCAllocator
28 {
29 public:
CompositableParentManager()30   CompositableParentManager() {}
31 
32   void DestroyActor(const OpDestroy& aOp);
33 
UpdateFwdTransactionId(uint64_t aTransactionId)34   void UpdateFwdTransactionId(uint64_t aTransactionId)
35   {
36     MOZ_ASSERT(mFwdTransactionId < aTransactionId);
37     mFwdTransactionId = aTransactionId;
38   }
39 
GetFwdTransactionId()40   uint64_t GetFwdTransactionId() { return mFwdTransactionId; }
41 
42 protected:
43   /**
44    * Handle the IPDL messages that affect PCompositable actors.
45    */
46   bool ReceiveCompositableUpdate(const CompositableOperation& aEdit,
47                                  EditReplyVector& replyv);
48 
49   uint64_t mFwdTransactionId = 0;
50 };
51 
52 } // namespace layers
53 } // namespace mozilla
54 
55 #endif
56