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

Unified Diff: webkit/glue/plugins/plugin_instance.h

Issue 329013: Implemented NPN_ScheduleTimer and NPN_UnscheduleTimer. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « webkit/glue/plugins/plugin_host.cc ('k') | webkit/glue/plugins/plugin_instance.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_instance.h
===================================================================
--- webkit/glue/plugins/plugin_instance.h (revision 29899)
+++ webkit/glue/plugins/plugin_instance.h (working copy)
@@ -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 @@
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 @@
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 @@
// 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);
};
« no previous file with comments | « webkit/glue/plugins/plugin_host.cc ('k') | webkit/glue/plugins/plugin_instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698