diff options
Diffstat (limited to 'chromium/ppapi/shared_impl/ppapi_globals.h')
-rw-r--r-- | chromium/ppapi/shared_impl/ppapi_globals.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/chromium/ppapi/shared_impl/ppapi_globals.h b/chromium/ppapi/shared_impl/ppapi_globals.h index 93ab2998e34..a98d8979383 100644 --- a/chromium/ppapi/shared_impl/ppapi_globals.h +++ b/chromium/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; @@ -128,6 +131,19 @@ class PPAPI_SHARED_EXPORT PpapiGlobals { virtual bool IsHostGlobals() const; virtual bool IsPluginGlobals() const; + // Records that the plugin is active. The plugin reports that it is active to + // containers that monitor and shutdown idle content such as background apps. + // This method only has an effect on the plugin process, calls from the + // 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 @@ -136,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); }; |