| 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 // A proxy for NPObject that sends all calls to the object to an NPObjectStub | 5 // A proxy for NPObject that sends all calls to the object to an NPObjectStub |
| 6 // running in a different process. | 6 // running in a different process. |
| 7 | 7 |
| 8 #ifndef CHROME_PLUGIN_NPOBJECT_PROXY_H_ | 8 #ifndef CHROME_PLUGIN_NPOBJECT_PROXY_H_ |
| 9 #define CHROME_PLUGIN_NPOBJECT_PROXY_H_ | 9 #define CHROME_PLUGIN_NPOBJECT_PROXY_H_ |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // IPC::Message::Sender implementation: | 41 // IPC::Message::Sender implementation: |
| 42 bool Send(IPC::Message* msg); | 42 bool Send(IPC::Message* msg); |
| 43 int route_id() { return route_id_; } | 43 int route_id() { return route_id_; } |
| 44 PluginChannelBase* channel() { return channel_; } | 44 PluginChannelBase* channel() { return channel_; } |
| 45 | 45 |
| 46 // Returns the real NPObject's pointer (obviously only valid in the other | 46 // Returns the real NPObject's pointer (obviously only valid in the other |
| 47 // process). | 47 // process). |
| 48 intptr_t npobject_ptr() { return npobject_ptr_; } | 48 intptr_t npobject_ptr() { return npobject_ptr_; } |
| 49 | 49 |
| 50 // The next 8 functions are called on NPObjects from the plugin and browser. | 50 // The next 9 functions are called on NPObjects from the plugin and browser. |
| 51 static bool NPHasMethod(NPObject *obj, | 51 static bool NPHasMethod(NPObject *obj, |
| 52 NPIdentifier name); | 52 NPIdentifier name); |
| 53 static bool NPInvoke(NPObject *obj, | 53 static bool NPInvoke(NPObject *obj, |
| 54 NPIdentifier name, | 54 NPIdentifier name, |
| 55 const NPVariant *args, | 55 const NPVariant *args, |
| 56 uint32_t arg_count, | 56 uint32_t arg_count, |
| 57 NPVariant *result); | 57 NPVariant *result); |
| 58 static bool NPInvokeDefault(NPObject *npobj, | 58 static bool NPInvokeDefault(NPObject *npobj, |
| 59 const NPVariant *args, | 59 const NPVariant *args, |
| 60 uint32_t arg_count, | 60 uint32_t arg_count, |
| 61 NPVariant *result); | 61 NPVariant *result); |
| 62 static bool NPHasProperty(NPObject *obj, | 62 static bool NPHasProperty(NPObject *obj, |
| 63 NPIdentifier name); | 63 NPIdentifier name); |
| 64 static bool NPGetProperty(NPObject *obj, | 64 static bool NPGetProperty(NPObject *obj, |
| 65 NPIdentifier name, | 65 NPIdentifier name, |
| 66 NPVariant *result); | 66 NPVariant *result); |
| 67 static bool NPSetProperty(NPObject *obj, | 67 static bool NPSetProperty(NPObject *obj, |
| 68 NPIdentifier name, | 68 NPIdentifier name, |
| 69 const NPVariant *value); | 69 const NPVariant *value); |
| 70 static bool NPRemoveProperty(NPObject *obj, | 70 static bool NPRemoveProperty(NPObject *obj, |
| 71 NPIdentifier name); | 71 NPIdentifier name); |
| 72 static bool NPNEnumerate(NPObject *obj, | 72 static bool NPNEnumerate(NPObject *obj, |
| 73 NPIdentifier **value, | 73 NPIdentifier **value, |
| 74 uint32_t *count); | 74 uint32_t *count); |
| 75 static bool NPNConstruct(NPObject *npobj, |
| 76 const NPVariant *args, |
| 77 uint32_t arg_count, |
| 78 NPVariant *result); |
| 75 | 79 |
| 76 // The next two functions are only called on NPObjects from the browser. | 80 // The next two functions are only called on NPObjects from the browser. |
| 77 static bool NPNEvaluate(NPP npp, | 81 static bool NPNEvaluate(NPP npp, |
| 78 NPObject *obj, | 82 NPObject *obj, |
| 79 NPString *script, | 83 NPString *script, |
| 80 NPVariant *result); | 84 NPVariant *result); |
| 81 | 85 |
| 82 static void NPNSetException(NPObject *obj, | 86 static void NPNSetException(NPObject *obj, |
| 83 const NPUTF8 *message); | 87 const NPUTF8 *message); |
| 84 | 88 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 110 static void NPPInvalidate(NPObject *obj); | 114 static void NPPInvalidate(NPObject *obj); |
| 111 static NPClass npclass_proxy_; | 115 static NPClass npclass_proxy_; |
| 112 | 116 |
| 113 scoped_refptr<PluginChannelBase> channel_; | 117 scoped_refptr<PluginChannelBase> channel_; |
| 114 int route_id_; | 118 int route_id_; |
| 115 intptr_t npobject_ptr_; | 119 intptr_t npobject_ptr_; |
| 116 base::WaitableEvent* modal_dialog_event_; | 120 base::WaitableEvent* modal_dialog_event_; |
| 117 }; | 121 }; |
| 118 | 122 |
| 119 #endif // CHROME_PLUGIN_NPOBJECT_PROXY_H_ | 123 #endif // CHROME_PLUGIN_NPOBJECT_PROXY_H_ |
| OLD | NEW |