author Mark Goodwin <>
Mon, 01 Feb 2016 16:11:48 +0000
changeset 283075 75fe50edcf9aca16125fa9abf8011e6b36ba7634
parent 277855 03e3553c83beae1609ccf3415ec575568bef8c11
child 301499 232a786cf87fb0f68f9bda6e9316515524d2ac8a
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: 20; 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 */


#include "nsAutoPtr.h"
#include "nsRefPtrHashtable.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "mozilla/TimeStamp.h"
#include "gfxVR.h"

namespace mozilla {
namespace gfx {

class VRManagerParent;
class VRHMDInfo;

class VRManager

  static void ManagerInit();
  static VRManager* Get();

  void AddVRManagerParent(VRManagerParent* aVRManagerParent);
  void RemoveVRManagerParent(VRManagerParent* aVRManagerParent);

  void NotifyVsync(const TimeStamp& aVsyncTimestamp);
  void RefreshVRDevices();
  RefPtr<gfx::VRHMDInfo> GetDevice(const uint32_t& aDeviceID);



  void Init();
  void Destroy();

  void DispatchVRDeviceInfoUpdate();
  void DispatchVRDeviceSensorUpdate();

  typedef nsTHashtable<nsRefPtrHashKey<VRManagerParent>> VRManagerParentSet;
  VRManagerParentSet mVRManagerParents;

  typedef nsTArray<RefPtr<VRHMDManager>> VRHMDManagerArray;
  VRHMDManagerArray mManagers;

  typedef nsRefPtrHashtable<nsUint32HashKey, gfx::VRHMDInfo> VRHMDInfoHashMap;
  VRHMDInfoHashMap mVRDevices;

  Atomic<bool> mInitialized;


} // namespace gfx
} // namespace mozilla

#endif // GFX_VR_MANAGER_H