OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Pepper API support should be turned on for this module. | 5 // Pepper API support should be turned on for this module. |
6 #define PEPPER_APIS_ENABLED | 6 #define PEPPER_APIS_ENABLED |
7 | 7 |
8 #include "webkit/glue/plugins/plugin_host.h" | 8 #include "webkit/glue/plugins/plugin_host.h" |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 host_funcs_.releasevariantvalue = WebBindings::releaseVariantValue; | 101 host_funcs_.releasevariantvalue = WebBindings::releaseVariantValue; |
102 host_funcs_.setexception = WebBindings::setException; | 102 host_funcs_.setexception = WebBindings::setException; |
103 host_funcs_.pushpopupsenabledstate = NPN_PushPopupsEnabledState; | 103 host_funcs_.pushpopupsenabledstate = NPN_PushPopupsEnabledState; |
104 host_funcs_.poppopupsenabledstate = NPN_PopPopupsEnabledState; | 104 host_funcs_.poppopupsenabledstate = NPN_PopPopupsEnabledState; |
105 host_funcs_.enumerate = WebBindings::enumerate; | 105 host_funcs_.enumerate = WebBindings::enumerate; |
106 host_funcs_.pluginthreadasynccall = NPN_PluginThreadAsyncCall; | 106 host_funcs_.pluginthreadasynccall = NPN_PluginThreadAsyncCall; |
107 host_funcs_.construct = WebBindings::construct; | 107 host_funcs_.construct = WebBindings::construct; |
108 host_funcs_.getvalueforurl = NPN_GetValueForURL; | 108 host_funcs_.getvalueforurl = NPN_GetValueForURL; |
109 host_funcs_.setvalueforurl = NPN_SetValueForURL; | 109 host_funcs_.setvalueforurl = NPN_SetValueForURL; |
110 host_funcs_.getauthenticationinfo = NPN_GetAuthenticationInfo; | 110 host_funcs_.getauthenticationinfo = NPN_GetAuthenticationInfo; |
| 111 host_funcs_.scheduletimer = NPN_ScheduleTimer; |
| 112 host_funcs_.unscheduletimer = NPN_UnscheduleTimer; |
111 } | 113 } |
112 | 114 |
113 void PluginHost::PatchNPNetscapeFuncs(NPNetscapeFuncs* overrides) { | 115 void PluginHost::PatchNPNetscapeFuncs(NPNetscapeFuncs* overrides) { |
114 // When running in the plugin process, we need to patch the NPN functions | 116 // When running in the plugin process, we need to patch the NPN functions |
115 // that the plugin calls to interact with NPObjects that we give. Otherwise | 117 // that the plugin calls to interact with NPObjects that we give. Otherwise |
116 // the plugin will call the v8 NPN functions, which won't work since we have | 118 // the plugin will call the v8 NPN functions, which won't work since we have |
117 // an NPObjectProxy and not a real v8 implementation. | 119 // an NPObjectProxy and not a real v8 implementation. |
118 if (overrides->invoke) | 120 if (overrides->invoke) |
119 host_funcs_.invoke = overrides->invoke; | 121 host_funcs_.invoke = overrides->invoke; |
120 | 122 |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 char **password, | 1085 char **password, |
1084 uint32_t *plen) { | 1086 uint32_t *plen) { |
1085 if (!id || !protocol || !host || !scheme || !realm || !username || | 1087 if (!id || !protocol || !host || !scheme || !realm || !username || |
1086 !ulen || !password || !plen) | 1088 !ulen || !password || !plen) |
1087 return NPERR_INVALID_PARAM; | 1089 return NPERR_INVALID_PARAM; |
1088 | 1090 |
1089 // TODO: implement me (bug 23928) | 1091 // TODO: implement me (bug 23928) |
1090 return NPERR_GENERIC_ERROR; | 1092 return NPERR_GENERIC_ERROR; |
1091 } | 1093 } |
1092 | 1094 |
| 1095 uint32 NPN_ScheduleTimer(NPP id, |
| 1096 uint32 interval, |
| 1097 NPBool repeat, |
| 1098 void (*func)(NPP id, uint32 timer_id)) { |
| 1099 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 1100 if (!plugin) |
| 1101 return 0; |
| 1102 |
| 1103 return plugin->ScheduleTimer(interval, repeat, func); |
| 1104 } |
| 1105 |
| 1106 void NPN_UnscheduleTimer(NPP id, uint32 timer_id) { |
| 1107 scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id); |
| 1108 if (plugin) |
| 1109 plugin->UnscheduleTimer(timer_id); |
| 1110 } |
1093 } // extern "C" | 1111 } // extern "C" |
OLD | NEW |