| 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 #include "chrome/plugin/npobject_util.h" | 5 #include "chrome/plugin/npobject_util.h" |
| 6 | 6 |
| 7 // TODO(port) Just compile an empty file on posix so we can generate the | 7 // TODO(port) Just compile an empty file on posix so we can generate the |
| 8 // libplugin target needed by other targets. This whole file does compile (see | 8 // libplugin target needed by other targets. This whole file does compile (see |
| 9 // r9934), but it doesn't link because of undefined refs to files which aren't | 9 // r9934), but it doesn't link because of undefined refs to files which aren't |
| 10 // compiling yet (e.g. npobject_proxy stuff). | 10 // compiling yet (e.g. npobject_proxy stuff). |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 NPObject *npobj, | 34 NPObject *npobj, |
| 35 NPIdentifier methodName) { | 35 NPIdentifier methodName) { |
| 36 return NPObjectProxy::NPHasMethod(npobj, methodName); | 36 return NPObjectProxy::NPHasMethod(npobj, methodName); |
| 37 } | 37 } |
| 38 | 38 |
| 39 static bool NPN_InvokePatch(NPP npp, NPObject *npobj, | 39 static bool NPN_InvokePatch(NPP npp, NPObject *npobj, |
| 40 NPIdentifier methodName, | 40 NPIdentifier methodName, |
| 41 const NPVariant *args, | 41 const NPVariant *args, |
| 42 uint32_t argCount, | 42 uint32_t argCount, |
| 43 NPVariant *result) { | 43 NPVariant *result) { |
| 44 return NPObjectProxy::NPInvokePrivate(npp, npobj, false, methodName, args, arg
Count, result); | 44 return NPObjectProxy::NPInvokePrivate(npp, npobj, false, methodName, args, |
| 45 argCount, result); |
| 45 } | 46 } |
| 46 | 47 |
| 47 static bool NPN_InvokeDefaultPatch(NPP npp, | 48 static bool NPN_InvokeDefaultPatch(NPP npp, |
| 48 NPObject *npobj, | 49 NPObject *npobj, |
| 49 const NPVariant *args, | 50 const NPVariant *args, |
| 50 uint32_t argCount, | 51 uint32_t argCount, |
| 51 NPVariant *result) { | 52 NPVariant *result) { |
| 52 return NPObjectProxy::NPInvokePrivate(npp, npobj, true, 0, args, argCount, res
ult); | 53 return NPObjectProxy::NPInvokePrivate(npp, npobj, true, 0, args, argCount, |
| 54 result); |
| 53 } | 55 } |
| 54 | 56 |
| 55 static bool NPN_HasPropertyPatch(NPP npp, | 57 static bool NPN_HasPropertyPatch(NPP npp, |
| 56 NPObject *npobj, | 58 NPObject *npobj, |
| 57 NPIdentifier propertyName) { | 59 NPIdentifier propertyName) { |
| 58 return NPObjectProxy::NPHasProperty(npobj, propertyName); | 60 return NPObjectProxy::NPHasProperty(npobj, propertyName); |
| 59 } | 61 } |
| 60 | 62 |
| 61 static bool NPN_GetPropertyPatch(NPP npp, | 63 static bool NPN_GetPropertyPatch(NPP npp, |
| 62 NPObject *npobj, | 64 NPObject *npobj, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 break; | 233 break; |
| 232 case NPVARIANT_PARAM_STRING: | 234 case NPVARIANT_PARAM_STRING: |
| 233 result->type = NPVariantType_String; | 235 result->type = NPVariantType_String; |
| 234 result->value.stringValue.UTF8Characters = | 236 result->value.stringValue.UTF8Characters = |
| 235 static_cast<NPUTF8 *>(_strdup(param.string_value.c_str())); | 237 static_cast<NPUTF8 *>(_strdup(param.string_value.c_str())); |
| 236 result->value.stringValue.UTF8Length = | 238 result->value.stringValue.UTF8Length = |
| 237 static_cast<int>(param.string_value.size()); | 239 static_cast<int>(param.string_value.size()); |
| 238 break; | 240 break; |
| 239 case NPVARIANT_PARAM_OBJECT_ROUTING_ID: | 241 case NPVARIANT_PARAM_OBJECT_ROUTING_ID: |
| 240 result->type = NPVariantType_Object; | 242 result->type = NPVariantType_Object; |
| 241 result->value.objectValue = NPObjectProxy::Create(channel, | 243 result->value.objectValue = |
| 242 param.npobject_routing_i
d, | 244 NPObjectProxy::Create(channel, |
| 243 param.npobject_pointer, | 245 param.npobject_routing_id, |
| 244 modal_dialog_event); | 246 param.npobject_pointer, |
| 247 modal_dialog_event); |
| 245 break; | 248 break; |
| 246 case NPVARIANT_PARAM_OBJECT_POINTER: | 249 case NPVARIANT_PARAM_OBJECT_POINTER: |
| 247 result->type = NPVariantType_Object; | 250 result->type = NPVariantType_Object; |
| 248 result->value.objectValue = static_cast<NPObject*>(param.npobject_pointer)
; | 251 result->value.objectValue = |
| 252 static_cast<NPObject*>(param.npobject_pointer); |
| 249 NPN_RetainObject(result->value.objectValue); | 253 NPN_RetainObject(result->value.objectValue); |
| 250 break; | 254 break; |
| 251 default: | 255 default: |
| 252 NOTREACHED(); | 256 NOTREACHED(); |
| 253 } | 257 } |
| 254 } | 258 } |
| 255 #endif | 259 |
| 256 #endif | 260 #endif // defined(OS_WIN) |
| 261 |
| 262 #endif // defined(OS_WIN) |
| OLD | NEW |