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

Unified Diff: ppapi/shared_impl/ppapi_globals.h

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix win & mac build Created 6 years, 7 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
« no previous file with comments | « ppapi/shared_impl/DEPS ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ppapi/shared_impl/DEPS ('k') | ppapi/shared_impl/ppapi_globals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698