Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / gfx / ipc / VsyncBridgeChild.h
bloba0727ce5fe315e1ac7f529e216c5e6dfaf243f91
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef include_gfx_ipc_VsyncBridgeChild_h
7 #define include_gfx_ipc_VsyncBridgeChild_h
9 #include "mozilla/RefPtr.h"
10 #include "mozilla/gfx/PVsyncBridgeChild.h"
12 namespace mozilla {
13 namespace gfx {
15 class VsyncIOThreadHolder;
17 class VsyncBridgeChild final : public PVsyncBridgeChild {
18 friend class NotifyVsyncTask;
20 public:
21 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VsyncBridgeChild, final)
23 static RefPtr<VsyncBridgeChild> Create(
24 RefPtr<VsyncIOThreadHolder> aThread, const uint64_t& aProcessToken,
25 Endpoint<PVsyncBridgeChild>&& aEndpoint);
27 void Close();
29 void ActorDestroy(ActorDestroyReason aWhy) override;
30 void ProcessingError(Result aCode, const char* aReason) override;
32 void NotifyVsync(const VsyncEvent& aVsync, const layers::LayersId& aLayersId);
34 void HandleFatalError(const char* aMsg) override;
36 private:
37 VsyncBridgeChild(RefPtr<VsyncIOThreadHolder>, const uint64_t& aProcessToken);
38 virtual ~VsyncBridgeChild();
40 void Open(Endpoint<PVsyncBridgeChild>&& aEndpoint);
42 void NotifyVsyncImpl(const VsyncEvent& aVsync,
43 const layers::LayersId& aLayersId);
45 bool IsOnVsyncIOThread() const;
47 private:
48 RefPtr<VsyncIOThreadHolder> mThread;
49 uint64_t mProcessToken;
52 } // namespace gfx
53 } // namespace mozilla
55 #endif // include_gfx_ipc_VsyncBridgeChild_h