Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: ppapi/cpp/private/input_event_private.cc

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add ui/events/latency_info_param_traits_macros.h Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/private/input_event_private.cc
diff --git a/ppapi/cpp/private/input_event_private.cc b/ppapi/cpp/private/input_event_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b590971c36a5c93e21889b35ca3c00fd19548bc5
--- /dev/null
+++ b/ppapi/cpp/private/input_event_private.cc
@@ -0,0 +1,36 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/private/input_event_private.h"
+
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_InputEvent_Private_0_1>() {
+ return PPB_INPUTEVENT_PRIVATE_INTERFACE_0_1;
+}
+
+} // namespace
+
+InputEventPrivate::InputEventPrivate() : InputEvent() {
+}
+
+InputEventPrivate::InputEventPrivate(const InputEvent& event) : InputEvent() {
+ if (!has_interface<PPB_InputEvent_Private_0_1>())
+ return;
+ Module::Get()->core()->AddRefResource(event.pp_resource());
+ PassRefFromConstructor(event.pp_resource());
+}
+
+void InputEventPrivate::TraceInputLatency(bool has_damage) {
+ if (!has_interface<PPB_InputEvent_Private_0_1>())
+ return;
+ get_interface<PPB_InputEvent_Private_0_1>()->TraceInputLatency(
+ pp_resource(), PP_FromBool(has_damage));
+}
+
+} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698