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

Unified Diff: ppapi/proxy/plugin_globals.h

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add more comments 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/proxy/plugin_globals.h
diff --git a/ppapi/proxy/plugin_globals.h b/ppapi/proxy/plugin_globals.h
index 5dc614d239bd72f24e84a11b9fd8290f72facdf8..7680a6e8880d257a7f60cd87690d5c5c0600412d 100644
--- a/ppapi/proxy/plugin_globals.h
+++ b/ppapi/proxy/plugin_globals.h
@@ -5,7 +5,9 @@
#ifndef PPAPI_PROXY_PLUGIN_GLOBALS_H_
#define PPAPI_PROXY_PLUGIN_GLOBALS_H_
+#include <map>
#include <string>
+#include <vector>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
@@ -16,6 +18,7 @@
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/callback_tracker.h"
#include "ppapi/shared_impl/ppapi_globals.h"
+#include "ui/events/latency_info.h"
namespace base {
class Thread;
@@ -134,6 +137,17 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
return resource_reply_thread_registrar_.get();
}
+ // Cache a input event's |latency_info| for the plugin |instance|.
+ void AddLatencyInfo(ui::LatencyInfo latency_info, PP_Instance instance);
piman 2014/04/25 01:59:43 How about stashing all this state/logic on the Ins
Yufeng Shen (Slow to review) 2014/04/25 20:42:42 All the logic/data are now moved to the host side.
+ // Upon graphics invalidation, input events are considered to have caused
+ // rendering damage, their cached latency_info should continue to track
+ // the new plugin output frame until it reaches screen.
+ void OnGraphicsInvalidation(PP_Instance instance);
+ // On graphics flush, the cached latency_info are passed into |latency_info|
+ // if they are associated with rendering damage, or terminated if not.
+ void OnGraphicsFlush(std::vector<ui::LatencyInfo>* latency_info,
+ PP_Instance instance);
+
// Interval to limit how many IPC messages are sent indicating that the plugin
// is active and should be kept alive. The value must be smaller than any
// threshold used to kill inactive plugins by the embedder host.
@@ -184,6 +198,11 @@ class PPAPI_PROXY_EXPORT PluginGlobals : public PpapiGlobals {
unsigned keepalive_throttle_interval_milliseconds_;
+ // Input event latency that are not associated with any output frame yet.
+ std::map<PP_Instance, std::vector<ui::LatencyInfo> > pending_latency_info_;
+ // Input event latency that are associated with next output frame.
+ std::map<PP_Instance, std::vector<ui::LatencyInfo> > latency_info_for_frame_;
+
// Member variables should appear before the WeakPtrFactory, see weak_ptr.h.
base::WeakPtrFactory<PluginGlobals> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698