1// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ppapi/c/pp_errors.h"
6#include "ppapi/c/private/ppb_input_event_private.h"
7#include "ppapi/thunk/enter.h"
8#include "ppapi/thunk/ppb_input_event_api.h"
9#include "ppapi/thunk/thunk.h"
10
11namespace ppapi {
12namespace thunk {
13
14namespace {
15
16PP_Bool TraceInputLatency(PP_Resource event, PP_Bool has_damage) {
17  EnterResource<PPB_InputEvent_API> enter(event, true);
18  if (enter.failed())
19    return PP_FALSE;
20  return enter.object()->TraceInputLatency(has_damage);
21}
22
23void StartTrackingLatency(PP_Instance instance) {
24  EnterInstance enter(instance);
25  if (enter.failed())
26    return;
27  enter.functions()->StartTrackingLatency(instance);
28}
29
30const PPB_InputEvent_Private_0_1 g_ppb_input_event_private_thunk_0_1 = {
31  &TraceInputLatency,
32  &StartTrackingLatency
33};
34
35}  // namespace
36
37const PPB_InputEvent_Private_0_1* GetPPB_InputEvent_Private_0_1_Thunk() {
38  return &g_ppb_input_event_private_thunk_0_1;
39}
40
41}  // namespace thunk
42}  // namespace ppapi
43