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-2009 Google, Inc. All rights reserved. | 3 * Copyright (C) 2007-2009 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 | 414 |
415 NPObject* owner = 0; | 415 NPObject* owner = 0; |
416 if (liveObjectMap().find(npObject) != liveObjectMap().end()) | 416 if (liveObjectMap().find(npObject) != liveObjectMap().end()) |
417 owner = liveObjectMap().find(npObject)->value; | 417 owner = liveObjectMap().find(npObject)->value; |
418 | 418 |
419 if (!owner) { | 419 if (!owner) { |
420 // Unregistering a owner object; also unregister it's descendants. | 420 // Unregistering a owner object; also unregister it's descendants. |
421 ASSERT_WITH_SECURITY_IMPLICATION(rootObjectMap().find(npObject) != rootO
bjectMap().end()); | 421 ASSERT_WITH_SECURITY_IMPLICATION(rootObjectMap().find(npObject) != rootO
bjectMap().end()); |
422 NPObjectSet* set = rootObjectMap().get(npObject); | 422 NPObjectSet* set = rootObjectMap().get(npObject); |
423 while (set->size() > 0) { | 423 while (set->size() > 0) { |
424 #ifndef NDEBUG | 424 #if ENABLE(ASSERT) |
425 unsigned size = set->size(); | 425 unsigned size = set->size(); |
426 #endif | 426 #endif |
427 NPObject* sub_object = *(set->begin()); | 427 NPObject* sub_object = *(set->begin()); |
428 // The sub-object should not be a owner! | 428 // The sub-object should not be a owner! |
429 ASSERT(rootObjectMap().find(sub_object) == rootObjectMap().end()); | 429 ASSERT(rootObjectMap().find(sub_object) == rootObjectMap().end()); |
430 | 430 |
431 // First, unregister the object. | 431 // First, unregister the object. |
432 set->remove(sub_object); | 432 set->remove(sub_object); |
433 liveObjectMap().remove(sub_object); | 433 liveObjectMap().remove(sub_object); |
434 | 434 |
(...skipping 21 matching lines...) Expand all Loading... |
456 liveObjectMap().remove(npObject); | 456 liveObjectMap().remove(npObject); |
457 forgetV8ObjectForNPObject(npObject); | 457 forgetV8ObjectForNPObject(npObject); |
458 } | 458 } |
459 | 459 |
460 bool _NPN_IsAlive(NPObject* npObject) | 460 bool _NPN_IsAlive(NPObject* npObject) |
461 { | 461 { |
462 return liveObjectMap().find(npObject) != liveObjectMap().end(); | 462 return liveObjectMap().find(npObject) != liveObjectMap().end(); |
463 } | 463 } |
464 | 464 |
465 } // extern "C" | 465 } // extern "C" |
OLD | NEW |