gfx/ipc/CompositorWidgetVsyncObserver.cpp
author Thomas Wisniewski <wisniewskit@gmail.com>
Wed, 17 Aug 2016 00:11:24 -0400
changeset 353516 f4d0e045901e5ef4698a0635723f2ca2d488ec57
parent 347842 3fdb8ca3e6ffbd310daf342eb8febb1c17938dd0
child 442275 5f74d262924171a8fa0b4483a64f4cac34c4c9b8
permissions -rw-r--r--
Bug 932755 - Add support for input/textarea minLength and tooShort. r=mrbkap

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=99: */
/* 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 http://mozilla.org/MPL/2.0/. */

#include "CompositorWidgetVsyncObserver.h"
#include "mozilla/gfx/VsyncBridgeChild.h"

namespace mozilla {
namespace widget {

CompositorWidgetVsyncObserver::CompositorWidgetVsyncObserver(
    RefPtr<VsyncBridgeChild> aVsyncBridge,
    const uint64_t& aRootLayerTreeId)
 : mVsyncBridge(aVsyncBridge),
   mRootLayerTreeId(aRootLayerTreeId)
{
  MOZ_ASSERT(XRE_IsParentProcess());
  MOZ_ASSERT(NS_IsMainThread());
}

bool
CompositorWidgetVsyncObserver::NotifyVsync(TimeStamp aTimeStamp)
{
  // Vsync notifications should only arrive on the vsync thread.
  MOZ_ASSERT(XRE_IsParentProcess());
  MOZ_ASSERT(!NS_IsMainThread());

  mVsyncBridge->NotifyVsync(aTimeStamp, mRootLayerTreeId);
  return true;
}

} // namespace widget
} // namespace mozilla