OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Holger Hans Peter Freyther | 3 * Copyright (C) 2009 Holger Hans Peter Freyther |
4 * Copyright (C) 2010 Collabora Ltd. | 4 * Copyright (C) 2010 Collabora Ltd. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 12 matching lines...) Expand all Loading... |
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #include "PluginObject.h" | 28 #include "PluginObject.h" |
29 | 29 |
30 #include "PluginTest.h" | 30 #include "PluginTest.h" |
31 #include "TestObject.h" | 31 #include "TestObject.h" |
32 #include <assert.h> | 32 #include <assert.h> |
33 #include <stdarg.h> | |
34 #include <stdio.h> | 33 #include <stdio.h> |
35 #include <stdlib.h> | 34 #include <stdlib.h> |
36 #include <string.h> | 35 #include <string.h> |
37 | 36 |
38 // Helper function which takes in the plugin window object for logging to the co
nsole object. | 37 // Helper function which takes in the plugin window object for logging to the co
nsole object. |
39 static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, cons
t char* message) | 38 static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, cons
t char* message) |
40 { | 39 { |
41 NPVariant consoleVariant; | 40 NPVariant consoleVariant; |
42 if (!browser->getproperty(instance, windowObject, browser->getstringidentifi
er("console"), &consoleVariant)) { | 41 if (!browser->getproperty(instance, windowObject, browser->getstringidentifi
er("console"), &consoleVariant)) { |
43 fprintf(stderr, "Failed to retrieve console object while logging: %s\n",
message); | 42 fprintf(stderr, "Failed to retrieve console object while logging: %s\n",
message); |
(...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 DOUBLE_TO_NPVARIANT(242.242, args[4]); | 1300 DOUBLE_TO_NPVARIANT(242.242, args[4]); |
1302 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); | 1301 STRINGZ_TO_NPVARIANT("Hello, World", args[5]); |
1303 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); | 1302 OBJECT_TO_NPVARIANT(windowScriptObject, args[6]); |
1304 | 1303 |
1305 NPVariant result; | 1304 NPVariant result; |
1306 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)
) | 1305 if (browser->invoke(npp, windowScriptObject, testNPInvoke, args, 7, &result)
) |
1307 browser->releasevariantvalue(&result); | 1306 browser->releasevariantvalue(&result); |
1308 | 1307 |
1309 browser->releaseobject(windowScriptObject); | 1308 browser->releaseobject(windowScriptObject); |
1310 } | 1309 } |
OLD | NEW |