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.
5 #include "ppapi/cpp/private/input_event_private.h"
7 #include "ppapi/cpp/module_impl.h"
13 template <> const char* interface_name
<PPB_InputEvent_Private
>() {
14 return PPB_INPUTEVENT_PRIVATE_INTERFACE
;
19 InputEventPrivate::InputEventPrivate() : InputEvent() {
22 InputEventPrivate::InputEventPrivate(const InputEvent
& event
) : InputEvent() {
23 if (!has_interface
<PPB_InputEvent_Private_0_1
>())
25 Module::Get()->core()->AddRefResource(event
.pp_resource());
26 PassRefFromConstructor(event
.pp_resource());
29 bool InputEventPrivate::TraceInputLatency(bool has_damage
) {
30 if (!has_interface
<PPB_InputEvent_Private_0_1
>())
33 get_interface
<PPB_InputEvent_Private_0_1
>()->TraceInputLatency(
34 pp_resource(), PP_FromBool(has_damage
)));
37 void InputEventPrivate::StartTrackingLatency(const InstanceHandle
& instance
) {
38 if (!has_interface
<PPB_InputEvent_Private
>())
40 return get_interface
<PPB_InputEvent_Private
>()->StartTrackingLatency(
41 instance
.pp_instance());