| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/common/mac/objc_zombie.h" | 5 #import "chrome/common/mac/objc_zombie.h" |
| 6 | 6 |
| 7 #include <AvailabilityMacros.h> | 7 #include <AvailabilityMacros.h> |
| 8 | 8 |
| 9 #include <execinfo.h> | 9 #include <execinfo.h> |
| 10 #import <objc/runtime.h> | 10 #import <objc/runtime.h> |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 | 13 |
| 14 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
| 15 #include "base/debug/stack_trace.h" | 15 #include "base/debug/stack_trace.h" |
| 16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
| 19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
| 20 #include "chrome/common/crash_keys.h" | 20 #include "chrome/common/crash_keys.h" |
| 21 #import "chrome/common/mac/objc_method_swizzle.h" | |
| 22 | 21 |
| 23 #if !defined(OS_IOS) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6) | 22 #if !defined(OS_IOS) && (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_6) |
| 24 // Apparently objc/runtime.h doesn't define this with the 10.6 SDK yet. | 23 // Apparently objc/runtime.h doesn't define this with the 10.6 SDK yet. |
| 25 // The docs say it exists since 10.6 however. | 24 // The docs say it exists since 10.6 however. |
| 26 OBJC_EXPORT void *objc_destructInstance(id obj); | 25 OBJC_EXPORT void *objc_destructInstance(id obj); |
| 27 #endif | 26 #endif |
| 28 | 27 |
| 29 // Deallocated objects are re-classed as |CrZombie|. No superclass | 28 // Deallocated objects are re-classed as |CrZombie|. No superclass |
| 30 // because then the class would have to override many/most of the | 29 // because then the class would have to override many/most of the |
| 31 // inherited methods (|NSObject| is like a category magnet!). | 30 // inherited methods (|NSObject| is like a category magnet!). |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 if (oldZombies) { | 421 if (oldZombies) { |
| 423 for (size_t i = 0; i < oldCount; ++i) { | 422 for (size_t i = 0; i < oldCount; ++i) { |
| 424 if (oldZombies[i].object) | 423 if (oldZombies[i].object) |
| 425 object_dispose(oldZombies[i].object); | 424 object_dispose(oldZombies[i].object); |
| 426 } | 425 } |
| 427 free(oldZombies); | 426 free(oldZombies); |
| 428 } | 427 } |
| 429 } | 428 } |
| 430 | 429 |
| 431 } // namespace ObjcEvilDoers | 430 } // namespace ObjcEvilDoers |
| OLD | NEW |