Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: Source/bindings/core/v8/npruntime.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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"
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp ('k') | Source/bindings/modules/v8/IDBBindingUtilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698