| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Google, Inc. All rights reserved. | 3 * Copyright (C) 2007 Google, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 variant->value.objectValue = 0; | 162 variant->value.objectValue = 0; |
| 163 } else if (variant->type == NPVariantType_String) { | 163 } else if (variant->type == NPVariantType_String) { |
| 164 free((void*)variant->value.stringValue.UTF8Characters); | 164 free((void*)variant->value.stringValue.UTF8Characters); |
| 165 variant->value.stringValue.UTF8Characters = 0; | 165 variant->value.stringValue.UTF8Characters = 0; |
| 166 variant->value.stringValue.UTF8Length = 0; | 166 variant->value.stringValue.UTF8Length = 0; |
| 167 } | 167 } |
| 168 | 168 |
| 169 variant->type = NPVariantType_Void; | 169 variant->type = NPVariantType_Void; |
| 170 } | 170 } |
| 171 | 171 |
| 172 static const wchar_t* kCounterNPObjects = L"NPObjects"; | 172 static const char* kCounterNPObjects = "NPObjects"; |
| 173 | 173 |
| 174 NPObject *NPN_CreateObject(NPP npp, NPClass* aClass) { | 174 NPObject *NPN_CreateObject(NPP npp, NPClass* aClass) { |
| 175 ASSERT(aClass); | 175 ASSERT(aClass); |
| 176 | 176 |
| 177 if (aClass) { | 177 if (aClass) { |
| 178 NPObject* obj; | 178 NPObject* obj; |
| 179 if (aClass->allocate != NULL) | 179 if (aClass->allocate != NULL) |
| 180 obj = aClass->allocate(npp, aClass); | 180 obj = aClass->allocate(npp, aClass); |
| 181 else | 181 else |
| 182 obj = reinterpret_cast<NPObject*>(malloc(sizeof(NPObject))); | 182 obj = reinterpret_cast<NPObject*>(malloc(sizeof(NPObject))); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 ForgetV8ObjectForNPObject(obj); | 351 ForgetV8ObjectForNPObject(obj); |
| 352 | 352 |
| 353 g_live_objects.erase(obj); | 353 g_live_objects.erase(obj); |
| 354 } | 354 } |
| 355 | 355 |
| 356 bool _NPN_IsAlive(NPObject* obj) { | 356 bool _NPN_IsAlive(NPObject* obj) { |
| 357 return g_live_objects.find(obj) != g_live_objects.end(); | 357 return g_live_objects.find(obj) != g_live_objects.end(); |
| 358 } | 358 } |
| 359 | 359 |
| 360 } // extern "C" | 360 } // extern "C" |
| OLD | NEW |