diff options
author | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 21:49:10 +0000 |
---|---|---|
committer | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-26 21:49:10 +0000 |
commit | 04d2c301427de6e7da85546437d286971cff1cff (patch) | |
tree | d75fbf2ff896288b153a1c1427a2648ec59ed948 /webkit/glue/plugins/plugin_instance.h | |
parent | 555707ea60a7cb39d7cc956eb67adffef3a09b60 (diff) | |
download | chromium_src-04d2c301427de6e7da85546437d286971cff1cff.zip chromium_src-04d2c301427de6e7da85546437d286971cff1cff.tar.gz chromium_src-04d2c301427de6e7da85546437d286971cff1cff.tar.bz2 |
Implemented NPN_ScheduleTimer and NPN_UnscheduleTimer.
TEST=none
BUG=18020
Review URL: http://codereview.chromium.org/329013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/plugin_instance.h')
-rw-r--r-- | webkit/glue/plugins/plugin_instance.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/webkit/glue/plugins/plugin_instance.h b/webkit/glue/plugins/plugin_instance.h index aea05ab..385acf5 100644 --- a/webkit/glue/plugins/plugin_instance.h +++ b/webkit/glue/plugins/plugin_instance.h @@ -8,9 +8,11 @@ #ifndef WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ #define WEBKIT_GLUE_PLUGIN_PLUGIN_INSTANCE_H__ +#include <map> +#include <set> +#include <stack> #include <string> #include <vector> -#include <stack> #include "app/gfx/native_widget_types.h" #include "base/basictypes.h" @@ -150,6 +152,12 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { void PluginThreadAsyncCall(void (*func)(void *), void *userData); + uint32 ScheduleTimer(uint32 interval, + NPBool repeat, + void (*func)(NPP id, uint32 timer_id)); + + void UnscheduleTimer(uint32 timer_id); + // // NPAPI methods for calling the Plugin Instance // @@ -193,6 +201,10 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { private: void OnPluginThreadAsyncCall(void (*func)(void *), void *userData); + void OnTimerCall(void (*func)(NPP id, uint32 timer_id), + NPP id, + uint32 timer_id); + bool IsValidStream(const NPStream* stream); // This is a hack to get the real player plugin to work with chrome @@ -251,6 +263,17 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { // added to the list every time the NPP_StreamAsFile function is called. std::vector<FilePath> files_created_; + // Next unusued timer id. + uint32 next_timer_id_; + + // Map of timer id to settings for timer. + struct TimerInfo { + uint32 interval; + bool repeat; + }; + typedef std::map<uint32, TimerInfo> TimerMap; + TimerMap timers_; + DISALLOW_EVIL_CONSTRUCTORS(PluginInstance); }; |