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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
435 // Script objects hold a refernce to their DOMWindow*, which is goin
g away if | 435 // Script objects hold a refernce to their LocalDOMWindow*, which is
going away if |
436 // we're unregistering the associated owner NPObject. Clear it out. | 436 // we're unregistering the associated owner NPObject. Clear it out. |
437 if (V8NPObject* v8npObject = npObjectToV8NPObject(sub_object)) | 437 if (V8NPObject* v8npObject = npObjectToV8NPObject(sub_object)) |
438 v8npObject->rootObject = 0; | 438 v8npObject->rootObject = 0; |
439 | 439 |
440 // Remove the JS references to the object. | 440 // Remove the JS references to the object. |
441 forgetV8ObjectForNPObject(sub_object); | 441 forgetV8ObjectForNPObject(sub_object); |
442 | 442 |
443 ASSERT(set->size() < size); | 443 ASSERT(set->size() < size); |
444 } | 444 } |
445 delete set; | 445 delete set; |
(...skipping 10 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 |