Index: ppapi/shared_impl/ppapi_globals.h |
diff --git a/ppapi/shared_impl/ppapi_globals.h b/ppapi/shared_impl/ppapi_globals.h |
index d9be03877e4aa6f6ceaab67469ffb7ee59a41656..a98d8979383c5c1ba65c34622e4b9ecb437293ff 100644 |
--- a/ppapi/shared_impl/ppapi_globals.h |
+++ b/ppapi/shared_impl/ppapi_globals.h |
@@ -5,7 +5,9 @@ |
#ifndef PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
#define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_ |
+#include <map> |
#include <string> |
+#include <vector> |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
@@ -15,6 +17,7 @@ |
#include "ppapi/c/ppb_console.h" |
#include "ppapi/shared_impl/api_id.h" |
#include "ppapi/shared_impl/ppapi_shared_export.h" |
+#include "ui/events/latency_info.h" |
namespace base { |
class MessageLoopProxy; |
@@ -134,6 +137,13 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
// renderer process will have no effect. |
virtual void MarkPluginIsActive(); |
+ // Caches an input event's |latency_info| for the plugin |instance|. |
+ void AddLatencyInfo(const ui::LatencyInfo& latency_info, |
+ PP_Instance instance); |
+ // Transfers plugin |instance|'s latency info into |latency_info|. |
+ void TransferLatencyInfoTo(std::vector<ui::LatencyInfo>* latency_info, |
+ PP_Instance instance); |
+ |
private: |
// Return the thread-local pointer which is used only for unit testing. It |
// should always be NULL when running in production. It allows separate |
@@ -142,6 +152,11 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { |
scoped_refptr<base::MessageLoopProxy> main_loop_proxy_; |
+ // If an input event is believed to have caused rendering damage, its latency |
+ // info is cached in |latency_info_for_frame_| indexed by instance. These |
+ // latency info will be passed back to renderer with the next plugin frame. |
+ std::map<PP_Instance, std::vector<ui::LatencyInfo> > latency_info_for_frame_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PpapiGlobals); |
}; |