author Mark Goodwin <>
Mon, 01 Feb 2016 16:11:48 +0000
changeset 283075 75fe50edcf9aca16125fa9abf8011e6b36ba7634
parent 271616 43305927701d23fa5eb5f950fb520f3c16f0bf4d
child 322595 39ac4382a2c019178604b90acd816753fe142908
permissions -rw-r--r--
Bug 1244776 - Update moz-kinto-client.js to include recent Kinto.js changes r=rnewman Please see the Kinto.js PR for the storage adapter changes: Additions and changes to the Firefox storage adapter tests have been made accordingly.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 */

#ifndef mozilla_layout_ipc_VsyncChild_h
#define mozilla_layout_ipc_VsyncChild_h

#include "mozilla/layout/PVsyncChild.h"
#include "nsISupportsImpl.h"
#include "mozilla/RefPtr.h"

namespace mozilla {

class VsyncObserver;

namespace ipc {
class BackgroundChildImpl;
} // namespace ipc

namespace layout {

// The PVsyncChild actor receives a vsync event from the main process and
// delivers it to the child process. Currently this is restricted to the main
// thread only. The actor will stay alive until the process dies or its
// PVsyncParent actor dies.
class VsyncChild final : public PVsyncChild

  friend class mozilla::ipc::BackgroundChildImpl;

  // Hide the SendObserve/SendUnobserve in PVsyncChild. We add an flag
  // mObservingVsync to handle the race problem of unobserving vsync event.
  bool SendObserve();
  bool SendUnobserve();

  // Bind a VsyncObserver into VsyncChild after ipc channel connected.
  void SetVsyncObserver(VsyncObserver* aVsyncObserver);
  TimeDuration GetVsyncRate();

  virtual ~VsyncChild();

  virtual bool RecvNotify(const TimeStamp& aVsyncTimestamp) override;
  virtual bool RecvVsyncRate(const float& aVsyncRate) override;
  virtual void ActorDestroy(ActorDestroyReason aActorDestroyReason) override;

  bool mObservingVsync;
  bool mIsShutdown;

  // The content side vsync observer.
  RefPtr<VsyncObserver> mObserver;
  TimeDuration mVsyncRate;

} // namespace layout
} // namespace mozilla

#endif  // mozilla_layout_ipc_VsyncChild_h