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 * | 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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 } | 436 } |
437 | 437 |
438 VOID_TO_NPVARIANT(*result); | 438 VOID_TO_NPVARIANT(*result); |
439 return true; | 439 return true; |
440 } | 440 } |
441 return false; | 441 return false; |
442 } | 442 } |
443 | 443 |
444 static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t
argCount, NPVariant* result) | 444 static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t
argCount, NPVariant* result) |
445 { | 445 { |
446 if (argCount == 1 && NPVARIANT_IS_DOUBLE(args[0])) { | 446 if (argCount != 1) |
447 NPIdentifier identifier = browser->getintidentifier((int)NPVARIANT_TO_DO
UBLE(args[0])); | 447 return false; |
| 448 |
| 449 NPIdentifier identifier; |
| 450 |
| 451 if (NPVARIANT_IS_DOUBLE(args[0])) { |
| 452 identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0])
); |
| 453 INT32_TO_NPVARIANT((int32)identifier, *result); |
| 454 return true; |
| 455 } else if (NPVARIANT_IS_INT32(args[0])) { |
| 456 identifier = browser->getintidentifier((int)NPVARIANT_TO_INT32(args[0]))
; |
448 INT32_TO_NPVARIANT((int32)identifier, *result); | 457 INT32_TO_NPVARIANT((int32)identifier, *result); |
449 return true; | 458 return true; |
450 } | 459 } |
451 return false; | 460 return false; |
452 } | 461 } |
453 | 462 |
454 static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t a
rgCount, NPVariant* result) | 463 static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t a
rgCount, NPVariant* result) |
455 { | 464 { |
456 if (argCount == 0) | 465 if (argCount == 0) |
457 return false; | 466 return false; |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 object->firstUrl = strdup(url); | 823 object->firstUrl = strdup(url); |
815 if (headers) | 824 if (headers) |
816 object->firstHeaders = strdup(headers); | 825 object->firstHeaders = strdup(headers); |
817 } else { | 826 } else { |
818 free(object->lastUrl); | 827 free(object->lastUrl); |
819 free(object->lastHeaders); | 828 free(object->lastHeaders); |
820 object->lastUrl = (url ? strdup(url) : NULL); | 829 object->lastUrl = (url ? strdup(url) : NULL); |
821 object->lastHeaders = (headers ? strdup(headers) : NULL); | 830 object->lastHeaders = (headers ? strdup(headers) : NULL); |
822 } | 831 } |
823 } | 832 } |
OLD | NEW |