OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 InvokeDestroysPluginWithinNPP_New::InvokeDestroysPluginWithinNPP_New(NPP npp, co
nst string& identifier) | 43 InvokeDestroysPluginWithinNPP_New::InvokeDestroysPluginWithinNPP_New(NPP npp, co
nst string& identifier) |
44 : PluginTest(npp, identifier) | 44 : PluginTest(npp, identifier) |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 NPError InvokeDestroysPluginWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16
_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) | 48 NPError InvokeDestroysPluginWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16
_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) |
49 { | 49 { |
50 // Give the WebProcess enough time to be deadlocked waiting for the PluginPr
ocess if things aren't working correctly. | 50 // Give the WebProcess enough time to be deadlocked waiting for the PluginPr
ocess if things aren't working correctly. |
51 usleep(15000); | 51 usleep(15000); |
52 | 52 |
53 NPObject* windowObject = 0; | 53 NPObject* windowObject = 0; |
54 if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR) | 54 if (NPN_GetValue(NPNVWindowNPObject, &windowObject) != NPERR_NO_ERROR) |
55 return NPERR_GENERIC_ERROR; | 55 return NPERR_GENERIC_ERROR; |
56 | 56 |
57 if (!windowObject) | 57 if (!windowObject) |
58 return NPERR_GENERIC_ERROR; | 58 return NPERR_GENERIC_ERROR; |
59 | 59 |
60 NPVariant result; | 60 NPVariant result; |
61 if (!NPN_Invoke(windowObject, NPN_GetStringIdentifier("removePluginElement")
, 0, 0, &result)) | 61 if (!NPN_Invoke(windowObject, NPN_GetStringIdentifier("removePluginElement")
, 0, 0, &result)) |
62 return NPERR_GENERIC_ERROR; | 62 return NPERR_GENERIC_ERROR; |
63 | 63 |
64 return NPERR_NO_ERROR; | 64 return NPERR_NO_ERROR; |
65 } | 65 } |
66 | 66 |
67 static PluginTest::Register<InvokeDestroysPluginWithinNPP_New> registrar("invoke
-destroys-plugin-within-npp-new"); | 67 static PluginTest::Register<InvokeDestroysPluginWithinNPP_New> registrar("invoke
-destroys-plugin-within-npp-new"); |
OLD | NEW |